| title | include file |
|---|---|
| author | spelluru |
| ms.service | azure-service-bus |
| ms.topic | include |
| ms.date | 12/08/2022 |
| ms.author | spelluru |
Service Bus emits the following event types:
| Event type | Description |
|---|---|
Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners |
Raised when a new active message arrives in a queue or subscription and there are no receivers listening. |
Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners |
Raised when a new active messages arrives in a dead letter queue and there are no active listeners. |
Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications |
Raised every 30 seconds if there are active messages in a queue or subscription, even if there are active listeners on that specific queue or subscription. It's also raised when the active message count transitions from 0 to a positive value for the queue or subscription. |
Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications |
Raised every 30 seconds if there are messages in the dead-letter entity of a queue or subscription, even if there are active listeners on the dead-letter entity of that specific queue or subscription. It's also raised when the dead-letter message count transitions from 0 to a positive value for the dead-letter entity of the queue or subscription. |
This event is generated if you have active messages in a queue or a subscription and there are no receivers listening.
[{
"topic": "/subscriptions/{subscription-id}/resourcegroups/{your-rg}/providers/Microsoft.ServiceBus/namespaces/{your-service-bus-namespace}",
"subject": "topics/{your-service-bus-topic}/subscriptions/{your-service-bus-subscription}",
"eventType": "Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners",
"eventTime": "2018-02-14T05:12:53.4133526Z",
"id": "dede87b0-3656-419c-acaf-70c95ddc60f5",
"data": {
"namespaceName": "YOUR SERVICE BUS NAMESPACE WILL SHOW HERE",
"requestUri": "https://{your-service-bus-namespace}.servicebus.windows.net/{your-topic}/subscriptions/{your-service-bus-subscription}/messages/head",
"entityType": "subscriber",
"queueName": "QUEUE NAME IF QUEUE",
"topicName": "TOPIC NAME IF TOPIC",
"subscriptionName": "SUBSCRIPTION NAME"
},
"dataVersion": "1",
"metadataVersion": "1"
}]The schema for a dead letter queue event is similar. You get at least one event per dead-letter queue that has messages and no active receivers.
[{
"topic": "/subscriptions/{subscription-id}/resourcegroups/{your-rg}/providers/Microsoft.ServiceBus/namespaces/{your-service-bus-namespace}",
"subject": "topics/{your-service-bus-topic}/subscriptions/{your-service-bus-subscription}",
"eventType": "Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners",
"eventTime": "2018-02-14T05:12:53.4133526Z",
"id": "dede87b0-3656-419c-acaf-70c95ddc60f5",
"data": {
"namespaceName": "YOUR SERVICE BUS NAMESPACE WILL SHOW HERE",
"requestUri": "https://{your-service-bus-namespace}.servicebus.windows.net/{your-topic}/subscriptions/{your-service-bus-subscription}/$deadletterqueue/messages/head",
"entityType": "subscriber",
"queueName": "QUEUE NAME IF QUEUE",
"topicName": "TOPIC NAME IF TOPIC",
"subscriptionName": "SUBSCRIPTION NAME"
},
"dataVersion": "1",
"metadataVersion": "1"
}]This event is generated periodically if you have active messages in the specific queue or subscription, even if there are active listeners for that specific queue or subscription.
[{
"topic": "/subscriptions/<subscription id>/resourcegroups/DemoGroup/providers/Microsoft.ServiceBus/namespaces/<YOUR SERVICE BUS NAMESPACE WILL SHOW HERE>",
"subject": "topics/<service bus topic>/subscriptions/<service bus subscription>",
"eventType": "Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications",
"eventTime": "2018-02-14T05:12:53.4133526Z",
"id": "dede87b0-3656-419c-acaf-70c95ddc60f5",
"data": {
"namespaceName": "YOUR SERVICE BUS NAMESPACE WILL SHOW HERE",
"requestUri": "https://YOUR-SERVICE-BUS-NAMESPACE-WILL-SHOW-HERE.servicebus.windows.net/TOPIC-NAME/subscriptions/SUBSCRIPTIONNAME/$deadletterqueue/messages/head",
"entityType": "subscriber",
"queueName": "QUEUE NAME IF QUEUE",
"topicName": "TOPIC NAME IF TOPIC",
"subscriptionName": "SUBSCRIPTION NAME"
},
"dataVersion": "1",
"metadataVersion": "1"
}]This event is generated periodically if you have deadletter messages on the specific queue or subscription, even if there are active listeners on the deadletter entity of that specific queue or subscription.
[{
"topic": "/subscriptions/<subscription id>/resourcegroups/DemoGroup/providers/Microsoft.ServiceBus/namespaces/<YOUR SERVICE BUS NAMESPACE WILL SHOW HERE>",
"subject": "topics/<service bus topic>/subscriptions/<service bus subscription>",
"eventType": "Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications",
"eventTime": "2018-02-14T05:12:53.4133526Z",
"id": "dede87b0-3656-419c-acaf-70c95ddc60f5",
"data": {
"namespaceName": "YOUR SERVICE BUS NAMESPACE WILL SHOW HERE",
"requestUri": "https://YOUR-SERVICE-BUS-NAMESPACE-WILL-SHOW-HERE.servicebus.windows.net/TOPIC-NAME/subscriptions/SUBSCRIPTIONNAME/$deadletterqueue/messages/head",
"entityType": "subscriber",
"queueName": "QUEUE NAME IF QUEUE",
"topicName": "TOPIC NAME IF TOPIC",
"subscriptionName": "SUBSCRIPTION NAME"
},
"dataVersion": "1",
"metadataVersion": "1"
}]This event is generated if you have active messages in a queue or a subscription and there are no receivers listening.
[{
"source": "/subscriptions/{subscription-id}/resourcegroups/{your-rg}/providers/Microsoft.ServiceBus/namespaces/{your-service-bus-namespace}",
"subject": "topics/{your-service-bus-topic}/subscriptions/{your-service-bus-subscription}",
"type": "Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners",
"time": "2018-02-14T05:12:53.4133526Z",
"id": "dede87b0-3656-419c-acaf-70c95ddc60f5",
"data": {
"namespaceName": "YOUR SERVICE BUS NAMESPACE WILL SHOW HERE",
"requestUri": "https://{your-service-bus-namespace}.servicebus.windows.net/{your-topic}/subscriptions/{your-service-bus-subscription}/messages/head",
"entityType": "subscriber",
"queueName": "QUEUE NAME IF QUEUE",
"topicName": "TOPIC NAME IF TOPIC",
"subscriptionName": "SUBSCRIPTION NAME"
},
"specversion": "1.0"
}]The schema for a dead letter queue event is similar. You get at least one event per dead-letter queue that has messages and no active receivers.
[{
"source": "/subscriptions/{subscription-id}/resourcegroups/{your-rg}/providers/Microsoft.ServiceBus/namespaces/{your-service-bus-namespace}",
"subject": "topics/{your-service-bus-topic}/subscriptions/{your-service-bus-subscription}",
"type": "Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListeners",
"time": "2018-02-14T05:12:53.4133526Z",
"id": "dede87b0-3656-419c-acaf-70c95ddc60f5",
"data": {
"namespaceName": "YOUR SERVICE BUS NAMESPACE WILL SHOW HERE",
"requestUri": "https://{your-service-bus-namespace}.servicebus.windows.net/{your-topic}/subscriptions/{your-service-bus-subscription}/$deadletterqueue/messages/head",
"entityType": "subscriber",
"queueName": "QUEUE NAME IF QUEUE",
"topicName": "TOPIC NAME IF TOPIC",
"subscriptionName": "SUBSCRIPTION NAME"
},
"specversion": "1.0"
}]This event is generated periodically if you have active messages on the specific queue or subscription, even if there are active listeners on that specific queue or subscription.
[{
"source": "/subscriptions/<subscription id>/resourcegroups/DemoGroup/providers/Microsoft.ServiceBus/namespaces/<YOUR SERVICE BUS NAMESPACE WILL SHOW HERE>",
"subject": "topics/<service bus topic>/subscriptions/<service bus subscription>",
"type": "Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications",
"time": "2018-02-14T05:12:53.4133526Z",
"id": "dede87b0-3656-419c-acaf-70c95ddc60f5",
"data": {
"namespaceName": "YOUR SERVICE BUS NAMESPACE WILL SHOW HERE",
"requestUri": "https://YOUR-SERVICE-BUS-NAMESPACE-WILL-SHOW-HERE.servicebus.windows.net/TOPIC-NAME/subscriptions/SUBSCRIPTIONNAME/$deadletterqueue/messages/head",
"entityType": "subscriber",
"queueName": "QUEUE NAME IF QUEUE",
"topicName": "TOPIC NAME IF TOPIC",
"subscriptionName": "SUBSCRIPTION NAME"
},
"specversion": "1.0"
}]This event is generated periodically if you have deadletter messages on the specific queue or subscription, even if there are active listeners on the deadletter entity of that specific queue or subscription.
[{
"source": "/subscriptions/<subscription id>/resourcegroups/DemoGroup/providers/Microsoft.ServiceBus/namespaces/<YOUR SERVICE BUS NAMESPACE WILL SHOW HERE>",
"subject": "topics/<service bus topic>/subscriptions/<service bus subscription>",
"type": "Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications",
"time": "2018-02-14T05:12:53.4133526Z",
"id": "dede87b0-3656-419c-acaf-70c95ddc60f5",
"data": {
"namespaceName": "YOUR SERVICE BUS NAMESPACE WILL SHOW HERE",
"requestUri": "https://YOUR-SERVICE-BUS-NAMESPACE-WILL-SHOW-HERE.servicebus.windows.net/TOPIC-NAME/subscriptions/SUBSCRIPTIONNAME/$deadletterqueue/messages/head",
"entityType": "subscriber",
"queueName": "QUEUE NAME IF QUEUE",
"topicName": "TOPIC NAME IF TOPIC",
"subscriptionName": "SUBSCRIPTION NAME"
},
"specversion": "1.0"
}]An event has the following top-level data:
| Property | Type | Description |
|---|---|---|
topic |
string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
subject |
string | Publisher-defined path to the event subject. |
eventType |
string | One of the registered event types for this event source. |
eventTime |
string | The time the event is generated based on the provider's UTC time. |
id |
string | Unique identifier for the event. |
data |
object | Service Bus event data. |
dataVersion |
string | The schema version of the data object. The publisher defines the schema version. |
metadataVersion |
string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
An event has the following top-level data:
| Property | Type | Description |
|---|---|---|
source |
string | Full resource path to the event source. This field isn't writeable. Event Grid provides this value. |
subject |
string | Publisher-defined path to the event subject. |
type |
string | One of the registered event types for this event source. |
time |
string | The time the event is generated based on the provider's UTC time. |
id |
string | Unique identifier for the event. |
data |
object | Service Bus event data. |
specversion |
string | CloudEvents schema specification version. |
The data object has the following properties:
| Property | Type | Description |
|---|---|---|
namespaceName |
string | The Service Bus namespace the resource exists in. |
requestUri |
string | The URI to the specific queue or subscription emitting the event. |
entityType |
string | The type of Service Bus entity emitting events (queue or subscription). |
queueName |
string | The queue with active messages if subscribing to a queue. Value null if using topics / subscriptions. |
topicName |
string | The topic the Service Bus subscription with active messages belongs to. Value null if using a queue. |
subscriptionName |
string | The Service Bus subscription with active messages. Value null if using a queue. |