# mulesoft AMQP Connector - Full Documentation --- product: AMQP Connector version: 1.8 --- # AMQP Connector 1.8 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for AMQP (AMQP Connector) enables your application to publish and consume messages using an AMQP 0.9.1-compliant broker. The connector’s main features include: - RPC Pattern through request-reply consumption using private temporal queues - SDK transaction management with optional channel self-recovery - Synchronous message requesting with timeout - Management operations for exchange and queue declarations - All AMQP message properties, including custom headers - Reply to (publishing replies to the default exchange) - Automatic, Mule-driven and manual message acknowledgement - Manual message rejection - Mandatory and immediate publishing parameters and handling of returned (undelivered) messages through error handling - Prefetch size and count "quality of service" settings - noLocal and exclusive consumers - TLS/SSL connectivity - Message builder functionality similar to that provided by JMS Connector ## Configure the Connector AMQP Connector comes out of the box with a fine-tuned set of default values for both publishing and consuming messages. This means that the only requirement is for you to configure which connection to use. This example sets a minimal connection to a broker in `localhost`: ```example ``` ### Define Global Defaults You can define a set of default parameters to use while consuming or publishing messages. This way, you can define a global default behavior for all the operations associated with the configuration and then override each parameter only in the operations that require a custom behavior. For example, you can define a prefetch size window in terms of size and in terms of whole messages: ```example ``` In the previous example, every `consume` operation or listener associated with this configuration uses an acknowledgement mode of the type `IMMEDIATE`, while for every `publish` or `publish-consume` operation, the outgoing message requests a confirmation from the broker. You can override all of these properties at the operation level when required. For example, if you need to publish a message that does not require confirmation from the broker: ```example ``` ## Connect to a Broker An AMQP connection is defined by a set of general parameters that apply for any connection. ### Provide Credentials For Authentication To establish an authenticated connection, you have to set the `username`, `password`, and the `virtualhost` in the `connection` element: ```example ``` ### Set TLS/SSL Connectivity to the Broker You can use the parameter `useTls` to create a secure connection to the broker using the default TLS context. You can also provide a custom TLS context as a child element in the connection, or as global element in the following way: ```example ``` ### Server Name Indication AMQP Connector v1.1.0 and later supports Server Name Indication (SNI). If the broker supports SNI, it’s available to verify the hostname and present different certificates for the same IP address. Use the parameter `useSNI` to indicate that the AMQP client should add the hostname as an extension in the `ClientHello` message during the SSL handshake: ```example ``` ## See Also - [Consume Messages](https://docs.mulesoft.com/amqp-connector/1.8/amqp-consume) - [Publish Messages](https://docs.mulesoft.com/amqp-connector/1.8/amqp-publish) - [Listen For New Messages](https://docs.mulesoft.com/amqp-connector/1.8/amqp-listener) - [Listen For A Reply](https://docs.mulesoft.com/amqp-connector/1.8/amqp-publish-consume) - [Message Acknowledgement](https://docs.mulesoft.com/amqp-connector/1.8/amqp-ack) - [Transactions in AMQP](https://docs.mulesoft.com/amqp-connector/1.8/amqp-transactions) - [AMQP Connector Reference](https://docs.mulesoft.com/amqp-connector/1.8/amqp-documentation) - [Salesforce Help](https://help.salesforce.com) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # AMQP Connector 1.9 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for AMQP (AMQP Connector) enables your application to publish and consume messages using an AMQP 0.9.1-compliant broker. The connector’s main features include: - RPC Pattern through request-reply consumption using private temporal queues - SDK transaction management with optional channel self-recovery - Synchronous message requesting with timeout - Management operations for exchange and queue declarations - All AMQP message properties, including custom headers - Reply to (publishing replies to the default exchange) - Automatic, Mule-driven and manual message acknowledgement - Manual message rejection - Mandatory and immediate publishing parameters and handling of returned (undelivered) messages through error handling - Prefetch size and count "quality of service" settings - noLocal and exclusive consumers - TLS/SSL connectivity - Message builder functionality similar to that provided by JMS Connector ## Configure the Connector AMQP Connector comes out of the box with a fine-tuned set of default values for both publishing and consuming messages. This means that the only requirement is for you to configure which connection to use. This example sets a minimal connection to a broker in `localhost`: ```example ``` ### Define Global Defaults You can define a set of default parameters to use while consuming or publishing messages. This way, you can define a global default behavior for all the operations associated with the configuration and then override each parameter only in the operations that require a custom behavior. For example, you can define a prefetch size window in terms of size and in terms of whole messages: ```example ``` In the previous example, every `consume` operation or listener associated with this configuration uses an acknowledgement mode of the type `IMMEDIATE`, while for every `publish` or `publish-consume` operation, the outgoing message requests a confirmation from the broker. You can override all of these properties at the operation level when required. For example, if you need to publish a message that does not require confirmation from the broker: ```example ``` ## Connect to a Broker An AMQP connection is defined by a set of general parameters that apply for any connection. ### Provide Credentials For Authentication To establish an authenticated connection, you have to set the `username`, `password`, and the `virtualhost` in the `connection` element: ```example ``` ### Set TLS/SSL Connectivity to the Broker You can use the parameter `useTls` to create a secure connection to the broker using the default TLS context. You can also provide a custom TLS context as a child element in the connection, or as global element in the following way: ```example ``` ### Server Name Indication AMQP Connector v1.1.0 and later supports Server Name Indication (SNI). If the broker supports SNI, it’s available to verify the hostname and present different certificates for the same IP address. Use the parameter `useSNI` to indicate that the AMQP client should add the hostname as an extension in the `ClientHello` message during the SSL handshake: ```example ``` ## See Also - [Consume Messages](https://docs.mulesoft.com/amqp-connector/latest/amqp-consume) - [Publish Messages](https://docs.mulesoft.com/amqp-connector/latest/amqp-publish) - [Listen For New Messages](https://docs.mulesoft.com/amqp-connector/latest/amqp-listener) - [Listen For A Reply](https://docs.mulesoft.com/amqp-connector/latest/amqp-publish-consume) - [Message Acknowledgement](https://docs.mulesoft.com/amqp-connector/latest/amqp-ack) - [Transactions in AMQP](https://docs.mulesoft.com/amqp-connector/latest/amqp-transactions) - [AMQP Connector Reference](https://docs.mulesoft.com/amqp-connector/latest/amqp-documentation) - [Salesforce Help](https://help.salesforce.com) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # AMQP Connector 1.9 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Release Notes: [AMQP Connector Release Notes](https://docs.mulesoft.com/release-notes/connector/connector-amqp) Anypoint Connector for AMQP is an AMQP 0.9.1 compliant MuleSoft extension, and is used to consume and produce AMQP messages. The extension supports AMQP functionality including exchanges and queues, consumers, acknowledgment modes, and local transactions. ## Configurations --- ### Config These are the base configuration parameters for AMQP Connector. #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Encoding

String

The default encoding of the Message body to use if the message doesn’t communicate it.

Content Type

String

The default contentType of the Message body to use if the message doesn’t communicate it

/

Create Fallback Queue

Boolean

Whether to create non-existing queues according to the fallback definition if they are defined.

true

Create Fallback Exchange

Boolean

Whether to create non-existing exchanges according to the fallback definition if they are defined.

true

Send Correlation Id

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

Whether to specify a correlationId when publishing messages. This applies both for custom correlation IDs specifies at the operation level and for default correlation IDs taken from the current event

AUTO

Name

String

The identifier of this element used to reference it in other components.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Ack Mode

Enumeration, one of:

  • IMMEDIATE

  • AUTO

  • MANUAL

The acknowledgment mode to use when consuming from the AMQP broker. If a transaction is opened in the channel, message acknowledgment is handled automatically by commit, and recovery is handled automatically by rollback.

IMMEDIATE

No Local

Boolean

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

false

Exclusive Consumers

Boolean

Set to true if the connector should only create exclusive consumers. Only the consumer created can access the queue.

false

Number Of Consumers

Number

It is the number of consumers spawned by message source to receive AMQP messages. Each consumer will create a channel.

4

Delivery Mode

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

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

PERSISTENT

Priority

Number

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

0

Request Broker Confirms

Boolean

Whether it must fail in case no confirmation is provided.

false

Mandatory

Boolean

Whether the operation must fail if it cannot be routed to a queue.

false

Immediate

Boolean

Whether the operation must fail if it cannot be routed to a queue consumer immediately.

false

Returned Message Exchange

String

The exchange to publish returned messages.

Prefetch Size

Number

This field defines a prefetch size window. The broker will send as much messages as possible without exceeding the prefetchSize window in octets (bytes). 0 is used for no specific limit.

0

Prefetch Count

Number

Specifies a global prefetch window in terms of whole messages. This field may be used in combination with the prefetch-size field; a message will only be sent in advance if both prefetch windows allow it. 0 is used for no specific limit.

0

#### Connection Types ##### Connection Generic implementation of a AMQP ConnectionProvider. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Socket Configuration

TLS Configuration

Reference to a TLS config element. This will enable secure connection to the AMQP broker.

Host

String

Host of the broker to connect to.

x

Port

Number

Port of the AMQP broker to connect to.

Virtual Host

String

Virtual host to use in the AMQP broker.

/

Username

String

Username to use when providing credentials for authentication.

Password

String

Password to use when providing credentials for authentication.

Use Tls

Boolean

Whether TLS is needed to use. In case it is not provided, the default for AMQP connection will be used.

false

Use Sni

Boolean

Whether Server Name Indication is needed to use in the ClientHello Message

false

Use Sasl

Boolean

Whether SASL (EXTERNAL) Auth mechanism is used (No username or password required).

false

Heartbeat Timeout

Number

The heartbeat timeout. Heartbeat frames is sent at about 1/2 the timeout interval.

60

Handshake Timeout

Number

AMQP 0.9.1 timeout to set to the underlying AMQP connector.

Handshake Timeout Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Timeunit for the handshake timeout AMQP connection socket configuration.

MILLISECONDS

Fallback Addresses

The addresses of the broker nodes to attempt connection to, should the connection to main broker fail.

Max Inbound Message Body Size

Number

The maximum inbound message body size to set to the underlying AMQP Connector in bytes.

67108864 (64 MB)

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy

## Supported Operations - [Consume](#consume) - [Publish](#publish) - [Publish Consume](#publishConsume) ## Associated Sources - [Listener](#listener) ## Operations ### Consume `` Enables you to consume a single AMQP message from a given queue. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Queue Name

String

The name of the queue from where the Message should be consumed

x

Content Type

String

The content type of the message body

Encoding

String

The encoding of the message body

Fallback Queue Definition

The queue definition to use for queue declaration in case there is no queue with the queueName

Ack Mode

Enumeration, one of:

  • IMMEDIATE

  • MANUAL

The ACK mode to use when consuming a message

Consumer Tag

String

The consumer tag to use for the consumer involved in the operation

Maximum Wait

Number

Maximum time to wait for a message to arrive before timeout

10000

Maximum Wait Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the maximumWaitTime configuration

MILLISECONDS

Create Fallback Queue

Boolean

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

information of the current transaction in case it exists

JOIN_IF_POSSIBLE

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that storesoperation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

#### Output

Type

Any

Attributes Type

### For Configurations - [Config](#config) #### Throws - AMQP:QUEUE\_NOT\_FOUND - AMQP:CONNECTIVITY - AMQP:CONSUMING - AMQP:NO\_CHANNEL\_AVAILABLE - AMQP:RETRY\_EXHAUSTED - AMQP:CREATION\_NOT\_ALLOWED - AMQP:TIMEOUT ### Publish `` Enables you to publish a single AMQP message to a given exchange. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Exchange Name

String

