Class AmqpReceiverOptions
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionaddCapability(String capability) Adds a capability to be set on the receiver source terminus.Gets the list of capabilities to be set on the receiver source terminus.Gets the link properties to be sent in the AMQP attach frame.intgetQos()Gets the local QOS config, values can benull,AT_MOST_ONCEorAT_LEAST_ONCE.Gets the source terminus options.Gets the target terminus options.booleanbooleanbooleanbooleansetAutoAcknowledgement(boolean auto) Sets the auto-acknowledgement.setCapabilities(List<String> capabilities) Sets the list of capabilities to be set on the receiver source terminus.setDurable(boolean durable) Sets the durability.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.setLinkName(String linkName) setLinkProperties(Map<String, Object> linkProperties) Sets link properties to be sent in the AMQP attach frame.setMaxBufferedMessages(int maxBufferSize) Sets the max buffered messages.setNoLocal(boolean noLocal) Sets whether this receiver should not receive messages that were sent using the same underlying connection.Sets the local QOS config.setSelector(String selector) Sets a message selector string.setSourceOptions(SourceOptions sourceOptions) Sets the source terminus options for fine-grained control over durability, expiry policy, timeout, and capabilities.setTargetOptions(TargetOptions targetOptions) Sets the target terminus options for fine-grained control over the receiver's target terminus.toJson()
-
Constructor Details
-
AmqpReceiverOptions
public AmqpReceiverOptions() -
AmqpReceiverOptions
-
AmqpReceiverOptions
-
-
Method Details
-
toJson
-
getLinkName
-
setLinkName
-
isDynamic
public boolean isDynamic()- Returns:
- whether the receiver is using a dynamic address.
-
setDynamic
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 theAmqpReceiverreceived once opened.- Parameters:
dynamic- true if the receiver should request dynamic creation of a node and address to consume from- Returns:
- the options
-
getQos
Gets the local QOS config, values can benull,AT_MOST_ONCEorAT_LEAST_ONCE.- Returns:
- the local QOS config.
-
setQos
Sets the local QOS config.- Parameters:
qos- the local QOS config. Accepted values are:null,AT_MOST_ONCEorAT_LEAST_ONCE.- Returns:
- the options.
-
getCapabilities
-
setCapabilities
Sets the list of capabilities to be set on the receiver source terminus.- Parameters:
capabilities- the set of source capabilities.- Returns:
- the options
-
addCapability
Adds a capability to be set on the receiver source terminus.- Parameters:
capability- the source capability to add, must not benull- Returns:
- the options
-
isDurable
public boolean isDurable()- Returns:
- if the receiver is durable.
-
setDurable
Sets the durability.Passing
truesets the expiry policy of the source toNEVERand the durability of the source toUNSETTLED_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
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
AmqpReceiverOptionsinstance.
-
isAutoAcknowledgement
public boolean isAutoAcknowledgement()- Returns:
trueif the auto-acknowledgement is enabled,falseotherwise.
-
setAutoAcknowledgement
Sets the auto-acknowledgement. When enabled (default), the messages are automatically acknowledged. If set tofalse, the messages must be acknowledged explicitly usingAmqpMessage.accepted(),AmqpMessage.released()andAmqpMessage.rejected().- Parameters:
auto- whether or not the auto-acknowledgement should be enabled.- Returns:
- the current
AmqpReceiverOptionsinstance.
-
getSelector
- Returns:
- the message selector String
-
setSelector
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
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
-
setLinkProperties
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
Gets the source terminus options.- Returns:
- the source options, or
nullif not set.
-
setSourceOptions
Sets the source terminus options for fine-grained control over durability, expiry policy, timeout, and capabilities.If
SourceOptions.getDurability()orSourceOptions.getExpiryPolicy()is set, it overrides the values implied by thesetDurable(boolean)convenience option (which sets durability toUNSETTLED_STATEand expiry policy toNEVER).If
SourceOptions.getCapabilities()is set, it overrides the capabilities set viasetCapabilities(List)andaddCapability(String).If
SourceOptions.getAddress()is set, it overrides the address passed toAmqpConnection.createReceiver(String, AmqpReceiverOptions). It may also conflict with thesetDynamic(boolean)option, which requests the peer to generate the source address.- Parameters:
sourceOptions- the source terminus options- Returns:
- the options
-
getTargetOptions
Gets the target terminus options.- Returns:
- the target options, or
nullif not set.
-
setTargetOptions
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
-