Class EventGridCloudNativeEventPublisher
java.lang.Object
com.azure.messaging.eventgrid.cloudnative.cloudevents.EventGridCloudNativeEventPublisher
EventGrid cloud native event publisher sends the Cloud Native Computing Foundation(CNCF) CloudEvents by using
Azure EventGrid publisher client, see
EventGridPublisherClient
.-
Method Summary
Modifier and TypeMethodDescriptionstatic void
sendEvent
(EventGridPublisherClient<CloudEvent> syncClient, io.cloudevents.CloudEvent event) Publishes the given native cloud event to the set topic or domain.sendEventAsync
(EventGridPublisherAsyncClient<CloudEvent> asyncClient, io.cloudevents.CloudEvent event) Publishes the given native cloud event to the set topic or domain.static void
sendEvents
(EventGridPublisherClient<CloudEvent> syncClient, Iterable<io.cloudevents.CloudEvent> events) Publishes the given native cloud events to the set topic or domain.sendEventsAsync
(EventGridPublisherAsyncClient<CloudEvent> asyncClient, Iterable<io.cloudevents.CloudEvent> events) Publishes the given native cloud events to the set topic or domain.sendEventsWithResponse
(EventGridPublisherClient<CloudEvent> syncClient, Iterable<io.cloudevents.CloudEvent> events, Context context) Publishes the given native cloud events to the set topic or domain and gives the response issued by EventGrid.sendEventsWithResponseAsync
(EventGridPublisherAsyncClient<CloudEvent> asyncClient, Iterable<io.cloudevents.CloudEvent> events) Publishes the given native cloud events to the set topic or domain and gives the response issued by EventGrid.
-
Method Details
-
sendEvent
public static void sendEvent(EventGridPublisherClient<CloudEvent> syncClient, io.cloudevents.CloudEvent event) Publishes the given native cloud event to the set topic or domain.- Parameters:
syncClient
- a service client that publishes events to an EventGrid topic or domain.event
- the native cloud event to publish.- Throws:
NullPointerException
- ifevent
is null.
-
sendEventAsync
public static Mono<Void> sendEventAsync(EventGridPublisherAsyncClient<CloudEvent> asyncClient, io.cloudevents.CloudEvent event) Publishes the given native cloud event to the set topic or domain.- Parameters:
asyncClient
- a service asynchronous client that publishes events to an EventGrid topic or domain.event
- the native cloud event to publish.- Returns:
- a Mono that completes when the events are sent to the service.
- Throws:
NullPointerException
- ifevent
is null.
-
sendEvents
public static void sendEvents(EventGridPublisherClient<CloudEvent> syncClient, Iterable<io.cloudevents.CloudEvent> events) Publishes the given native cloud events to the set topic or domain.- Parameters:
syncClient
- a service client that publishes events to an EventGrid topic or domain.events
- the native cloud events to publish.- Throws:
NullPointerException
- ifevents
is null.
-
sendEventsAsync
public static Mono<Void> sendEventsAsync(EventGridPublisherAsyncClient<CloudEvent> asyncClient, Iterable<io.cloudevents.CloudEvent> events) Publishes the given native cloud events to the set topic or domain.- Parameters:
asyncClient
- a service asynchronous client that publishes events to an EventGrid topic or domain.events
- the native cloud events to publish.- Returns:
- a Mono that completes when the events are sent to the service.
- Throws:
NullPointerException
- ifevents
is null.
-
sendEventsWithResponse
public static Response<Void> sendEventsWithResponse(EventGridPublisherClient<CloudEvent> syncClient, Iterable<io.cloudevents.CloudEvent> events, Context context) Publishes the given native cloud events to the set topic or domain and gives the response issued by EventGrid.- Parameters:
syncClient
- a service client that publishes events to an EventGrid topic or domain.events
- the native cloud events to publish.context
- the context to use along the pipeline.- Returns:
- the response from the EventGrid service.
- Throws:
NullPointerException
- ifevents
is null.
-
sendEventsWithResponseAsync
public static Mono<Response<Void>> sendEventsWithResponseAsync(EventGridPublisherAsyncClient<CloudEvent> asyncClient, Iterable<io.cloudevents.CloudEvent> events) Publishes the given native cloud events to the set topic or domain and gives the response issued by EventGrid.- Parameters:
asyncClient
- a service asynchronous client that publishes events to an EventGrid topic or domain.events
- the native cloud events to publish.- Returns:
- the response from the EventGrid service.
- Throws:
NullPointerException
- ifevents
is null.
-