Class EventGridReceiverClient

java.lang.Object
com.azure.messaging.eventgrid.namespaces.EventGridReceiverClient

public final class EventGridReceiverClient extends Object
Initializes a new instance of the synchronous EventGridReceiverClient type.
  • Method Details

    • receive

      public ReceiveResult receive(Integer maxEvents, Duration maxWaitTime)
      Receive a batch of Cloud Events from a subscription.
      Parameters:
      maxEvents - Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1.
      maxWaitTime - Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. Fractional seconds are ignored and rounded down.
      Returns:
      details of the Receive operation response.
      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.
    • receiveWithResponse

      public com.azure.core.http.rest.Response<ReceiveResult> receiveWithResponse(Integer maxEvents, Duration maxWaitTime, com.azure.core.http.rest.RequestOptions requestOptions)
      Receive a batch of Cloud Events from a subscription.
      Parameters:
      maxEvents - Max Events count to be received. Minimum value is 1, while maximum value is 100 events. If not specified, the default value is 1.
      maxWaitTime - Max wait time value for receive operation in Seconds. It is the time in seconds that the server approximately waits for the availability of an event and responds to the request. If an event is available, the broker responds immediately to the client. Minimum value is 10 seconds, while maximum value is 120 seconds. If not specified, the default value is 60 seconds. Fractional seconds are ignored and rounded down.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      details of the Receive operation response along with Response.
      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.
    • receive

      public ReceiveResult receive()
      Receive a Cloud Event from a subscription. This method will wait 60 seconds for a response.
      Returns:
      details of the Receive operation response.
      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.
    • acknowledge

      public AcknowledgeResult acknowledge(List<String> lockTokens)
      Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer.
      Parameters:
      lockTokens - Array of lock tokens.
      Returns:
      the result of the Acknowledge 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.
    • acknowledgeWithResponse

      public com.azure.core.http.rest.Response<AcknowledgeResult> acknowledgeWithResponse(List<String> lockTokens, com.azure.core.http.rest.RequestOptions requestOptions)
      Acknowledge a batch of Cloud Events. The response will include the set of successfully acknowledged lock tokens, along with other failed lock tokens with their corresponding error information. Successfully acknowledged events will no longer be available to be received by any consumer.
      Parameters:
      lockTokens - Array of lock tokens.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the result of the Acknowledge operation along with Response.
      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.
    • release

      public ReleaseResult release(List<String> lockTokens, ReleaseDelay releaseDelay)
      Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers.
      Parameters:
      lockTokens - Array of lock tokens.
      releaseDelay - Release cloud events with the specified delay in seconds.
      Returns:
      the result of the Release 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.
    • releaseWithResponse

      public com.azure.core.http.rest.Response<ReleaseResult> releaseWithResponse(List<String> lockTokens, ReleaseDelay releaseDelay, com.azure.core.http.rest.RequestOptions requestOptions)
      Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers.
      Parameters:
      lockTokens - Array of lock tokens.
      releaseDelay - Release cloud events with the specified delay in seconds.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the result of the Release operation along with Response.
      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.
    • release

      public ReleaseResult release(List<String> lockTokens)
      Release a batch of Cloud Events. The response will include the set of successfully released lock tokens, along with other failed lock tokens with their corresponding error information. Successfully released events can be received by consumers.
      Parameters:
      lockTokens - Array of lock tokens.
      Returns:
      the result of the Release 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.
    • reject

      public RejectResult reject(List<String> lockTokens)
      Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer.
      Parameters:
      lockTokens - Array of lock tokens.
      Returns:
      the result of the Reject 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.
    • rejectWithResponse

      public com.azure.core.http.rest.Response<RejectResult> rejectWithResponse(List<String> lockTokens, com.azure.core.http.rest.RequestOptions requestOptions)
      Reject a batch of Cloud Events. The response will include the set of successfully rejected lock tokens, along with other failed lock tokens with their corresponding error information. Successfully rejected events will be dead-lettered and can no longer be received by a consumer.
      Parameters:
      lockTokens - Array of lock tokens.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the result of the Reject operation along with Response.
      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.
    • renewLocks

      public RenewLocksResult renewLocks(List<String> lockTokens)
      Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock.
      Parameters:
      lockTokens - Array of lock tokens.
      Returns:
      the result of the RenewLock 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.
    • renewLocksWithResponse

      public com.azure.core.http.rest.Response<RenewLocksResult> renewLocksWithResponse(List<String> lockTokens, com.azure.core.http.rest.RequestOptions requestOptions)
      Renew locks for a batch of Cloud Events. The response will include the set of successfully renewed lock tokens, along with other failed lock tokens with their corresponding error information. Successfully renewed locks will ensure that the associated event is only available to the consumer that holds the renewed lock.
      Parameters:
      lockTokens - Array of lock tokens.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the result of the RenewLock operation along with Response.
      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

      public String getTopicName()
      Gets the topicName for this client.
      Returns:
      the topic name.
    • getSubscriptionName

      public String getSubscriptionName()
      Gets the subscriptionName for this client.
      Returns:
      the subscription name.