The name of the exchange to publish the message to

Routing Keys

Array of String

List of routing keys to use when publishing messages.

Delivery Mode

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

The delivery mode to use when publishing to the AMQP broker

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

information of the current transaction in case it exists

JOIN_IF_POSSIBLE

Send Correlation Id

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

options on whether to include an outbound correlation ID or not

Create Fallback Exchange

Boolean

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Skip Exchange Validation

Enumeration, one of:

  • YES

Skips the exchange validation.
By default, the Publish operation validates the exchange if you do not configure the Skip Exchange Validation field. While skipping validation can enhance performance, this approach also risks message loss if the exchange does not exist, depending on the broker’s configuration.

Fallback Exchange Definition

The exchange to use for exchange declaration in case there is no exchange with the exchangeName

Body

Any

The body of the Message

#[payload]

AMQP Properties

Properties of the message.

Headers

Object

The custom user properties that should be set to this AmqpMessage

Request Broker Confirms

Boolean

Expects a confirmation from a message published. An exception is raised in case no confirmation is provided in case this attribute is set to true.

false

Mandatory

Boolean

Tells the server how to react if the message cannot be routed to a queue. If set to true, the server throws an exception (UNROUTABLE_MESSAGE, see below in the operation spec) for any message that cannot be routed. If set to false, the server silently drops the message.

false

Immediate

Boolean

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 (UNROUTABLE_MESSAGE, see below in the operation spec) for any undeliverable message. If set to false, the server queues the message, but with no guarantee that the message will ever be consumed.

false

Returned Message Exchange

String

The exchange to publish returned messages.

Reconnection Strategy

Retry strategy in case of connectivity errors.

### For Configurations - [Config](#config) #### Throws - AMQP:PUBLISHING - AMQP:ILLEGAL\_BODY - AMQP:CONNECTIVITY - AMQP:UNROUTABLE\_MESSAGE - AMQP:EXCHANGE\_NOT\_FOUND - AMQP:NO\_CHANNEL\_AVAILABLE - AMQP:RETRY\_EXHAUSTED - AMQP:CREATION\_NOT\_ALLOWED ### Publish Consume `` Enables you to send a message to a AMQP exchange and waits for a response either to the provided replyTo destination or to a temporary destination created dynamically. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Exchange Name

String

The name of the exchange to publish the message to

x

Content Type

String

The content type of the message body

Encoding

String

The encoding of the message body

Routing Key

String

The routing key to publish to in publish-consume operations.

Delivery Mode

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

The delivery mode to use when publishing to the AMQP broker

Maximum Wait

Number

The maximum time to wait for a message to arrive before timeout

10000

Maximum Wait Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The time unit to use in the maximumWaitTime configuration

MILLISECONDS

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

information of the current transaction in case it exists

JOIN_IF_POSSIBLE

Send Correlation Id

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

options on whether to include an outbound correlation ID or not

Create Fallback Exchange

Boolean

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Skip Exchange Validation

Enumeration, one of:

  • YES

This field is intended to skip exchange validation by default the operation will do the validation if the parameter is not configured. If you decide to skip the exchange validation it will improve the performance but if the exchange does not exist you can incur in messaging losing depending on the broker configuration.

Fallback Exchange Definition

The exchange to use for exchange declaration in case there is no exchange with the exchangeName

Body

Any

The body of the Message

#[payload]

AMQP Properties

Properties of the message.

Headers

Object

The custom user properties that should be set to this AmqpMessage

Request Broker Confirms

Boolean

Expects a confirmation from a message published. An exception is raised in case no confirmation is provided in case this attribute is set to true.

false

Mandatory

Boolean

Tells the server how to react if the message cannot be routed to a queue. If set to true, the server throws an exception (UNROUTABLE_MESSAGE, see below in the operation spec) for any message that cannot be routed. If set to false, the server silently drops the message.

false

Immediate

Boolean

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 (UNROUTABLE_MESSAGE, see below in the operation spec) for any undeliverable message. If set to false, the server queues the message, but with no guarantee that the message will ever be consumed.

false

Returned Message Exchange

String

The exchange to publish returned messages.

Target Variable

String

Name of the variable that storesoperation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

#### Output

Type

Any

Attributes Type

### For Configurations - [Config](#config) #### Throws - AMQP:PUBLISHING - AMQP:PUBLISHING\_CONSUMING - AMQP:CONNECTIVITY - AMQP:CONSUMING - AMQP:NO\_CHANNEL\_AVAILABLE - AMQP:RETRY\_EXHAUSTED - AMQP:CREATION\_NOT\_ALLOWED - AMQP:TIMEOUT ### Ack `` Enables to ack a message with the delivery tag. #### Parameters
NameTypeDescriptionDefault ValueRequired

Ack Id

String

delivery tag of the message to be ack’ed

x

#### Throws - AMQP:ACKNOWLEDGING - AMQP:NO\_CHANNEL\_AVAILABLE - AMQP:DELIVER\_TAG\_NOT\_FOUND - AMQP:TIMEOUT ### Reject `` Enables you to reject a delivered AMQP message. #### Parameters
NameTypeDescriptionDefault ValueRequired

Ack Id

String

delivery tag of the message to be rejected

x

Requeue

Boolean

Indicates whether the rejected message has to be requeued

false

#### Throws - AMQP:REQUEUE - AMQP:ACKNOWLEDGING - AMQP:REJECTING - AMQP:DELIVER\_TAG\_NOT\_FOUND - AMQP:TIMEOUT ## Sources ### Listener `` AMQP listener for queues, enables you to listen for incoming messages. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Queue Name

String

Name of the queue to consume from.

x

Fallback Queue Definition

Declaration of a queue definition to use in case no queue with the queueName provided exists in the broker. In case the queue with provided queueName exists, it will be used as is, ignoring the fallback. In case the queue does not exist, a new queue shall be created according to the referenced definition.

Ack Mode

Enumeration, one of:

  • IMMEDIATE

  • AUTO

  • MANUAL

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

Number Of Consumers

Number

The number of channels that are spawned per inbound endpoint to receive AMQP messages.

Consumer Tag

String

A client-generated consumer tag to establish context.

Recover Strategy

Enumeration, one of:

  • NONE

  • NO_REQUEUE

  • REQUEUE

Valid values for the recoverStrategy option are: NONE, NO_REQUEUE and REQUEUE.

REQUEUE

Inbound Encoding

String

The default encoding of the message body to use if the message doesn’t communicate it

Inbound Content Type

String

The default contentType of the Message body to use if the message doesn’t communicate it

Create Fallback Queue

Boolean

Whether non existing queues will be created according to the fallback definition or an error is raised if they do not exist. This can be disabled in the mule app is not intended to change the AMQP topography.

Output Mime Type

String

The MIME type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Transactional Action

Enumeration, one of:

  • ALWAYS_BEGIN

  • NONE

The type of beginning action that sources can take regarding transactions.

NONE

Transaction Type

Enumeration, one of:

  • LOCAL

  • XA

The type of transaction to create. Availability depends on Mule version.

LOCAL

Primary Node Only

Boolean

Determines whether to execute this source on only the primary node when running Mule instances in a cluster.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Prefetch Size

Number

This field defines a prefetch size window. The broker will send as much messages as possible without exceeding the prefetchSize window in octets (bytes). 0 is used for no specific limit.

Prefetch Count

Number

Specifies a global prefetch window in terms of whole messages. This field may be used in combination with the prefetch-size field; a message will only be sent in advance if both prefetch windows allow it. 0 is used for no specific limit.

Reconnection Strategy

Retry strategy in case of connectivity errors.

Body

Any

The body of the Message

#[payload]

AMQP Properties

Properties of the message.

Headers

Object

The custom user properties that should be set to this AmqpMessage

Delivery Mode

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

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

PERSISTENT

Priority

Number

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

0

Request Broker Confirms

Boolean

Whether it must fail in case no confirmation is provided in case this attribute is set to true."

false

Mandatory

Boolean

Whether the operation must fail if it cannot be routed to a queue.

false

Immediate

Boolean

Whether the operation must fail if it cannot be routed to a queue consumer immediately.

false

Returned Message Exchange

String

The exchange to publish returned messages.

#### Output

Type

Any

Attributes Type

### For Configurations - [Config](#config) ## Types ### Socket Configuration
FieldTypeDescriptionDefault ValueRequired

Keep Alive

Boolean

Keep alive to set to the underlying AMQP connector

false

So Timeout Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Timeunit for the SO_TIMEOUT AMQP connection socket configuration.

MILLISECONDS

So Timeout

Number

SO_TIMEOUT to set to the underlying AMQP connector.

Receive Buffer Size

Number

Receive buffer size to set to the underlying AMQP connector

Send Buffer Size

Number

Send buffer size to set to the underlying AMQP connector

### TLS Configures TLS to provide secure communications for the Mule app.
FieldTypeDescriptionDefault ValueRequired

Enabled Protocols

String

Comma-separated list of protocols enabled for this context.

Enabled Cipher Suites

String

Comma-separated list of cipher suites enabled for this context.

Trust Store

Configures the TLS truststore.

Key Store

Configures the TLS keystore.

Revocation Check

### Truststore Configures the truststore for TLS.
FieldTypeDescriptionDefault ValueRequired

Path

String

Path to the truststore. Mule resolves the path relative to the current classpath and file system.

Password

String

Password used to protect the truststore.

Type

String

Type of store.

Algorithm

String

Encryption algorithm that the truststore uses.

Insecure

Boolean

If true, Mule stops performing certificate validations. Setting this to true can make connections vulnerable to attacks.

### Keystore Configures the keystore for the TLS protocol. The keystore you generate contains a private key and a public certificate.
FieldTypeDescriptionDefault ValueRequired

Path

String

Path to the keystore. Mule resolves the path relative to the current classpath and file system.

Type

String

Type of store.

Alias

String

Alias of the key to use when the keystore contains multiple private keys. By default, Mule uses the first key in the file.

Key Password

String

Password used to protect the private key.

Password

String

Password used to protect the keystore.

Algorithm

String

Encryption algorithm that the keystore uses.

### Standard Revocation Check Configures standard revocation checks for TLS certificates.
FieldTypeDescriptionDefault ValueRequired

Only End Entities

Boolean

Which elements to verify in the certificate chain:

  • true

Verify only the last element in the certificate chain.

  • false

Verify all elements in the certificate chain.

Prefer Crls

Boolean

How to check certificate validity:

  • true

Check the Certification Revocation List (CRL) for certificate validity.

  • false

Use the Online Certificate Status Protocol (OCSP) to check certificate validity.

No Fallback

Boolean

Whether to use the secondary method to check certificate validity:

  • true

Use the method that wasn’t specified in the Prefer Crls field (the secondary method) to check certificate validity.

  • false

Do not use the secondary method to check certificate validity.

Soft Fail

Boolean

What to do if the revocation server can’t be reached or is busy:

  • true

Avoid verification failure.

  • false

Allow the verification to fail.

### Custom OCSP Responder Configures a custom OCSP responder for certification revocation checks.
FieldTypeDescriptionDefault ValueRequired

Url

String

URL of the OCSP responder.

Cert Alias

String

Alias of the signing certificate for the OCSP response. If specified, the alias must be in the truststore.

### CRL File Specifies the location of the certification revocation list (CRL) file.
FieldTypeDescriptionDefault ValueRequired

Path

String

Path to the CRL file.

### Fallback Address
FieldTypeDescriptionDefault ValueRequired

Host

String

Host of the broker to connect to.

x

Port

String

Port of the AMQP broker to connect to.

### Reconnection Configures a reconnection strategy for an operation.
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

Reconnection strategy to use.

### Reconnect Configures a standard reconnection strategy, which specifies how often to reconnect and how many reconnection attempts the connector source or operation can make.
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

