@@ -283,6 +283,16 @@ the synchronous client is used for samples, however the asynchronous client has
283
283
Note: figure out what schema (cloud event, event grid event, or custom event) the event grid topic accepts before you start sending.
284
284
#### Sending ` EventGridEvent ` to a topic that accepts EventGridEvent schema
285
285
286
+ ``` java readme-sample-sendEventGridEventsToTopic
287
+ // Make sure that the event grid topic or domain you're sending to is able to accept the EventGridEvent schema.
288
+ List<EventGridEvent > events = new ArrayList<> ();
289
+ User user = new User (" John" , " James" );
290
+ events. add(new EventGridEvent (" exampleSubject" , " Com.Example.ExampleEventType" , BinaryData . fromObject(user), " 0.1" ));
291
+ eventGridEventClient. sendEvents(events);
292
+ ```
293
+
294
+ #### Sending ` CloudEvent ` to a topic that accepts CloudEvent schema
295
+
286
296
``` java readme-sample-sendCloudEventsToTopic
287
297
// Make sure that the event grid topic or domain you're sending to is able to accept the CloudEvent schema.
288
298
List<CloudEvent > events = new ArrayList<> ();
@@ -292,16 +302,6 @@ events.add(new CloudEvent("https://source.example.com", "Com.Example.ExampleEven
292
302
cloudEventClient. sendEvents(events);
293
303
```
294
304
295
- #### Sending ` CloudEvent ` to a topic that accepts CloudEvent schema
296
-
297
- ``` java readme-sample-sendEventGridEventsToTopic
298
- // Make sure that the event grid topic or domain you're sending to is able to accept the EventGridEvent schema.
299
- List<EventGridEvent > events = new ArrayList<> ();
300
- User user = new User (" John" , " James" );
301
- events. add(new EventGridEvent (" exampleSubject" , " Com.Example.ExampleEventType" , BinaryData . fromObject(user), " 0.1" ));
302
- eventGridEventClient. sendEvents(events);
303
- ```
304
-
305
305
#### Sending Custom Events to a topic that accepts custom event schema
306
306
307
307
``` java readme-sample-sendCustomEventsToTopic
0 commit comments