Contact Us 1-800-596-4880

AMQP Connector Reference

Support Category: Select

AMQP Connector v3.9.0

Exchange: AMQP Connector

This document lists and describes all of the configuration parameters supported by the AMQP connector, as well as all AMQP endpoint configuration elements.

Connector Attributes

The AMQP connector defines what broker to connect to, which credentials to use when connecting, and all the common properties used by the inbound and outbound endpoints that use this connector.

You can create several connectors connected to the same broker for the purpose of having different sets of common properties that endpoints can use.

Name Description

host

The main AMQP broker host to connect to.

Type: string
Required: no
Default: localhost

port

The port to use to connect to the main AMQP broker.

Type: port number
Required: no
Default: 5672

fallbackAddresses

A comma-separated list of hosts (brokers), listed as <host> or <host:port>. If the connection to the main broker fails, the hosts listed here are the fallback brokers to attempt to connect to. For more information, see Connection Fallback.

Type: string
Required: no
Default: none

virtualHost

The virtual host to connect to on the AMQP broker.

Type: string
Required: no
Default: /

username

The user name to use to connect to on the AMQP broker.

Type: string
Required: no
Default: guest

password

The password to use to connect to the AMQP broker.

Type: string
Required: no
Default: guest

deliveryMode

The delivery mode to use when publishing to the AMQP broker.

Possible values are:

  • PERSISTENT

  • NON_PERSISTENT

Type: integer
Required: no
Default: PERSISTENT

priority

The priority to use when publishing to the AMQP broker. The priority has possible values from 0 to 9 - default is 0.

Type: byte
Required: no
Default: 0

mandatory

Tells the server how to react if the message cannot be routed to a queue. If set to true, the server throws an exception for any message that cannot be routed. If set to false, the server silently drops the message.

Type: boolean
Required: no
Default: false

immediate

Tells the server how to react if the message cannot be routed to a queue consumer immediately. If set to true, the server throws an exception for any undeliverable message. If set to false, the server queues the message, but with no guarantee that the message will ever be consumed.

Type: boolean
Required: no
Default: false

default-return-endpoint-ref

Reference to an endpoint to which an AMQP returned message should be dispatched to.

Type: string
Required: no
Default: none

ackMode

The acknowledgment mode to use when consuming from the AMQP broker.

Possible values are:

  • AMQP_AUTO - The AMQP broker considers messages acknowledged once delivered.

  • MULE_AUTO - Mule automatically acknowledges messages when the flow has been processed, if no exception has been encountered. Using asynchronous sub-flows or dispatch may lead to early acknowledgment.

  • MANUAL - The AMQP broker expects explicit message acknowledgments.

Type: string
Required: no
Default: AMQP_AUTO

prefetchSize

The maximum amount of content (measured in octets) that the server delivers. 0 means unlimited.

Type: integer
Required: no
Default: 0

prefetchCount

The maximum number of messages that the server delivers. 0 means unlimited.

Type: integer
Required: no
Default: 0

noLocal

If set to true, the server does not send messages to the connection that published them.

Type: boolean
Required: no
Default: false

exclusiveConsumers

Set to true if the connector should only create exclusive consumers.

Type: boolean
Required: no
Default: false

numberOfChannels

The number of channels that are spawned per inbound endpoint to receive AMQP messages. Default value is 4.

Type: integer
Required: no
Default: 4

activeDeclarationsOnly

Defines if the connector should only do active exchange and queue declarations, or if it should perform passive declarations to enforce the existence of the queue or exchange.

Possible values:

  • true - The AMQP connector creates a queue or exchange if it doesn’t exist. The connector creates inbound endpoint queues or exchanges. Creating outbound endpoint queues or exchanges are currently not supported. If you give the inbound endpoint a queueName and queueDurable, AMQP connector creates the queue. If you give the inbound endpoint exchangeName and exchangeType, AMQP connector creates the exchange. If you set the routingKey, the connector makes the binding for you.

  • false - The AMQP connector assumes the queue or exchange already exists and sends the message to the queue or exchange. If the queue or exchange does not exist, the AMQP connector throws a ShutdownSignalException, a 404 error, and returns reply text starting with NOT_FOUND.

Although this attribute is normally not set (its default value is false), if you set activeDeclarationsOnly to true, AMQP applies active declarations as follows:

  • When declaring an exchange: When you set the exchangeType attribute.

  • When declaring a queue: When you set any of the queueDurable, queueAutoDelete, or queueExclusive attributes. If any of these attributes are set, active declarations of queues and exchanges are applied.

Note: The AMQP connector does not create queues or exchanges if they do not exist.

For a discussion on active versus passive declarations, see Passive or active queues?

Type: boolean
Required: no
Default: false

listenOnPrimaryNodeOnly

Defines if the listeners will only consume messages when deployed in a primary polling node in a clustered environment. This feature is only in AMQP version 3.9.0 and later.

Type: boolean
Required: no
Default: false

Endpoint Attributes

Endpoint attributes are interpreted differently if they are used on inbound or outbound endpoints. For example, on an inbound endpoint the attribute routingKey is used for queue binding, and on an outbound endpoint, it is used as a basic publish parameter.

Name Description

exchangeName

The exchange to publish to or bind queues to. Use AMQP.DEFAULT.EXCHANGE for the default exchange. (The previous approach, which consists in leaving blank or omitting exchangeName for the default exchange, still works but is not recommended.)

Type: string
Required: no
Default: none

queueName

Name of the queue to consume from. Leave blank or omit for using a new private exclusive server-named queue.

Type: string
Required: no
Default: none

routingKey

Comma-separated routing keys to use when binding a queue or publishing a message.

Type: string
Required: no
Default: none

consumerTag

A client-generated consumer tag to establish context.

Type: string
Required: no
Default: none

exchangeType

The type of exchange to be declared.

Possible values are:

  • fanout - Broadcasts all messages the exchange receives to all bound queues.

  • direct - A message goes to a specific queue.

  • topic - A pattern that determines which queues receive a message. The pattern is a list of words delimited by dots up to 255 characters in length. The pattern can use an asterisk (∗) to substitute for a single word. A hash tag (#) can substitute for zero or more words. For more information, see RabbitMQ Topics.

  • headers - A message is sent to a queue depending on its header attributes.

Type: string
Required: no
Default: none

exchangeDurable

The durability of the declared exchange. A durable exchange survives a broker restart.

Type: boolean
Required: no
Default: none

exchangeAutoDelete

Specifies if the declared exchange should be autodeleted.

Type: boolean
Required: no
Default: none

numberOfChannels

The number of channels that are spawned for this inbound endpoint to receive AMQP messages. If not present, the value defined in the connector is used. Otherwise, it is 1.

Type: integer
Required: no
Default: 1

queueDurable

Specifies if the declared queue is durable. A durable queue persists to disk and survives a broker restart. Note: Messages routed to the queue are not durable.

Type: boolean
Required: no
Default: none

queueAutoDelete

Specifies if the declared queue should be autodeleted.

Type: boolean
Required: no
Default: none

queueExclusive

Specifies if the declared queue is exclusive.

Type: boolean
Required: no
Default: none

View on GitHub