Class AmqpReceiverOptions

java.lang.Object
io.vertx.amqp.AmqpReceiverOptions

public class AmqpReceiverOptions extends Object
Configures the AMQP Receiver.
  • Constructor Details

    • AmqpReceiverOptions

      public AmqpReceiverOptions()
    • AmqpReceiverOptions

      public AmqpReceiverOptions(AmqpReceiverOptions other)
    • AmqpReceiverOptions

      public AmqpReceiverOptions(JsonObject json)
  • Method Details

    • toJson

      public JsonObject toJson()
    • getLinkName

      public String getLinkName()
    • setLinkName

      public AmqpReceiverOptions setLinkName(String linkName)
    • isDynamic

      public boolean isDynamic()
      Returns:
      whether the receiver is using a dynamic address.
    • setDynamic

      public AmqpReceiverOptions setDynamic(boolean dynamic)
      Sets whether the Source terminus to be used should specify it is 'dynamic', requesting the peer creates a node and names it with a generated address.

      The address provided by the peer can then be inspected using the AmqpReceiver.address() method on the AmqpReceiver received once opened.

      Parameters:
      dynamic - true if the receiver should request dynamic creation of a node and address to consume from
      Returns:
      the options
    • getQos

      public String getQos()
      Gets the local QOS config, values can be null, AT_MOST_ONCE or AT_LEAST_ONCE.
      Returns:
      the local QOS config.
    • setQos

      public AmqpReceiverOptions setQos(String qos)
      Sets the local QOS config.
      Parameters:
      qos - the local QOS config. Accepted values are: null, AT_MOST_ONCE or AT_LEAST_ONCE.
      Returns:
      the options.
    • getCapabilities

      public List<String> getCapabilities()
      Gets the list of capabilities to be set on the receiver source terminus.
      Returns:
      the list of capabilities, empty if none.
    • setCapabilities

      public AmqpReceiverOptions setCapabilities(List<String> capabilities)
      Sets the list of capabilities to be set on the receiver source terminus.
      Parameters:
      capabilities - the set of source capabilities.
      Returns:
      the options
    • addCapability

      public AmqpReceiverOptions addCapability(String capability)
      Adds a capability to be set on the receiver source terminus.
      Parameters:
      capability - the source capability to add, must not be null
      Returns:
      the options
    • isDurable

      public boolean isDurable()
      Returns:
      if the receiver is durable.
    • setDurable

      public AmqpReceiverOptions setDurable(boolean durable)
      Sets the durability.

      Passing true sets the expiry policy of the source to NEVER and the durability of the source to UNSETTLED_STATE.

      Parameters:
      durable - whether or not the receiver must indicate it's durable
      Returns:
      the options.
    • getMaxBufferedMessages

      public int getMaxBufferedMessages()
      Returns:
      the max buffered messages
    • setMaxBufferedMessages

      public AmqpReceiverOptions setMaxBufferedMessages(int maxBufferSize)
      Sets the max buffered messages. This message can be used to configure the initial credit of a receiver.
      Parameters:
      maxBufferSize - the max buffered size, must be positive. If not set, default credit is used.
      Returns:
      the current AmqpReceiverOptions instance.
    • isAutoAcknowledgement

      public boolean isAutoAcknowledgement()
      Returns:
      true if the auto-acknowledgement is enabled, false otherwise.
    • setAutoAcknowledgement

      public AmqpReceiverOptions setAutoAcknowledgement(boolean auto)
      Sets the auto-acknowledgement. When enabled (default), the messages are automatically acknowledged. If set to false, the messages must be acknowledged explicitly using AmqpMessage.accepted(), AmqpMessage.released() and AmqpMessage.rejected().
      Parameters:
      auto - whether or not the auto-acknowledgement should be enabled.
      Returns:
      the current AmqpReceiverOptions instance.
    • getSelector

      public String getSelector()
      Returns:
      the message selector String
    • setSelector

      public AmqpReceiverOptions setSelector(String selector)
      Sets a message selector string. Used to define an "apache.org:selector-filter:string" filter on the source terminus, using SQL-based syntax to request the server filters which messages are delivered to the receiver (if supported by the server in question). Precise functionality supported and syntax needed can vary depending on the server.
      Parameters:
      selector - the selector string to set.
    • isNoLocal

      public boolean isNoLocal()
      Returns:
      whether this receiver should not receive messages that were sent on the same underlying connection
    • setNoLocal

      public AmqpReceiverOptions setNoLocal(boolean noLocal)
      Sets whether this receiver should not receive messages that were sent using the same underlying connection. Used to determine whether to define an "apache.org:no-local-filter:list" filter on the source terminus, requesting that the server filters which messages are delivered to the receiver so that they do not include messages sent on the same underlying connection (if supported by the server in question).
      Parameters:
      noLocal - true if this receiver shall not receive messages that were sent on the same underlying connection
    • getLinkProperties

      public Map<String,Object> getLinkProperties()
      Gets the link properties to be sent in the AMQP attach frame.
      Returns:
      the link properties map, or null if not set.
    • setLinkProperties

      public AmqpReceiverOptions setLinkProperties(Map<String,Object> linkProperties)
      Sets link properties to be sent in the AMQP attach frame. Keys are converted to AMQP Symbol type when applied.
      Parameters:
      linkProperties - the link properties map
      Returns:
      the options
    • getSourceOptions

      public SourceOptions getSourceOptions()
      Gets the source terminus options.
      Returns:
      the source options, or null if not set.
    • setSourceOptions

      public AmqpReceiverOptions setSourceOptions(SourceOptions sourceOptions)
      Sets the source terminus options for fine-grained control over durability, expiry policy, timeout, and capabilities.

      If SourceOptions.getDurability() or SourceOptions.getExpiryPolicy() is set, it overrides the values implied by the setDurable(boolean) convenience option (which sets durability to UNSETTLED_STATE and expiry policy to NEVER).

      If SourceOptions.getCapabilities() is set, it overrides the capabilities set via setCapabilities(List) and addCapability(String).

      If SourceOptions.getAddress() is set, it overrides the address passed to AmqpConnection.createReceiver(String, AmqpReceiverOptions). It may also conflict with the setDynamic(boolean) option, which requests the peer to generate the source address.

      Parameters:
      sourceOptions - the source terminus options
      Returns:
      the options
    • getTargetOptions

      public TargetOptions getTargetOptions()
      Gets the target terminus options.
      Returns:
      the target options, or null if not set.
    • setTargetOptions

      public AmqpReceiverOptions setTargetOptions(TargetOptions targetOptions)
      Sets the target terminus options for fine-grained control over the receiver's target terminus.

      If TargetOptions.getAddress() is set, it sets the target address on the receiver link.

      Parameters:
      targetOptions - the target terminus options
      Returns:
      the options