Count

Number

How many reconnection attempts the Mule app can make.

### Reconnect Forever Configures a forever reconnection strategy by which the connector source or operation attempts to reconnect at a specified frequency for as long as the Mule app runs.
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

### Expiration Policy Configures an expiration policy strategy.
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### AMQP Attributes
FieldTypeDescriptionDefault ValueRequired

Envelope

Encapsulates a group of parameters used for AMQP’s Basic methods

x

Properties

AMQP Message Properties

x

Headers

Object

AMQP Message parameters

x

Ack Id

String

The channel ACK ID required to ACK a the current Message if one is available, or null otherwise.

### Envelope
FieldTypeDescriptionDefault ValueRequired

Delivery Tag

Number

Redeliver

Boolean

false

Exchange

String

Routing Key

String

### Properties
FieldTypeDescriptionDefault ValueRequired

Content Type

String

Content Encoding

String

Delivery Mode

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

PERSISTENT

Priority

Number

Correlation Id

String

Reply To

String

Expiration

String

Message Id

String

Timestamp

Date

Type

String

User Id

String

App Id

String

Cluster Id

String

### Queue Definition
FieldTypeDescriptionDefault ValueRequired

Removal Strategy

Enumeration, one of:

  • EXPLICIT

  • SHUTDOWN

  • UNUSED

Defines when the declared queue must be removed from the broker.

EXPLICIT

Exchange To Bind

String

Defines the exchange to bind the queue to.

Binding Routing Key

String

Defines the routing key to use in the binding of the exchange.

### Repeatable In Memory Stream Configures the in-memory streaming strategy by which the request fails if the data exceeds the MAX buffer size. Always run performance tests to find the optimal buffer size for your specific use case.
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

Initial amount of memory to allocate to the data stream. If the streamed data exceeds this value, the buffer expands by Buffer Size Increment, with an upper limit of Max In Memory Size value.

Buffer Size Increment

Number

This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised when the buffer gets full.

Max Buffer Size

Number

Maximum size of the buffer. If the buffer size exceeds this value, Mule raises a STREAM_MAXIMUM_SIZE_EXCEEDED error. A value of less than or equal to 0 means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the Initial Buffer Size, Buffer Size Increment, and Buffer Unit fields.

### Repeatable File Store Stream Configures the repeatable file-store streaming strategy by which Mule keeps a portion of the stream content in memory. If the stream content is larger than the configured buffer size, Mule backs up the buffer’s content to disk and then clears the memory.
FieldTypeDescriptionDefault ValueRequired

In Memory Size

Number

Maximum amount of memory that the stream can use for data. If the amount of memory exceeds this value, Mule buffers the content to disk. To optimize performance:

  • Configure a larger buffer size to avoid the number of times Mule needs to write the buffer on disk. This increases performance, but it also limits the number of concurrent requests your application can process, because it requires additional memory.

  • Configure a smaller buffer size to decrease memory load at the expense of response time.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the In Memory Size field.

### Redelivery Policy Configures the redelivery policy for executing requests that generate errors. You can add a redelivery policy to any source in a flow.
FieldTypeDescriptionDefault ValueRequired

Max Redelivery Count

Number

Maximum number of times that a redelivered request can be processed unsuccessfully before returning a REDELIVERY_EXHAUSTED error.

Message Digest Algorithm

String

Secure hashing algorithm to use. If not set, the default is SHA-256. If the payload of the message is a Java object, Mule ignores this value and returns the value that the payload’s hashCode() returned.

Message Identifier

Defines which strategy is used to identify the messages.

Object Store

Object Store

Configures the object store that stores the redelivery counter for each message.

### Redelivery Policy Message Identifier Configures the message identifier strategy for the redelivery policy.
FieldTypeDescriptionDefault ValueRequired

Use Secure Hash

Boolean

If true, Mule uses a secure hash algorithm to identify a redelivered message.

Id Expression

String

One or more expressions that determine when a message was redelivered. You can set this property only if the Use Secure Hash field is false.

### AMQP Properties
FieldTypeDescriptionDefault ValueRequired

Content Type

String

The content type of the body

/

Content Encoding

String

The Content Encoding of the published Message

Priority

Number

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

0

Correlation Id

String

Used in case of implementation of RPC pattern to distinguish among messages in a request-reply.

Message Id

String

Reply To

String

Destination set in case of RPC.

Expiration

Number

Expiration in miliseconds for the message.

Expiration Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

MILLISECONDS

User Id

String

App Id

String

Cluster Id

String

Timestamp

Date

Type

String

Type of the consumed message

### Exchange Defintiion
FieldTypeDescriptionDefault ValueRequired

Removal Strategy

Enumeration, one of:

  • EXPLICIT

  • SHUTDOWN

  • UNUSED

Defines when the declared exchange must be removed from the broker.

EXPLICIT

Type

Enumeration, one of:

  • DIRECT

  • TOPIC

  • FANOUT

  • HEADERS

The type of exchange to be declared.

FANOUT

--- product: AMQP Connector version: 1.8 --- # AMQP Connector Examples > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To fully benefit from using Anypoint Connector for AMQP (AMQP Connector), see the following examples of configuring the connector operations: - [Manage Message Acknowledgments](https://docs.mulesoft.com/amqp-connector/1.8/amqp-ack) Configure AMQP Connector to manage different acknowledgment configurations, such as automatic acknowledgment on success, immediate acknowledgment, and manual acknowledgment. - [Listen for New Messages](https://docs.mulesoft.com/amqp-connector/1.8/amqp-listener) Configure the Listener source to listen for new messages as they arrive into an AMQP queue. - [Publish New Messages](https://docs.mulesoft.com/amqp-connector/1.8/amqp-publish) Configure the Publish operation to create a new AMQP message and send it to the specified exchange. - [Consume Messages](https://docs.mulesoft.com/amqp-connector/1.8/amqp-consume) Configure the Consume operation to consume a message at any given time in the flow, from any given AMQP queue. - [Publish Messages and Listen for Replies](https://docs.mulesoft.com/amqp-connector/1.8/amqp-publish-consume) Configure the Publish Consume operation to publish a message to any exchange, and then wait for a reply on a different destination. - [Manage Transactions](https://docs.mulesoft.com/amqp-connector/1.8/amqp-transactions) Configure AMQP Connector to manage transactional connections to execute a series of operations. - [Avoid Changing the AMQP Topography](https://docs.mulesoft.com/amqp-connector/1.8/amqp-topography) Configure AMQP Connector global config properties so that the declaration of AMQP exchanges and queues is disabled. - [Connect to mTLS](https://docs.mulesoft.com/amqp-connector/1.8/amqp-mtls) Configure AMQP Connector to connect to an AMQP broker with mutual TLS (mTLS) authentication. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # AMQP Connector Examples > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To fully benefit from using Anypoint Connector for AMQP (AMQP Connector), see the following examples of configuring the connector operations: - [Manage Message Acknowledgments](https://docs.mulesoft.com/amqp-connector/latest/amqp-ack) Configure AMQP Connector to manage different acknowledgment configurations, such as automatic acknowledgment on success, immediate acknowledgment, and manual acknowledgment. - [Listen for New Messages](https://docs.mulesoft.com/amqp-connector/latest/amqp-listener) Configure the Listener source to listen for new messages as they arrive into an AMQP queue. - [Publish New Messages](https://docs.mulesoft.com/amqp-connector/latest/amqp-publish) Configure the Publish operation to create a new AMQP message and send it to the specified exchange. - [Consume Messages](https://docs.mulesoft.com/amqp-connector/latest/amqp-consume) Configure the Consume operation to consume a message at any given time in the flow, from any given AMQP queue. - [Publish Messages and Listen for Replies](https://docs.mulesoft.com/amqp-connector/latest/amqp-publish-consume) Configure the Publish Consume operation to publish a message to any exchange, and then wait for a reply on a different destination. - [Manage Transactions](https://docs.mulesoft.com/amqp-connector/latest/amqp-transactions) Configure AMQP Connector to manage transactional connections to execute a series of operations. - [Avoid Changing the AMQP Topography](https://docs.mulesoft.com/amqp-connector/latest/amqp-topography) Configure AMQP Connector global config properties so that the declaration of AMQP exchanges and queues is disabled. - [Connect to mTLS](https://docs.mulesoft.com/amqp-connector/latest/amqp-mtls) Configure AMQP Connector to connect to an AMQP broker with mutual TLS (mTLS) authentication. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: AMQP Connector version: 1.8 --- # AMQP Connector Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt AMQP Connector v1.8 Release Notes: [AMQP Connector Release Notes](https://docs.mulesoft.com/release-notes/connector/connector-amqp) Anypoint Connector for AMQP is an AMQP 0.9.1 compliant MuleSoft extension, and is used to consume and produce AMQP messages. The extension supports AMQP functionality including exchanges and queues, consumers, acknowledgment modes, and local transactions. ## Configurations --- ### Config These are the base configuration parameters for AMQP Connector. #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Encoding

String

The default encoding of the Message body to use if the message doesn’t communicate it.

Content Type

String

The default contentType of the Message body to use if the message doesn’t communicate it

/

Create Fallback Queue

Boolean

Whether to create non-existing queues according to the fallback definition if they are defined.

true

Create Fallback Exchange

Boolean

Whether to create non-existing exchanges according to the fallback definition if they are defined.

true

Send Correlation Id

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

Whether to specify a correlationId when publishing messages. This applies both for custom correlation IDs specifies at the operation level and for default correlation IDs taken from the current event

AUTO

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Ack Mode

Enumeration, one of:

  • IMMEDIATE

  • AUTO

  • MANUAL

The acknowledgment mode to use when consuming from the AMQP broker. If a transaction is opened in the channel, message acknowledgment is handled automatically by commit, and recovery is handled automatically by rollback.

IMMEDIATE

No Local

Boolean

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

false

Exclusive Consumers

Boolean

Set to true if the connector should only create exclusive consumers. Only the consumer created can access the queue.

false

Number Of Consumers

Number

It is the number of consumers spawned by message source to receive AMQP messages. Each consumer will create a channel.

4

Delivery Mode

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

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

PERSISTENT

Priority

Number

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

0

Request Broker Confirms

Boolean

Whether it must fail in case no confirmation is provided.

false

Mandatory

Boolean

Whether the operation must fail if it cannot be routed to a queue.

false

Immediate

Boolean

Whether the operation must fail if it cannot be routed to a queue consumer immediately.

false

Returned Message Exchange

String

The exchange to publish returned messages.

Prefetch Size

Number

This field defines a prefetch size window. The broker will send as much messages as possible without exceeding the prefetchSize window in octets (bytes). 0 is used for no specific limit.

0

Prefetch Count

Number

Specifies a global prefetch window in terms of whole messages. This field may be used in combination with the prefetch-size field; a message will only be sent in advance if both prefetch windows allow it. 0 is used for no specific limit.

0

#### Connection Types ##### Connection Generic implementation of a AMQP ConnectionProvider. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Socket Configuration

TLS Configuration

Reference to a TLS config element. This will enable secure connection to the AMQP broker.

Host

String

Host of the broker to connect to.

x

Port

Number

Port of the AMQP broker to connect to.

Virtual Host

String

Virtual host to use in the AMQP broker.

/

Username

String

Username to use when providing credentials for authentication.

Password

String

Password to use when providing credentials for authentication.

Use Tls

Boolean

Whether TLS is needed to use. In case it is not provided, the default for AMQP connection will be used.

false

Use Sni

Boolean

Whether Server Name Indication is needed to use in the ClientHello Message

false

Use Sasl

Boolean

Whether SASL (EXTERNAL) Auth mechanism is used (No username or password required).

false

