Class EventGridSenderClient
java.lang.Object
com.azure.messaging.eventgrid.namespaces.EventGridSenderClient
Initializes a new instance of the synchronous EventGridSenderClient type.
-
Method Summary
Modifier and TypeMethodDescriptionGets the topicName for this client.voidsend(com.azure.core.models.CloudEvent event) Publish a single Cloud Event to a namespace topic.voidPublish a batch of Cloud Events to a namespace topic.com.azure.core.http.rest.Response<Void> sendWithResponse(com.azure.core.models.CloudEvent event, com.azure.core.http.rest.RequestOptions requestOptions) Publish a single Cloud Event to a namespace topic.com.azure.core.http.rest.Response<Void> sendWithResponse(List<com.azure.core.models.CloudEvent> events, com.azure.core.http.rest.RequestOptions requestOptions) Publish a batch of Cloud Events to a namespace topic.
-
Method Details
-
send
public void send(com.azure.core.models.CloudEvent event) Publish a single Cloud Event to a namespace topic.- Parameters:
event- Single Cloud Event being published.- Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
sendWithResponse
public com.azure.core.http.rest.Response<Void> sendWithResponse(com.azure.core.models.CloudEvent event, com.azure.core.http.rest.RequestOptions requestOptions) Publish a single Cloud Event to a namespace topic.- Parameters:
event- Array of Cloud Events being published.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- The
Responseof the send operation. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
send
Publish a batch of Cloud Events to a namespace topic.- Parameters:
events- Array of Cloud Events being published.- Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
sendWithResponse
public com.azure.core.http.rest.Response<Void> sendWithResponse(List<com.azure.core.models.CloudEvent> events, com.azure.core.http.rest.RequestOptions requestOptions) Publish a batch of Cloud Events to a namespace topic.- Parameters:
events- Array of Cloud Events being published.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- The
Responseof the send operation. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getTopicName
Gets the topicName for this client.- Returns:
- the topic name.
-