Class ServiceBusReceivedMessageContext

java.lang.Object
com.azure.messaging.servicebus.ServiceBusReceivedMessageContext

public final class ServiceBusReceivedMessageContext extends Object
The Service Bus processor message context that holds a received message and additional methods to settle the message.
  • Method Details

    • getMessage

      public ServiceBusReceivedMessage getMessage()
      Gets the message received from Service Bus.
      Returns:
      The message received from Service Bus.
    • abandon

      public void abandon()
      Abandons the message in this context.
    • abandon

      public void abandon(AbandonOptions options)
      Abandons the message in this context.
      Parameters:
      options - Additional options for abandoning the message.
    • complete

      public void complete()
      Completes the message in this context.
    • complete

      public void complete(CompleteOptions options)
      Completes the message in this context.
      Parameters:
      options - Additional options for completing the message.
      Throws:
      NullPointerException - if options are null.
    • defer

      public void defer()
      Defers the message in this context.
    • defer

      public void defer(DeferOptions options)
      Defers the message in this context.
      Parameters:
      options - Additional options for deferring the message.
      Throws:
      NullPointerException - if options are null.
    • deadLetter

      public void deadLetter()
      Dead-letters the message in this context.
    • deadLetter

      public void deadLetter(DeadLetterOptions options)
      Dead-letters the message in this context.
      Parameters:
      options - Additional options for dead-lettering the message.
      Throws:
      NullPointerException - if options are null.