Heartbeat Timeout

Number

The heartbeat timeout. Heartbeat frames is sent at about 1/2 the timeout interval.

60

Handshake Timeout

Number

AMQP 0.9.1 timeout to set to the underlying AMQP connector.

Handshake Timeout Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Timeunit for the handshake timeout AMQP connection socket configuration.

MILLISECONDS

Fallback Addresses

The addresses of the broker nodes to attempt connection to, should the connection to main broker fail.

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy

## Supported Operations - [Consume](#consume) - [Publish](#publish) - [Publish Consume](#publishConsume) ## Associated Sources - [Listener](#listener) ## Operations ### Consume `` Enables you to consume a single AMQP message from a given queue. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Queue Name

String

The name of the queue from where the Message should be consumed

x

Content Type

String

The content type of the message body

Encoding

String

The encoding of the message body

Fallback Queue Definition

The queue definition to use for queue declaration in case there is no queue with the queueName

Ack Mode

Enumeration, one of:

  • IMMEDIATE

  • MANUAL

The ACK mode to use when consuming a message

Consumer Tag

String

The consumer tag to use for the consumer involved in the operation

Maximum Wait

Number

Maximum time to wait for a message to arrive before timeout

10000

Maximum Wait Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the maximumWaitTime configuration

MILLISECONDS

Create Fallback Queue

Boolean

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

information of the current transaction in case it exists

JOIN_IF_POSSIBLE

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that storesoperation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

#### Output

Type

Any

Attributes Type

### For Configurations - [Config](#config) #### Throws - AMQP:QUEUE\_NOT\_FOUND - AMQP:CONNECTIVITY - AMQP:CONSUMING - AMQP:NO\_CHANNEL\_AVAILABLE - AMQP:RETRY\_EXHAUSTED - AMQP:CREATION\_NOT\_ALLOWED - AMQP:TIMEOUT ### Publish `` Enables you to publish a single AMQP message to a given exchange. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Exchange Name

String

The name of the exchange to publish the message to

Routing Keys

Array of String

List of routing keys

Delivery Mode

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

The delivery mode to use when publishing to the AMQP broker

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

information of the current transaction in case it exists

JOIN_IF_POSSIBLE

Send Correlation Id

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

options on whether to include an outbound correlation ID or not

Create Fallback Exchange

Boolean

Skip Exchange Validation

Enumeration, one of:

  • YES

Skips the exchange validation.
By default, the Publish operation validates the exchange if you do not configure the Skip Exchange Validation field. While skipping validation can enhance performance, this approach also risks message loss if the exchange does not exist, depending on the broker’s configuration.

Fallback Exchange Definition

The exchange to use for exchange declaration in case there is no exchange with the exchangeName

Body

Any

The body of the Message

#[payload]

AMQP Properties

Properties of the message.

Headers

Object

The custom user properties that should be set to this AmqpMessage

Request Broker Confirms

Boolean

Expects a confirmation from a message published. An exception is raised in case no confirmation is provided in case this attribute is set to true.

false

Mandatory

Boolean

Tells the server how to react if the message cannot be routed to a queue. If set to true, the server throws an exception (UNROUTABLE_MESSAGE, see below in the operation spec) for any message that cannot be routed. If set to false, the server silently drops the message.

false

Immediate

Boolean

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 (UNROUTABLE_MESSAGE, see below in the operation spec) for any undeliverable message. If set to false, the server queues the message, but with no guarantee that the message will ever be consumed.

false

Returned Message Exchange

String

The exchange to publish returned messages.

Reconnection Strategy

Retry strategy in case of connectivity errors.

### For Configurations - [Config](#config) #### Throws - AMQP:PUBLISHING - AMQP:ILLEGAL\_BODY - AMQP:CONNECTIVITY - AMQP:UNROUTABLE\_MESSAGE - AMQP:EXCHANGE\_NOT\_FOUND - AMQP:NO\_CHANNEL\_AVAILABLE - AMQP:RETRY\_EXHAUSTED - AMQP:CREATION\_NOT\_ALLOWED ### Publish Consume `` Enables you to send a message to a AMQP exchange and waits for a response either to the provided replyTo destination or to a temporary destination created dynamically. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Exchange Name

String

The name of the exchange to publish the message to

x

Content Type

String

The content type of the message body

Encoding

String

The encoding of the message body

Routing Key

String

The routing key to publish to

Delivery Mode

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

The delivery mode to use when publishing to the AMQP broker

Maximum Wait

Number

The maximum time to wait for a message to arrive before timeout

10000

Maximum Wait Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The time unit to use in the maximumWaitTime configuration

MILLISECONDS

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

information of the current transaction in case it exists

JOIN_IF_POSSIBLE

Send Correlation Id

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

options on whether to include an outbound correlation ID or not

Create Fallback Exchange

Boolean

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Skip Exchange Validation

Enumeration, one of:

  • YES

This field is intended to skip exchange validation by default the operation will do the validation if the parameter is not configured. If you decide to skip the exchange validation it will improve the performance but if the exchange does not exist you can incur in messaging losing depending on the broker configuration.

Fallback Exchange Definition

The exchange to use for exchange declaration in case there is no exchange with the exchangeName

Body

Any

The body of the Message

#[payload]

AMQP Properties

Properties of the message.

Headers

Object

The custom user properties that should be set to this AmqpMessage

Request Broker Confirms

Boolean

Expects a confirmation from a message published. An exception is raised in case no confirmation is provided in case this attribute is set to true.

false

Mandatory

Boolean

Tells the server how to react if the message cannot be routed to a queue. If set to true, the server throws an exception (UNROUTABLE_MESSAGE, see below in the operation spec) for any message that cannot be routed. If set to false, the server silently drops the message.

false

Immediate

Boolean

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 (UNROUTABLE_MESSAGE, see below in the operation spec) for any undeliverable message. If set to false, the server queues the message, but with no guarantee that the message will ever be consumed.

false

Returned Message Exchange

String

The exchange to publish returned messages.

Target Variable

String

Name of the variable that storesoperation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

#### Output

Type

Any

Attributes Type

### For Configurations - [Config](#config) #### Throws - AMQP:PUBLISHING - AMQP:PUBLISHING\_CONSUMING - AMQP:CONNECTIVITY - AMQP:CONSUMING - AMQP:NO\_CHANNEL\_AVAILABLE - AMQP:RETRY\_EXHAUSTED - AMQP:CREATION\_NOT\_ALLOWED - AMQP:TIMEOUT ### Ack `` Enables to ack a message with the delivery tag. #### Parameters
NameTypeDescriptionDefault ValueRequired

Ack Id

String

delivery tag of the message to be ack’ed

x

#### Throws - AMQP:ACKNOWLEDGING - AMQP:NO\_CHANNEL\_AVAILABLE - AMQP:DELIVER\_TAG\_NOT\_FOUND - AMQP:TIMEOUT ### Reject `` Enables you to reject a delivered AMQP message. #### Parameters
NameTypeDescriptionDefault ValueRequired

Ack Id

String

delivery tag of the message to be rejected

x

Requeue

Boolean

Indicates whether the rejected message has to be requeued

false

#### Throws - AMQP:REQUEUE - AMQP:ACKNOWLEDGING - AMQP:REJECTING - AMQP:DELIVER\_TAG\_NOT\_FOUND - AMQP:TIMEOUT ## Sources ### Listener `` AMQP listener for queues, enables you to listen for incoming messages. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Queue Name

String

Name of the queue to consume from.

x

Fallback Queue Definition

Declaration of a queue definition to use in case no queue with the queueName provided exists in the broker. In case the queue with provided queueName exists, it will be used as is, ignoring the fallback. In case the queue does not exist, a new queue shall be created according to the referenced definition.

Ack Mode

Enumeration, one of:

  • IMMEDIATE

  • AUTO

  • MANUAL

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

Number Of Consumers

Number

The number of channels that are spawned per inbound endpoint to receive AMQP messages.

Consumer Tag

String

A client-generated consumer tag to establish context.

Recover Strategy

Enumeration, one of:

  • NONE

  • NO_REQUEUE

  • REQUEUE

Valid values for the recoverStrategy option are: NONE, NO_REQUEUE and REQUEUE.

REQUEUE

Inbound Encoding

String

The default encoding of the message body to use if the message doesn’t communicate it

Inbound Content Type

String

The default contentType of the Message body to use if the message doesn’t communicate it

Create Fallback Queue

Boolean

Whether non existing queues will be created according to the fallback definition or an error is raised if they do not exist. This can be disabled in the mule app is not intended to change the AMQP topography.

Transactional Action

Enumeration, one of:

  • ALWAYS_BEGIN

  • NONE

The type of beginning action that sources can take regarding transactions.

NONE

Transaction Type

Enumeration, one of:

  • LOCAL

  • XA

The type of transaction to create. Availability depends on Mule version.

LOCAL

Primary Node Only

Boolean

Determines whether to execute this source on only the primary node when running Mule instances in a cluster.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Prefetch Size

Number

This field defines a prefetch size window. The broker will send as much messages as possible without exceeding the prefetchSize window in octets (bytes). 0 is used for no specific limit.

Prefetch Count

Number

Specifies a global prefetch window in terms of whole messages. This field may be used in combination with the prefetch-size field; a message will only be sent in advance if both prefetch windows allow it. 0 is used for no specific limit.

Reconnection Strategy

Retry strategy in case of connectivity errors.

Body

Any

The body of the Message

#[payload]

AMQP Properties

Properties of the message.

Headers

Object

The custom user properties that should be set to this AmqpMessage

Delivery Mode

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

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

PERSISTENT

Priority

Number

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

0

Request Broker Confirms

Boolean

Whether it must fail in case no confirmation is provided in case this attribute is set to true."

false

Mandatory

Boolean

Whether the operation must fail if it cannot be routed to a queue.

false

Immediate

Boolean

Whether the operation must fail if it cannot be routed to a queue consumer immediately.

false

Returned Message Exchange

String

The exchange to publish returned messages.

#### Output

Type

Any

Attributes Type

### For Configurations - [Config](#config) ## Types ### Socket Configuration
FieldTypeDescriptionDefault ValueRequired

Keep Alive

Boolean

Keep alive to set to the underlying AMQP connector

false

So Timeout Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Timeunit for the SO_TIMEOUT AMQP connection socket configuration.

MILLISECONDS

So Timeout

Number

SO_TIMEOUT to set to the underlying AMQP connector.

Receive Buffer Size

Number

Receive buffer size to set to the underlying AMQP connector

Send Buffer Size

Number

Send buffer size to set to the underlying AMQP connector

### TLS Configures TLS to provide secure communications for the Mule app.
FieldTypeDescriptionDefault ValueRequired

Enabled Protocols

String

Comma-separated list of protocols enabled for this context.

Enabled Cipher Suites

String

Comma-separated list of cipher suites enabled for this context.

Trust Store

Configures the TLS truststore.

Key Store

Configures the TLS keystore.

Revocation Check

### Truststore Configures the truststore for TLS.
FieldTypeDescriptionDefault ValueRequired

Path

String

Path to the truststore. Mule resolves the path relative to the current classpath and file system.

Password

String

Password used to protect the truststore.

Type

String

Type of store.

Algorithm

String

Encryption algorithm that the truststore uses.

Insecure

Boolean

If true, Mule stops performing certificate validations. Setting this to true can make connections vulnerable to attacks.

### Keystore Configures the keystore for the TLS protocol. The keystore you generate contains a private key and a public certificate.
FieldTypeDescriptionDefault ValueRequired

Path

String

Path to the keystore. Mule resolves the path relative to the current classpath and file system.

Type

String

Type of store.

Alias

String

Alias of the key to use when the keystore contains multiple private keys. By default, Mule uses the first key in the file.

