Class EventGridCloudNativeEventPublisher

java.lang.Object
com.azure.messaging.eventgrid.cloudnative.cloudevents.EventGridCloudNativeEventPublisher

public final class EventGridCloudNativeEventPublisher extends Object
EventGrid cloud native event publisher sends the Cloud Native Computing Foundation(CNCF) CloudEvents by using Azure EventGrid publisher client, see EventGridPublisherClient.
  • 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 - if event 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 - if event 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 - if events 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 - if events 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 - if events 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 - if events is null.