Package org.mockserver.async.asyncapi
Class AmqpBinding
java.lang.Object
org.mockserver.async.asyncapi.AmqpBinding
Immutable model of the AsyncAPI AMQP 0.9.1 channel binding
(
channels.<name>.bindings.amqp), carrying the publish-time routing
information that AmqpMessagePublisher
needs to deliver a message to a RabbitMQ broker.
The AsyncAPI AMQP channel binding distinguishes two channel shapes via its
is field:
is: routingKey— the channel represents a routing key on an exchange. The channel name is used as the routing key and the exchange is named byexchange.name.is: queue— the channel represents a queue bound to the default exchange. The channel name is the queue name; messages are published to the default exchange ("") with the queue name as the routing key.
Supported binding fields
| Field | AsyncAPI location | Effect |
|---|---|---|
is | bindings.amqp.is |
routingKey (exchange-based) or queue (queue-based). Defaults to routingKey. |
| exchange name | bindings.amqp.exchange.name |
The exchange to publish to (empty string = default exchange). |
| exchange type | bindings.amqp.exchange.type |
direct/topic/fanout/headers. Used when declaring the exchange. |
| exchange durable | bindings.amqp.exchange.durable |
Whether a declared exchange is durable. Defaults to true. |
| queue name | bindings.amqp.queue.name |
The queue to declare/route to (queue-based channels). |
| queue durable | bindings.amqp.queue.durable |
Whether a declared queue is durable. Defaults to true. |
| routing key | bindings.amqp.routingKey (extension) or the channel name |
The routing key used when publishing to the exchange. |
Deferred
The following AsyncAPI AMQP binding fields are intentionally not applied at publish time and are documented as deferred:exchange.autoDelete,exchange.vhost,queue.exclusive,queue.autoDelete,queue.vhost— topology lifecycle/scoping hints that do not affect a single publish.- Operation/message-level AMQP bindings (
cc,bcc,deliveryMode,mandatory,replyTo,priority,timestamp,expiration) — message-property level settings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe two shapes an AMQP channel can take, per the AsyncAPIisfield. -
Constructor Summary
ConstructorsConstructorDescriptionAmqpBinding(AmqpBinding.ChannelType channelType, String exchangeName, String exchangeType, boolean exchangeDurable, String queueName, boolean queueDurable, String routingKey) -
Method Summary
Modifier and TypeMethodDescriptionThe exchange name to publish to, or null when not specified.The exchange type (direct/topic/fanout/headers), or null when not specified.The queue name (queue-based channels), or null when not specified.The explicit routing key from the binding, or null.booleanbooleantoString()
-
Constructor Details
-
AmqpBinding
public AmqpBinding(AmqpBinding.ChannelType channelType, String exchangeName, String exchangeType, boolean exchangeDurable, String queueName, boolean queueDurable, String routingKey)
-
-
Method Details
-
getChannelType
-
getExchangeName
The exchange name to publish to, or null when not specified. For a queue-based channel this is typically null (the default exchange is used). -
getExchangeType
The exchange type (direct/topic/fanout/headers), or null when not specified. -
isExchangeDurable
public boolean isExchangeDurable() -
getQueueName
The queue name (queue-based channels), or null when not specified. -
isQueueDurable
public boolean isQueueDurable() -
getRoutingKey
The explicit routing key from the binding, or null. When null the publisher derives the routing key from the channel name (exchange-based) or queue name (queue-based). -
toString
-