Key Password

String

Password used to protect the private key.

Password

String

Password used to protect the keystore.

Algorithm

String

Encryption algorithm that the keystore uses.

### Standard Revocation Check Configures standard revocation checks for TLS certificates.
FieldTypeDescriptionDefault ValueRequired

Only End Entities

Boolean

Which elements to verify in the certificate chain:

  • true

Verify only the last element in the certificate chain.

  • false

Verify all elements in the certificate chain.

Prefer Crls

Boolean

How to check certificate validity:

  • true

Check the Certification Revocation List (CRL) for certificate validity.

  • false

Use the Online Certificate Status Protocol (OCSP) to check certificate validity.

No Fallback

Boolean

Whether to use the secondary method to check certificate validity:

  • true

Use the method that wasn’t specified in the Prefer Crls field (the secondary method) to check certificate validity.

  • false

Do not use the secondary method to check certificate validity.

Soft Fail

Boolean

What to do if the revocation server can’t be reached or is busy:

  • true

Avoid verification failure.

  • false

Allow the verification to fail.

### Custom OCSP Responder Configures a custom OCSP responder for certification revocation checks.
FieldTypeDescriptionDefault ValueRequired

Url

String

URL of the OCSP responder.

Cert Alias

String

Alias of the signing certificate for the OCSP response. If specified, the alias must be in the truststore.

### CRL File Specifies the location of the certification revocation list (CRL) file.
FieldTypeDescriptionDefault ValueRequired

Path

String

Path to the CRL file.

### Fallback Address
FieldTypeDescriptionDefault ValueRequired

Host

String

Host of the broker to connect to.

x

Port

String

Port of the AMQP broker to connect to.

### Reconnection Configures a reconnection strategy for an operation.
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

Reconnection strategy to use.

### Reconnect Configures a standard reconnection strategy, which specifies how often to reconnect and how many reconnection attempts the connector source or operation can make.
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Count

Number

How many reconnection attempts the Mule app can make.

### Reconnect Forever Configures a forever reconnection strategy by which the connector source or operation attempts to reconnect at a specified frequency for as long as the Mule app runs.
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

### Expiration Policy Configures an expiration policy strategy.
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### AMQP Attributes
FieldTypeDescriptionDefault ValueRequired

Envelope

Encapsulates a group of parameters used for AMQP’s Basic methods

x

Properties

AMQP Message Properties

x

Headers

Object

AMQP Message parameters

x

Ack Id

String

The channel ACK ID required to ACK a the current Message if one is available, or null otherwise.

### Envelope
FieldTypeDescriptionDefault ValueRequired

Delivery Tag

Number

Redeliver

Boolean

false

Exchange

String

Routing Key

String

### Properties
FieldTypeDescriptionDefault ValueRequired

Content Type

String

Content Encoding

String

Delivery Mode

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

PERSISTENT

Priority

Number

Correlation Id

String

Reply To

String

Expiration

String

Message Id

String

Timestamp

Date

Type

String

User Id

String

App Id

String

Cluster Id

String

### Queue Definition
FieldTypeDescriptionDefault ValueRequired

Removal Strategy

Enumeration, one of:

  • EXPLICIT

  • SHUTDOWN

  • UNUSED

Defines when the declared queue must be removed from the broker.

EXPLICIT

Exchange To Bind

String

Defines the exchange to bind the queue to.

Binding Routing Key

String

Defines the routing key to use in the binding of the exchange.

### Repeatable In Memory Stream Configures the in-memory streaming strategy by which the request fails if the data exceeds the MAX buffer size. Always run performance tests to find the optimal buffer size for your specific use case.
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

Initial amount of memory to allocate to the data stream. If the streamed data exceeds this value, the buffer expands by Buffer Size Increment, with an upper limit of Max In Memory Size value.

Buffer Size Increment

Number

This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised when the buffer gets full.

Max Buffer Size

Number

Maximum size of the buffer. If the buffer size exceeds this value, Mule raises a STREAM_MAXIMUM_SIZE_EXCEEDED error. A value of less than or equal to 0 means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the Initial Buffer Size, Buffer Size Increment, and Buffer Unit fields.

### Repeatable File Store Stream Configures the repeatable file-store streaming strategy by which Mule keeps a portion of the stream content in memory. If the stream content is larger than the configured buffer size, Mule backs up the buffer’s content to disk and then clears the memory.
FieldTypeDescriptionDefault ValueRequired

In Memory Size

Number

Maximum amount of memory that the stream can use for data. If the amount of memory exceeds this value, Mule buffers the content to disk. To optimize performance:

  • Configure a larger buffer size to avoid the number of times Mule needs to write the buffer on disk. This increases performance, but it also limits the number of concurrent requests your application can process, because it requires additional memory.

  • Configure a smaller buffer size to decrease memory load at the expense of response time.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the In Memory Size field.

### Redelivery Policy Configures the redelivery policy for executing requests that generate errors. You can add a redelivery policy to any source in a flow.
FieldTypeDescriptionDefault ValueRequired

Max Redelivery Count

Number

Maximum number of times that a redelivered request can be processed unsuccessfully before returning a REDELIVERY_EXHAUSTED error.

Use Secure Hash

Boolean

If true, Mule uses a secure hash algorithm to identify a redelivered message.

Message Digest Algorithm

String

Secure hashing algorithm to use if the Use Secure Hash field is true. If the payload of the message is a Java object, Mule ignores this value and returns the value that the payload’s hashCode() returned.

Id Expression

String

One or more expressions that determine when a message was redelivered. You can set this property only if the Use Secure Hash field is false.

Object Store

Object Store

Configures the object store that stores the redelivery counter for each message.

### AMQP Properties
FieldTypeDescriptionDefault ValueRequired

Content Type

String

The content type of the body

/

Content Encoding

String

The Content Encoding of the published Message

Priority

Number

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

0

Correlation Id

String

Used in case of implementation of RPC pattern to distinguish among messages in a request-reply.

Message Id

String

Reply To

String

Destination set in case of RPC.

Expiration

Number

Expiration in miliseconds for the message.

Expiration Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

MILLISECONDS

User Id

String

App Id

String

Cluster Id

String

Timestamp

Date

Type

String

Type of the consumed message

### Exchange Defintiion
FieldTypeDescriptionDefault ValueRequired

Removal Strategy

Enumeration, one of:

  • EXPLICIT

  • SHUTDOWN

  • UNUSED

Defines when the declared exchange must be removed from the broker.

EXPLICIT

Type

Enumeration, one of:

  • DIRECT

  • TOPIC

  • FANOUT

  • HEADERS

The type of exchange to be declared.

FANOUT

