You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For backwards compatibility, a flat array of HTTP subscribers is still supported:
77
+
78
+
```json
79
+
{
80
+
"subscribers": [
81
+
{
82
+
"name": "WebhookSubscription",
83
+
"endpoint": "https://example.com/webhook"
84
+
}
85
+
]
86
+
}
87
+
```
88
+
89
+
#### HTTP Subscriber Settings
90
+
50
91
| Setting | Description |
51
92
|---------|-------------|
52
93
|`name`| The name of the subscriber. It can only contain letters, numbers, and dashes. |
53
94
|`endpoint`| The subscription endpoint url. Events received by topic will be sent to this address. |
54
95
|`disableValidation`| Set to `true` to disable subscription validation. Default is `false`, which means subscription validation will be attempted each time the simulator starts. |
55
96
|`deliverySchema`| (Optional) Override the delivery schema for this specific subscriber. Values: `EventGridSchema` or `CloudEventV1_0`. Takes precedence over the topic's `outputSchema`. |
56
97
98
+
#### Service Bus Subscriber Settings
99
+
100
+
| Setting | Description |
101
+
|---------|-------------|
102
+
|`name`| The name of the subscriber. |
103
+
|`connectionString`| The Service Bus connection string. Either this OR (`namespace` + `sharedAccessKeyName` + `sharedAccessKey`) must be provided. |
104
+
|`namespace`| The Service Bus namespace (without `.servicebus.windows.net` suffix). |
105
+
|`sharedAccessKeyName`| The shared access key name (e.g., `RootManageSharedAccessKey`). |
106
+
|`sharedAccessKey`| The shared access key. |
107
+
|`queue`| The queue name. Either `queue` or `topic` must be specified (not both). |
108
+
|`topic`| The topic name. Either `queue` or `topic` must be specified (not both). |
109
+
|`deliverySchema`| (Optional) Override the delivery schema. Values: `EventGridSchema` or `CloudEventV1_0`. |
110
+
|`properties`| (Optional) Custom delivery properties to add to Service Bus messages. See below. |
111
+
112
+
#### Service Bus Delivery Properties
113
+
114
+
You can add custom application properties to Service Bus messages using static or dynamic values:
115
+
116
+
```json
117
+
{
118
+
"properties": {
119
+
"Region": {
120
+
"type": "static",
121
+
"value": "west-us"
122
+
},
123
+
"EventType": {
124
+
"type": "dynamic",
125
+
"value": "EventType"
126
+
},
127
+
"CustomerId": {
128
+
"type": "dynamic",
129
+
"value": "data.customerId"
130
+
}
131
+
}
132
+
}
133
+
```
134
+
135
+
-**Static properties**: The `value` is used as-is.
136
+
-**Dynamic properties**: The `value` is a path to extract from the event. Supported paths:
There is a `docker-compose.yml` file in the src folder that you can use (or modify) to build your own Docker image.
319
+
There is a `docker-compose.yml` file in the repo root that you can use to build and run the simulator along with an Azure Service Bus emulator for local development.
199
320
200
321
```
201
-
docker-compose up --build `
202
-
--force-recreate `
203
-
--remove-orphans `
204
-
--detach
322
+
docker-compose up --build --detach
205
323
```
206
324
325
+
The Docker Compose setup includes:
326
+
-**Azure Event Grid Simulator** - The main simulator
327
+
-**Azure Service Bus Emulator** - For testing Service Bus subscribers locally
328
+
-**SQL Server** - Required by the Service Bus emulator
329
+
330
+
See `docker/appsettings.docker.json` for an example configuration with both HTTP and Service Bus subscribers.
331
+
207
332
## Using the Simulator
208
333
209
334
Once configured and running, requests are `posted` to a topic endpoint. The endpoint of a topic will be in the form: `https://localhost:<configured-port>/api/events?api-version=2018-01-01`.
@@ -372,10 +497,11 @@ dotnet csharpier format src
372
497
373
498
## Future Development
374
499
375
-
Some features that could be added if there was a need for them: -
500
+
Some features that could be added if there was a need for them:
376
501
377
502
- Subscriber retries & dead lettering. https://docs.microsoft.com/en-us/azure/event-grid/delivery-and-retry
378
503
- Certificate configuration in `appsettings.json`.
0 commit comments