--- product: AMQP Connector version: 1.8 --- # AMQP Connector XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio. If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. When you add the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/amqp> http://www.mulesoft.org/schema/mule/amqp/current/mule-amqp.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml com.mulesoft.connectors mule-amqp-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `amqp`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # AMQP Connector XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio. If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. When you add the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/amqp> http://www.mulesoft.org/schema/mule/amqp/current/mule-amqp.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml com.mulesoft.connectors mule-amqp-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `amqp`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: AMQP Connector version: 1.8 --- # Avoid Changing the AMQP Topography > For the full documentation index, see: https://docs.mulesoft.com/llms.txt You can set the `createFallbackExchange` and `createFallbackQueue` global config properties so that the declaration of AMQP exchanges and queues is disabled. These parameters have been added for those scenarios where it must be guaranteed that no changes to the AMQP topography will be attempted. In those cases, both the declaration of queues and exchanges which do not previously exist will result in an `AMQP:CREATION_NOT_ALLOWED` error. For example, in the following flow: ```xml ``` If the `newExchange` exchange does not exist and the `createFallbackExchange` is set to `false`, an invocation of the publish operation causes an `AMQP:CREATION_NOT_ALLOWED` error. Notice that the `createFallbackExchange` can be overridden at the operation level and it can get an expression as a value. For example: The use of `createFallbackQueue` parameter in a consume operation is analogous: ```xml ``` You can also use this parameter in the listener: ```xml ``` --- product: AMQP Connector version: 1.9 is-latest-version: true --- # Avoid Changing the AMQP Topography > For the full documentation index, see: https://docs.mulesoft.com/llms.txt You can set the `createFallbackExchange` and `createFallbackQueue` global config properties so that the declaration of AMQP exchanges and queues is disabled. These parameters have been added for those scenarios where it must be guaranteed that no changes to the AMQP topography will be attempted. In those cases, both the declaration of queues and exchanges which do not previously exist will result in an `AMQP:CREATION_NOT_ALLOWED` error. For example, in the following flow: ```xml ``` If the `newExchange` exchange does not exist and the `createFallbackExchange` is set to `false`, an invocation of the publish operation causes an `AMQP:CREATION_NOT_ALLOWED` error. Notice that the `createFallbackExchange` can be overridden at the operation level and it can get an expression as a value. For example: The use of `createFallbackQueue` parameter in a consume operation is analogous: ```xml ``` You can also use this parameter in the listener: ```xml ``` --- product: AMQP Connector version: 1.8 --- # Configure the Mutual TLS Authentication > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example shows how to configure Anypoint Connector for AMQP (AMQP Connector) to connect to an AMQP broker with mutual TLS (mTLS) authentication. To configure the global configuration connection you need: - A client truststore that includes the Certificate Authority’s certificates that are required for the server validation. - A client keystore that provides the client private key and certificate that are required for the authentication. - To enable the parameters **Use TLS** and **Use SNI** on the AQMP global configuration in Anypoint Studio. ## Configure the Connection To configure the Mutual TLS authentication connection in Studio, follow these steps: 1. Navigate to the **Global Elements** tab and click **Create**. 2. In the filter box, type `AMQP`. 3. Select **AQMP Config**. 4. Click **OK**. 5. In the **General** tab, for the **Connection** section, set the following parameters: - **Host**: `localhost` - **Port**: `${rabbitmq.tls.port}` 6. Select the **Use tls** and **Use sni** parameters boxes. 7. Click the **TLS** tab. 8. For **TLS Configuration** select **Edit inline**. 9. In the **Trust Store Configuration** section, set the following parameters: - **Path**: `mtls/truststore.jks` - **Password**: `test` - **Type**: `JKS` 10. In the **Key Store Configuration** section, set the following parameters: - **Type**: `JKS` - **Path**: `mtls/test.jks` - **Alias**: `test` - **Key Password**: `test` - **keyPassword**: `test` 11. Click **OK**. In Studio, the AMQP global configuration with TLS authentication looks like this: ![Configure AMQP Mutual TLS Authentication in global configuration element window](/mulesoft/current/en-us/amqp-connector/1.8/_images/amqp-tls-configuration.png) Figure 1. AMQP Mutual TLS Authentication configuration ## XML for Configuring Mutual TLS Authentication In the XML editor, the configuration looks like this: ```xml ``` ## See Also - [TLS Configuration](https://docs.mulesoft.com/mule-runtime/4.3/tls-configuration) - [Salesforce Help](https://help.salesforce.com) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # Configure the Mutual TLS Authentication > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example shows how to configure Anypoint Connector for AMQP (AMQP Connector) to connect to an AMQP broker with mutual TLS (mTLS) authentication. To configure the global configuration connection you need: - A client truststore that includes the Certificate Authority’s certificates that are required for the server validation. - A client keystore that provides the client private key and certificate that are required for the authentication. - To enable the parameters **Use TLS** and **Use SNI** on the AQMP global configuration in Anypoint Studio. ## Configure the Connection To configure the Mutual TLS authentication connection in Studio, follow these steps: 1. Navigate to the **Global Elements** tab and click **Create**. 2. In the filter box, type `AMQP`. 3. Select **AQMP Config**. 4. Click **OK**. 5. In the **General** tab, for the **Connection** section, set the following parameters: - **Host**: `localhost` - **Port**: `${rabbitmq.tls.port}` 6. Select the **Use tls** and **Use sni** parameters boxes. 7. Click the **TLS** tab. 8. For **TLS Configuration** select **Edit inline**. 9. In the **Trust Store Configuration** section, set the following parameters: - **Path**: `mtls/truststore.jks` - **Password**: `test` - **Type**: `JKS` 10. In the **Key Store Configuration** section, set the following parameters: - **Type**: `JKS` - **Path**: `mtls/test.jks` - **Alias**: `test` - **Key Password**: `test` - **keyPassword**: `test` 11. Click **OK**. In Studio, the AMQP global configuration with TLS authentication looks like this: ![Configure AMQP Mutual TLS Authentication in global configuration element window](/mulesoft/current/en-us/amqp-connector/latest/_images/amqp-tls-configuration.png) Figure 1. AMQP Mutual TLS Authentication configuration ## XML for Configuring Mutual TLS Authentication In the XML editor, the configuration looks like this: ```xml ``` ## See Also - [TLS Configuration](https://docs.mulesoft.com/mule-runtime/4.3/tls-configuration) - [Salesforce Help](https://help.salesforce.com) --- product: AMQP Connector version: 1.8 --- # Consume AMQP Messages > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The `consume` operation in AMQP Connector provides the ability to consume a message at any given time in the flow, from any given AMQP queue. ## Consume a Message The syntax to consume a message from a queue is: ```xml ``` This operation consumes the first available message in the queue identified by the `queueName` value, and converts it to an `AmqpMessage`, which results in the following structure: - The message’s content as payload - The message’s metadata in the message attributes After it is received, the message is immediately acknowledged by default. If you want to control the ACK of the message after some processing, then set `ackMode` to `MANUAL`. For more information about message ACK operations, see [How to Handle Acknowledgment](https://docs.mulesoft.com/amqp-connector/1.8/amqp-ack). ## Wait for a Message By default, the maximum wait time is configured to 10 seconds. If no message is available during the specified wait time, an `AMQP:TIMEOUT` error is thrown. You can customize the wait time by configuring the `maximumWait` and `maximumWaitUnit` parameters. To create an indefinite wait time for a message to arrive, set the `maximumWait` value to `-1`. In this case, no `TIMEOUT` error is thrown. ## MIME Types and Encoding AMQP Connector is designed to auto-determine a message’s MIME type (`contentType`) based on the `contentType` property of the message. However, there are cases in which it cannot make this determination, and you need firsthand knowledge of the message’s content. In such cases, you can force the content type to a particular value by using the `contentType` parameter. The same process works for encoding. By default, the connector assumes that the default encoding of Mule runtime engine matches that of the message, if no other information is provided. You can set this by using the `encoding` parameter. ## Declare a Queue in the Consume Operation By default, the `consume` operation fails with an `AMQP:QUEUE_NOT_FOUND` error if the defined queue does not exist. If a queue must be declared, a definition for the entity should be referenced or defined inline: ```xml ``` Notice that in the definition of the queue a binding can be created using the parameter `exchangeToBind`. The queue can also be defined as a high level element: ```xml ``` ## Avoid Changing the AMQP Topography You can set the `createFallbackQueue` global config to prevent changes to the AMQP topography resulting from the definition of fallback queues, see [How to Avoid Changing the AMQP Topography](https://docs.mulesoft.com/amqp-connector/1.8/amqp-topography). ## Incoming Message Metadata As stated earlier, each message received consists of two parts: - The payload, containing the content of the message - The attributes, containing metadata regarding the message This metadata has four parts that map all the information available in a AMQP Message: - Envelope - AckId - Headers - Properties See the [AMQP Reference](https://docs.mulesoft.com/amqp-connector/1.8/amqp-documentation) for information on the structure for attributes. ## See Also - [To Listen For New Messages](https://docs.mulesoft.com/amqp-connector/1.8/amqp-listener) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # Consume AMQP Messages > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The `consume` operation in AMQP Connector provides the ability to consume a message at any given time in the flow, from any given AMQP queue. ## Consume a Message The syntax to consume a message from a queue is: ```xml ``` This operation consumes the first available message in the queue identified by the `queueName` value, and converts it to an `AmqpMessage`, which results in the following structure: - The message’s content as payload - The message’s metadata in the message attributes After it is received, the message is immediately acknowledged by default. If you want to control the ACK of the message after some processing, then set `ackMode` to `MANUAL`. For more information about message ACK operations, see [How to Handle Acknowledgment](https://docs.mulesoft.com/amqp-connector/latest/amqp-ack). ## Wait for a Message By default, the maximum wait time is configured to 10 seconds. If no message is available during the specified wait time, an `AMQP:TIMEOUT` error is thrown. You can customize the wait time by configuring the `maximumWait` and `maximumWaitUnit` parameters. To create an indefinite wait time for a message to arrive, set the `maximumWait` value to `-1`. In this case, no `TIMEOUT` error is thrown. ## MIME Types and Encoding AMQP Connector is designed to auto-determine a message’s MIME type (`contentType`) based on the `contentType` property of the message. However, there are cases in which it cannot make this determination, and you need firsthand knowledge of the message’s content. In such cases, you can force the content type to a particular value by using the `contentType` parameter. The same process works for encoding. By default, the connector assumes that the default encoding of Mule runtime engine matches that of the message, if no other information is provided. You can set this by using the `encoding` parameter. ## Declare a Queue in the Consume Operation By default, the `consume` operation fails with an `AMQP:QUEUE_NOT_FOUND` error if the defined queue does not exist. If a queue must be declared, a definition for the entity should be referenced or defined inline: ```xml ``` Notice that in the definition of the queue a binding can be created using the parameter `exchangeToBind`. The queue can also be defined as a high level element: ```xml ``` ## Avoid Changing the AMQP Topography You can set the `createFallbackQueue` global config to prevent changes to the AMQP topography resulting from the definition of fallback queues, see [How to Avoid Changing the AMQP Topography](https://docs.mulesoft.com/amqp-connector/latest/amqp-topography). ## Incoming Message Metadata As stated earlier, each message received consists of two parts: - The payload, containing the content of the message - The attributes, containing metadata regarding the message This metadata has four parts that map all the information available in a AMQP Message: - Envelope - AckId - Headers - Properties See the [AMQP Reference](https://docs.mulesoft.com/amqp-connector/latest/amqp-documentation) for information on the structure for attributes. ## See Also - [To Listen For New Messages](https://docs.mulesoft.com/amqp-connector/latest/amqp-listener) --- product: AMQP Connector version: 1.8 --- # Handle Message Acknowledgment > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for AMQP provides different acknowledgment configurations. ## Automatic Acknowledgment On Success The `AUTO` `ackMode` can be used in the `amqp:listener` component, causing the automatic ACK of the received message **if and only if the flow execution completes successfully**. In case that an error occurs during the flow execution that causes it to terminate prematurely, then the message will not be ACKed and redelivery will occur. ## Immediate Acknowledgment Setting the `ackMode` to `IMMEDIATE` either in `amqp:listener` or `amqp:consume` operations will cause the Message to be automatically ACKed once it is consumed, and prior to any processing of the Message by the application. Having the Message automatically acknowledged once it is received means that the Message won\`t be redelivered if any error occurs during the processing of the Message, so application logic like a dead letter queue has to be created to handle errors without losing Messages. ## Manual Acknowledgment As you may expect, the `MANUAL` `ackMode` delegates all the responsibility of performing the ACK on the Message to the application logic. With this configuration, every Message received by either the `listener` or `consume` operations will have an `ackId` available in the MuleMessage `attributes` which identifies this Message uniquely for a given channel. The `ackId` that identifies the Message will then be passed on to the `amqp:ack` operation: ```xml ``` ## See Also - [Listen For New Messages](https://docs.mulesoft.com/amqp-connector/1.8/amqp-listener) - [Salesforce Help](https://help.salesforce.com) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # Handle Message Acknowledgment > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for AMQP provides different acknowledgment configurations. ## Automatic Acknowledgment On Success The `AUTO` `ackMode` can be used in the `amqp:listener` component, causing the automatic ACK of the received message **if and only if the flow execution completes successfully**. In case that an error occurs during the flow execution that causes it to terminate prematurely, then the message will not be ACKed and redelivery will occur. ## Immediate Acknowledgment Setting the `ackMode` to `IMMEDIATE` either in `amqp:listener` or `amqp:consume` operations will cause the Message to be automatically ACKed once it is consumed, and prior to any processing of the Message by the application. Having the Message automatically acknowledged once it is received means that the Message won\`t be redelivered if any error occurs during the processing of the Message, so application logic like a dead letter queue has to be created to handle errors without losing Messages. ## Manual Acknowledgment As you may expect, the `MANUAL` `ackMode` delegates all the responsibility of performing the ACK on the Message to the application logic. With this configuration, every Message received by either the `listener` or `consume` operations will have an `ackId` available in the MuleMessage `attributes` which identifies this Message uniquely for a given channel. The `ackId` that identifies the Message will then be passed on to the `amqp:ack` operation: ```xml ``` ## See Also - [Listen For New Messages](https://docs.mulesoft.com/amqp-connector/latest/amqp-listener) - [Salesforce Help](https://help.salesforce.com) --- product: AMQP Connector version: 1.8 --- # Handle Transactions in AMQP > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Transactional connections in AMQP allow you to execute a series of operations that are actually performed only when the transaction is committed. This has two main scenarios: - Publishing a message as part of a transaction: When performing a `publish`, the message will be effectively sent to the destination once the transaction is **committed**. If for some reason the transaction fails and a **rollback** occurs, then the Message will never be sent. - Consuming a message as part of a transaction: In case of consuming a AMQP Message, either with the `listener` or `consume`, the message will be acknowledged **only after the transacion is committed**, and instead it will be returned to the destination for redelivery if the transaction is **rolledback**. The AMQP Connector provides support for executing its operations in a transactional way out of the box using Mule’s `transactionalAction` configuration. In order to execute an operation as part of the transaction, we have the following two options. ## Process New Messages With a Transactional Session If you want a AMQP `listener` to use a transactional session when dispatching the messages, you should set the `transactionalAction` to 'ALWAYS\_BEGIN': ```xml ``` With this configuration, each new message will be processed in a transaction that is propagated to all the flow’s components and is committed once the flow execution is completed successfully. The transaction will be rolledback if the flow execution completes with an error. By default, **other components** in the flow will not join the transaction created by the listener. In order to execute other operations using the listener’s transaction, you must declare them either with 'ALWAYS\_JOIN', or 'JOIN\_IF\_POSSIBLE'. ## Execute Operations As Part Of A Transaction To execute an operation like `publish` or `consume` as part of a transaction, set the `transactionalAction` to `ALWAYS_JOIN`, or `JOIN_IF_POSSIBLE`: These operations can join a transaction initiated by the listener: ```xml ``` Or they can join a scoped transaction: ```xml ``` --- product: AMQP Connector version: 1.9 is-latest-version: true --- # Handle Transactions in AMQP > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Transactional connections in AMQP allow you to execute a series of operations that are actually performed only when the transaction is committed. This has two main scenarios: - Publishing a message as part of a transaction: When performing a `publish`, the message will be effectively sent to the destination once the transaction is **committed**. If for some reason the transaction fails and a **rollback** occurs, then the Message will never be sent. - Consuming a message as part of a transaction: In case of consuming a AMQP Message, either with the `listener` or `consume`, the message will be acknowledged **only after the transacion is committed**, and instead it will be returned to the destination for redelivery if the transaction is **rolledback**. The AMQP Connector provides support for executing its operations in a transactional way out of the box using Mule’s `transactionalAction` configuration. In order to execute an operation as part of the transaction, we have the following two options. ## Process New Messages With a Transactional Session If you want a AMQP `listener` to use a transactional session when dispatching the messages, you should set the `transactionalAction` to 'ALWAYS\_BEGIN': ```xml ``` With this configuration, each new message will be processed in a transaction that is propagated to all the flow’s components and is committed once the flow execution is completed successfully. The transaction will be rolledback if the flow execution completes with an error. By default, **other components** in the flow will not join the transaction created by the listener. In order to execute other operations using the listener’s transaction, you must declare them either with 'ALWAYS\_JOIN', or 'JOIN\_IF\_POSSIBLE'. ## Execute Operations As Part Of A Transaction To execute an operation like `publish` or `consume` as part of a transaction, set the `transactionalAction` to `ALWAYS_JOIN`, or `JOIN_IF_POSSIBLE`: These operations can join a transaction initiated by the listener: ```xml ``` Or they can join a scoped transaction: ```xml ``` --- product: AMQP Connector version: 1.8 --- # Listen For A Reply > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Request and Reply is a very common pattern between applications. AMQP Connector provides an operation specially designed for this, called `publish-consume`. The `publish-consume` operation enables you to publish a message to any exchange, and then wait for a reply on a different destination. When using this operation, the `replyTo` property of the outgoing message will contain the ID of the queue at which your app will be waiting for a response. This destination may be a well-known destination, or it may be a temporary queue created on the fly with the only purpose of receiving a single response message. Finally, the result of the operation will be the message received as a response, with exactly the same structure as if a `consume` operation was invoked. ## Wait For A Reply On A Temporary Queue Using a temporary Queue to wait for a response is very simple, just configure the message being sent and the operation will automatically wait for a response in a temporary queue: ```xml ``` In this example, the operation will `publish` a message with the current `payload` as its **body** and the **replyTo property** of the message configured to a temporary destination, to the `targetExchange`. Then, it will automatically try to consume the response from that temporary queue until a message is consumed or the `maximumWait` is reached (in which case it will fail with a `AMQP:TIMEOUT` error). ## Receive The Reply On A Known Queue In many cases you don’t want reply queues to be created per-request basis, but instead a well-known queue is used for replies. For this cases, all you have to do is configure the `reply-to` parameter on the outgoing Message: ```xml ``` Now the operation will `publish` a message to the `targetExchange` with the current `payload` as its **body** and the `replyTo` **property** configured with the `replyToQueue`. Then, it will automatically try to consume the response from the `replyToQueue` queue until a message is consumed or the `maximumWait` is reached (in which case it will fail with a `AMQP:TIMEOUT` error). ## See Also - [Publish Messages](https://docs.mulesoft.com/amqp-connector/1.8/amqp-publish) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # Listen For A Reply > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Request and Reply is a very common pattern between applications. AMQP Connector provides an operation specially designed for this, called `publish-consume`. The `publish-consume` operation enables you to publish a message to any exchange, and then wait for a reply on a different destination. When using this operation, the `replyTo` property of the outgoing message will contain the ID of the queue at which your app will be waiting for a response. This destination may be a well-known destination, or it may be a temporary queue created on the fly with the only purpose of receiving a single response message. Finally, the result of the operation will be the message received as a response, with exactly the same structure as if a `consume` operation was invoked. ## Wait For A Reply On A Temporary Queue Using a temporary Queue to wait for a response is very simple, just configure the message being sent and the operation will automatically wait for a response in a temporary queue: ```xml ``` In this example, the operation will `publish` a message with the current `payload` as its **body** and the **replyTo property** of the message configured to a temporary destination, to the `targetExchange`. Then, it will automatically try to consume the response from that temporary queue until a message is consumed or the `maximumWait` is reached (in which case it will fail with a `AMQP:TIMEOUT` error). ## Receive The Reply On A Known Queue In many cases you don’t want reply queues to be created per-request basis, but instead a well-known queue is used for replies. For this cases, all you have to do is configure the `reply-to` parameter on the outgoing Message: ```xml ``` Now the operation will `publish` a message to the `targetExchange` with the current `payload` as its **body** and the `replyTo` **property** configured with the `replyToQueue`. Then, it will automatically try to consume the response from the `replyToQueue` queue until a message is consumed or the `maximumWait` is reached (in which case it will fail with a `AMQP:TIMEOUT` error). ## See Also - [Publish Messages](https://docs.mulesoft.com/amqp-connector/latest/amqp-publish) --- product: AMQP Connector version: 1.8 --- # Listen For New Messages > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The Listener source in Anypoint Connector for AMQP (AMQP Connector) provides the ability to consume messages as they arrive into an AMQP queue. ## Listen for New Messages The syntax to listen for new messages from a queue is: ```xml ``` The source listens for new messages in the queue identified by the `queueName` parameter, returning a `AmqpMessage` each time a AMQP message is available in the queue. The `AmqpMessage` has: - The message’s content as its payload. - The message’s metadata in the message attributes. By default, the message consumed is ACKed only when the execution of the flow receiving the message completes successfully. If instead, an error occurs during the execution of the flow, the session is recovered and the message is redelivered according to the recoverStrategy. For more information regarding a Message ACK, see [How To Handle Message Acknowledgement](https://docs.mulesoft.com/amqp-connector/1.8/amqp-ack). ## Configure Message Throughput When extra processing power is needed, the AMQP Listener allows you to configure the `numberOfConsumers` that a given listener uses to consume messages concurrently. By default, each listener uses four consumers that produce the messages concurrently, each using a separate channel. Since each consumer waits for a message to be processed, that means that you can have a maximum of four messages in-flight at the same time. If you need to increase the concurrent message processing, just increase the `numberOfConsumers` in the Listener. Each consumer uses a different channel. ## MIME Types and Encoding The AMQP connector automatically determines a message’s MIME type (`contentType`) based on the `contentType` property of the message. However, there are cases where this process is not enough, and you need first-hand knowledge of a message’s content. In such cases, you can force that content type to a particular value by using the `contentType` parameter. The same process works for encoding. By default, the connector assumes that the runtime’s default encoding matches the one in the message if no other information is provided. You can set this by using the `inboundEncoding` parameter. ## Declare a Queue in the AMQP Listener By default, the `consume` operation fails when the defined queue does not exist with an `AMQP:QUEUE_NOT_FOUND` error. For cases where the queue has to be declared, a definition for the entity should be referenced or defined inline so that the queue is declared. ```xml ``` Notice that in the definition of the queue, a binding can be created using the parameter `exchangeToBind`. The queue can also be defined as a high level element: ```xml ``` ## How to Avoid Changing the AMQP Topography You can set the `createFallbackQueue` global config to prevent changes to the AMQP topography resulting from the definition of fallback queues. ## Reply to Incoming Messages When an incoming AMQP message declares a REPLY\_TO property, the AMQP Listener automatically produces a response when the message is processed successfully, meaning that no error occurs during the flow execution. In that case, when the flow is completed, a response is published to the exchange specified in the processed message property. In case of error, the recover strategy is applied and a response is not sent to the REPLY\_TO property until the message is successfully processed. ## Recover Strategy in Case of Error In case an error occurs, the `recoverStrategy` is applied. By default, the `recoverStrategy` is set to `REQUEUE`, which means that the message is sent to the `queue` where it was consumed from, and another AMQP consumer can potentially retrieve it. In case `NO_REQUEUE` is set, for example: ```xml ``` The message is directly sent to the same consumer that retrieved it. `NONE` as in the defined `recoverStrategy` does not perform any action. ## Cluster Environment By default, the AMQP listener receives messages from every node in a clustered environment. As in other sources, this can be modified using the `primaryNodeOnly` attribute. ```xml ``` ## See Also - [Consume Messages](https://docs.mulesoft.com/amqp-connector/1.8/amqp-consume) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # Listen For New Messages > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The Listener source in Anypoint Connector for AMQP (AMQP Connector) provides the ability to consume messages as they arrive into an AMQP queue. ## Listen for New Messages The syntax to listen for new messages from a queue is: ```xml ``` The source listens for new messages in the queue identified by the `queueName` parameter, returning a `AmqpMessage` each time a AMQP message is available in the queue. The `AmqpMessage` has: - The message’s content as its payload. - The message’s metadata in the message attributes. By default, the message consumed is ACKed only when the execution of the flow receiving the message completes successfully. If instead, an error occurs during the execution of the flow, the session is recovered and the message is redelivered according to the recoverStrategy. For more information regarding a Message ACK, see [How To Handle Message Acknowledgement](https://docs.mulesoft.com/amqp-connector/latest/amqp-ack). ## Configure Message Throughput When extra processing power is needed, the AMQP Listener allows you to configure the `numberOfConsumers` that a given listener uses to consume messages concurrently. By default, each listener uses four consumers that produce the messages concurrently, each using a separate channel. Since each consumer waits for a message to be processed, that means that you can have a maximum of four messages in-flight at the same time. If you need to increase the concurrent message processing, just increase the `numberOfConsumers` in the Listener. Each consumer uses a different channel. ## MIME Types and Encoding The AMQP connector automatically determines a message’s MIME type (`contentType`) based on the `contentType` property of the message. However, there are cases where this process is not enough, and you need first-hand knowledge of a message’s content. In such cases, you can force that content type to a particular value by using the `contentType` parameter. The same process works for encoding. By default, the connector assumes that the runtime’s default encoding matches the one in the message if no other information is provided. You can set this by using the `inboundEncoding` parameter. ## Declare a Queue in the AMQP Listener By default, the `consume` operation fails when the defined queue does not exist with an `AMQP:QUEUE_NOT_FOUND` error. For cases where the queue has to be declared, a definition for the entity should be referenced or defined inline so that the queue is declared. ```xml ``` Notice that in the definition of the queue, a binding can be created using the parameter `exchangeToBind`. The queue can also be defined as a high level element: ```xml ``` ## How to Avoid Changing the AMQP Topography You can set the `createFallbackQueue` global config to prevent changes to the AMQP topography resulting from the definition of fallback queues. ## Reply to Incoming Messages When an incoming AMQP message declares a REPLY\_TO property, the AMQP Listener automatically produces a response when the message is processed successfully, meaning that no error occurs during the flow execution. In that case, when the flow is completed, a response is published to the exchange specified in the processed message property. In case of error, the recover strategy is applied and a response is not sent to the REPLY\_TO property until the message is successfully processed. ## Recover Strategy in Case of Error In case an error occurs, the `recoverStrategy` is applied. By default, the `recoverStrategy` is set to `REQUEUE`, which means that the message is sent to the `queue` where it was consumed from, and another AMQP consumer can potentially retrieve it. In case `NO_REQUEUE` is set, for example: ```xml ``` The message is directly sent to the same consumer that retrieved it. `NONE` as in the defined `recoverStrategy` does not perform any action. ## Cluster Environment By default, the AMQP listener receives messages from every node in a clustered environment. As in other sources, this can be modified using the `primaryNodeOnly` attribute. ```xml ``` ## See Also - [Consume Messages](https://docs.mulesoft.com/amqp-connector/latest/amqp-consume) --- product: AMQP Connector version: 1.8 --- # Publish Messages > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The `publish` operation enables you to create a new AMQP message and send it to the specified exchange. You can then configure not only the content of the message, but also all the headers, the properties, and the envelope in the AMQP message. ## Send a Message to an Exchange When used in its default form, the connector will publish whatever is in the message payload: ```xml ``` But what happens if the payload is not in the correct format, and you actually need to make a transformation? You could place a DataWeave transformation before the `publish` operation, but that would cause the message payload to change and impact the operation placed after the `publish` operation. To avoid this undesired impact, you can now place the transformation inside the `publish` operation: ```xml ``` Now, the transformation can be used for generating the content that will be published, without producing a side effect on the message in transit. ## Override or Set the Routing Keys of the Message You may need to set or override the routing key of the property. The routing key is represented by a property of an AMQP message: ```xml ``` ## Declare a Reply Destination For the cases where you need an asynchronous reply to the message being sent, the AMQP `publish` operation allows us to declare any `reply-to` destination. This destination will be communicated as an AMQP message Property to the consumer of the Message. It represents the destination where we should expect a reply to be sent. To declare the `reply-to` destination, we add it to the message properties: ```xml ``` ## Request Confirms from the Broker If you need that the broker confirms a publish operation, you can set the `requestBrokerConfirms` parameter. Setting this parameter, the channel in the publish operation is set in confirm mode and the connector will expect a `basic.ack` from the broker. The parameter can be set in the global publisher configuration or at the operation level. ```xml ``` In case no confirmation arrives, an `AMQP:PUBLISHING` error will be raised indicating that the broker failed to agree on confirming messages. ## Returned Messages Handling The connector supports the mandatory and immediate publication flags. If a message sent with this connector cannot be delivered, the AMQP broker returns it asynchronously. The AMQP connector offers the possibility of dispatching these returned messages to an exchange for custom processing. You can define the endpoint in charge of handling returned messages at the connector level. Here is an example: ```xml ``` ## Declare an Exchange in the Publish Operation By default, the `publish` operation will fail in case the defined exchange does not exist with an `AMQP:EXCHANGE_NOT_FOUND` error. For cases where the exchange has to be declared, a definition for the entity should be referenced or inline defined so that the exchange is declared. ```xml ``` The exchange can also be defined as a high level element: ```xml ``` ## Avoid Changing the AMQP Topography You can set the `createFallbackExchange` global config to prevent changes to the AMQP topography resulting from the definition of fallback exchanges, see [Avoid Changing the AMQP Topography](https://docs.mulesoft.com/amqp-connector/1.8/amqp-topography). ## Propagate the Correlation ID The `publish` operation allows you to configure the `correlationId` for the outgoing Message. First you need to configure whether or not you want to send the `correlationId` when publishing the Message using the `sendCorrelationId` parameter. This parameter can be set to `ALWAYS` (always send the header), `NEVER` (never send the header) or `AUTO` (the default, use the application configuration). Then, you can either use the `correlationId` of the Event that is sending the Message, or you can configure your own custom `correlationId` in the message builder: ```xml ``` ## See Also [Listen For A Reply](https://docs.mulesoft.com/amqp-connector/1.8/amqp-publish-consume) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # Publish Messages > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The `publish` operation enables you to create a new AMQP message and send it to the specified exchange. You can then configure not only the content of the message, but also all the headers, the properties, and the envelope in the AMQP message. ## Send a Message to an Exchange When used in its default form, the connector will publish whatever is in the message payload: ```xml ``` But what happens if the payload is not in the correct format, and you actually need to make a transformation? You could place a DataWeave transformation before the `publish` operation, but that would cause the message payload to change and impact the operation placed after the `publish` operation. To avoid this undesired impact, you can now place the transformation inside the `publish` operation: ```xml ``` Now, the transformation can be used for generating the content that will be published, without producing a side effect on the message in transit. ## Override or Set the Routing Keys of the Message You may need to set or override the routing key of the property. The routing key is represented by a property of an AMQP message: ```xml ``` ## Declare a Reply Destination For the cases where you need an asynchronous reply to the message being sent, the AMQP `publish` operation allows us to declare any `reply-to` destination. This destination will be communicated as an AMQP message Property to the consumer of the Message. It represents the destination where we should expect a reply to be sent. To declare the `reply-to` destination, we add it to the message properties: ```xml ``` ## Request Confirms from the Broker If you need that the broker confirms a publish operation, you can set the `requestBrokerConfirms` parameter. Setting this parameter, the channel in the publish operation is set in confirm mode and the connector will expect a `basic.ack` from the broker. The parameter can be set in the global publisher configuration or at the operation level. ```xml ``` In case no confirmation arrives, an `AMQP:PUBLISHING` error will be raised indicating that the broker failed to agree on confirming messages. ## Returned Messages Handling The connector supports the mandatory and immediate publication flags. If a message sent with this connector cannot be delivered, the AMQP broker returns it asynchronously. The AMQP connector offers the possibility of dispatching these returned messages to an exchange for custom processing. You can define the endpoint in charge of handling returned messages at the connector level. Here is an example: ```xml ``` ## Declare an Exchange in the Publish Operation By default, the `publish` operation will fail in case the defined exchange does not exist with an `AMQP:EXCHANGE_NOT_FOUND` error. For cases where the exchange has to be declared, a definition for the entity should be referenced or inline defined so that the exchange is declared. ```xml ``` The exchange can also be defined as a high level element: ```xml ``` ## Avoid Changing the AMQP Topography You can set the `createFallbackExchange` global config to prevent changes to the AMQP topography resulting from the definition of fallback exchanges, see [Avoid Changing the AMQP Topography](https://docs.mulesoft.com/amqp-connector/latest/amqp-topography). ## Propagate the Correlation ID The `publish` operation allows you to configure the `correlationId` for the outgoing Message. First you need to configure whether or not you want to send the `correlationId` when publishing the Message using the `sendCorrelationId` parameter. This parameter can be set to `ALWAYS` (always send the header), `NEVER` (never send the header) or `AUTO` (the default, use the application configuration). Then, you can either use the `correlationId` of the Event that is sending the Message, or you can configure your own custom `correlationId` in the message builder: ```xml ``` ## See Also [Listen For A Reply](https://docs.mulesoft.com/amqp-connector/latest/amqp-publish-consume) --- product: AMQP Connector version: 1.8 --- # Troubleshooting AMQP Connector > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To troubleshoot Anypoint Connector for AMQP (AMQP Connector), become familiar with the information about enabling verbose logging and interpreting commonly thrown messages. ## Enable Verbose Logging To get a better understanding of why an application’s interaction with the AMQP Connector is failing, temporarily enable verbose logging for AMQP connector. Remember to always disable the enhanced verbosity after troubleshooting because it affects your Mule application performance. To enable verbose logging in the configuration file: 1. Access Anypoint Studio and navigate to the **Package Explorer** view. 2. Open your application’s project. 3. Open the `src/main/resources` path folder. 4. Open the `log4j2.xml` file inside the folder. 5. Add an `` tag inside the `` tag: ```xml ... ... ``` 6. Save your application changes. 7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule Application**. ## Understand Common Throws Here is a list of common throw messages and how to interpret them: - AMQP:CONNECTIVITY The connection is no longer valid. It is disposed of, but you can apply a reconnection policy if defined in the application setup. - AMQP:CONSUMING An error occurred while consuming messages and could not be identified. - AMQP:CREATION\_NOT\_ALLOWED The queue or exchange does not exist, and the disableCreationOfFallbackQueues or disableCreationOfFallbackExchanges parameters is set. - AMQP:QUEUE\_NOT\_FOUND The queue defined does not exist, and no fallbackQueueDefinition is provided. - AMQP:RETRY\_EXHAUSTED The maximum number of retries for the operation is reached. - AMQP:TIMEOUT The timeout for the requested operation is exceeded. - AMQP:ILLEGAL\_BODY The message body is invalid, for example, a null body. - AMQP:UNROUTABLE\_MESSAGE The message could not be routed, either because it could not be immediately delivered or because there are no queue bounds to the exchange depending on the exchange configuration in the broker. - AMQP:PUBLISHING An error occurred while publishing messages and could not be identified. - AMQP:PUBLISHING\_CONSUMING A generic error for publishing-consuming, which could not be identified. - AMQP:EXCHANGE\_NOT\_FOUND The exchange defined does not exist, and no fallbackExchangeDefinition exists. - AMQP:EXCHANGE\_DECLARATION An exception occurred during an exchange declaration. - AMQP:BLOCKED\_BROKER An error occurred while sending a message because the broker is blocked as it ran out of resources. - AMQP:ACKNOWLEDGING A generic error for acknowledging, which could not be identified. - AMQP:DELIVER\_TAG\_NOT\_FOUND The deliver tag to acknowledge was not found by the broker. - AMQP:REJECTING A generic error for rejecting, which could not be identified. - AMQP:REQUEUE A generic error on requeue process. - AMQP:NO\_CHANNEL\_AVAILABLE A generic error when the channel is not available. ## See Also - [AMQP Connector Reference](https://docs.mulesoft.com/amqp-connector/1.8/amqp-documentation) - [Salesforce Help](https://help.salesforce.com) - [Known Issues](https://help.salesforce.com/s/issues) --- product: AMQP Connector version: 1.9 is-latest-version: true --- # Troubleshooting AMQP Connector > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To troubleshoot Anypoint Connector for AMQP (AMQP Connector), become familiar with the information about enabling verbose logging and interpreting commonly thrown messages. ## Enable Verbose Logging To get a better understanding of why an application’s interaction with the AMQP Connector is failing, temporarily enable verbose logging for AMQP connector. Remember to always disable the enhanced verbosity after troubleshooting because it affects your Mule application performance. To enable verbose logging in the configuration file: 1. Access Anypoint Studio and navigate to the **Package Explorer** view. 2. Open your application’s project. 3. Open the `src/main/resources` path folder. 4. Open the `log4j2.xml` file inside the folder. 5. Add an `` tag inside the `` tag: ```xml ... ... ``` 6. Save your application changes. 7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule Application**. ## Understand Common Throws Here is a list of common throw messages and how to interpret them: - AMQP:CONNECTIVITY The connection is no longer valid. It is disposed of, but you can apply a reconnection policy if defined in the application setup. - AMQP:CONSUMING An error occurred while consuming messages and could not be identified. - AMQP:CREATION\_NOT\_ALLOWED The queue or exchange does not exist, and the disableCreationOfFallbackQueues or disableCreationOfFallbackExchanges parameters is set. - AMQP:QUEUE\_NOT\_FOUND The queue defined does not exist, and no fallbackQueueDefinition is provided. - AMQP:RETRY\_EXHAUSTED The maximum number of retries for the operation is reached. - AMQP:TIMEOUT The timeout for the requested operation is exceeded. - AMQP:ILLEGAL\_BODY The message body is invalid, for example, a null body. - AMQP:UNROUTABLE\_MESSAGE The message could not be routed, either because it could not be immediately delivered or because there are no queue bounds to the exchange depending on the exchange configuration in the broker. - AMQP:PUBLISHING An error occurred while publishing messages and could not be identified. - AMQP:PUBLISHING\_CONSUMING A generic error for publishing-consuming, which could not be identified. - AMQP:EXCHANGE\_NOT\_FOUND The exchange defined does not exist, and no fallbackExchangeDefinition exists. - AMQP:EXCHANGE\_DECLARATION An exception occurred during an exchange declaration. - AMQP:BLOCKED\_BROKER An error occurred while sending a message because the broker is blocked as it ran out of resources. - AMQP:ACKNOWLEDGING A generic error for acknowledging, which could not be identified. - AMQP:DELIVER\_TAG\_NOT\_FOUND The deliver tag to acknowledge was not found by the broker. - AMQP:REJECTING A generic error for rejecting, which could not be identified. - AMQP:REQUEUE A generic error on requeue process. - AMQP:NO\_CHANNEL\_AVAILABLE A generic error when the channel is not available. ## See Also - [AMQP Connector Reference](https://docs.mulesoft.com/amqp-connector/latest/amqp-documentation) - [Salesforce Help](https://help.salesforce.com) - [Known Issues](https://help.salesforce.com/s/issues)