Contact Us 1-800-596-4880

Anypoint MQ Connector Reference — Mule 3

About Global Element Properties

The General tab fields are:

Studio Field Description

Name

Configuration name.

Required: Yes
Default: None

Client Mode

Specifies whether the Anypoint MQ connector uses an improved HTTP client (SYNC, the default) or a deprecated HTTP client provided by the Mule Runtime (MULE). The improved HTTP client can be either synchronous or asynchronous.

Possible values:

  • ASYNC - Require the MQ client to use an asynchronous HTTP client library.

  • SYNC(Default) - Require the MQ client to use a synchronous HTTP client library. This value is recommended when using MQ threading profiles.

  • MULE (Deprecated) - The HTTP connector used to communicate with MQ is the Grizzly library provided by the Mule Runtime.

Required: No
Default: SYNC

Provider:
Use Provider Config

Sets a provider configuration for the current app consisting of the URL, Client App ID, and Client Secret.

Required: Yes
Default: None

URL

Region URL shown in Anypoint Platform.

Specify the URL for the region you want your MQ queues and exchanges to reside. See MQ Regions. Substitute the region name in this URL:

https://REGION_NAME.anypoint.mulesoft.com/api/v1

Required: Yes
Default: None

Client App ID

From Anypoint Platform > MQ > Client Apps. Click the app and copy the Client App ID value.

Required: Yes
Default: None

Client Secret

From Anypoint Platform > MQ > Client Apps. Click the app and copy the Client Secret value.

Required: Yes
Default: None

Use Global Provider Config

Sets the URL, Client App ID, and Client Secret for all apps.

Required: No
Default: None

Basic Settings:
Max Redelivery

Number of redeliveries to try in case a message fails. -1 indicates that Anypoint MQ retry indefinitely. If set to the default value of -1, this parameter does not appear in the XML flow.

Required: No
Default: -1

Acknowledgement Mode

(Basic Settings menu in Studio) Defines how the Anypoint MQ messages are acknowledged when the message are removed from being inflight messages. If set to the default value of AUTO, this parameter does not appear in the XML flow.

Possible values are:

  • AUTO (Default)- Messages are acknowledged or negatively acknowledged depending on whether or not exceptions occur. See Acknowledgement Mode for more information.

  • MANUAL - Messages are acknowledged using a custom ACK message processor.

  • NONE - Messages are acknowledged and removed as soon as they are received.

Required: No
Default: AUTO

Acknowledgement Timeout

(Basic Settings menu in Studio) When you take an Anypoint MQ message from a queue, the broker puts it in flight, and the message remains in that state until the ACK is performed (application reads the message and Anypoint MQ deletes it), or the Acknowledgement Timeout is reached. If ACK is performed, then the message is removed from the queue, if Acknowledgement Timeout is reached, the message returns to the queue. If set to the default value of 0, this parameter does not appear in the XML flow.

Required: No
Default: 0

Polling Time

(Basic Settings menu in Studio) Maximum time in milliseconds to wait for the expected message or messages. If set to the default value of 10000 (10 seconds), this parameter does not appear in the XML flow.

Required: No
Default: 10000 (10 seconds)

Threading Profile Settings

Define threading profile behavior or use default worker threading profile. See Tuning Performance. The threading profile options let you optimize connector performance for use with Anypoint MQ.

Note: After setting the threading profile fields, save your project, click Configuration XML, change the name of the threading profile statement to start with anypoint-mq, and switch the order of the statement with the anypoint-mq:provider statement in the anypoint-mq:config block. The location can be N. Virginia (us-east-1), Ireland (eu-west-1), Singapore (ap-southeast-1), Sydney (ap-southeast-2), or Oregon (us-west-2).

This example shows how the finished statements may appear:

<anypoint-mq:config name="Anypoint_MQ_Configuration" doc:name="Anypoint MQ Configuration">
  <anypoint-mq:provider url="https://mq-us-east-1.anypoint.mulesoft.com/api/v1" clientId="ID" clientSecret="SECRET"/>
  <anypoint-mq:worker-threading-profile maxThreadsActive="42" maxThreadsIdle="42" threadTTL="4200" threadWaitTimeout="-1"/>
</anypoint-mq:config>

Required: No
Default: None

Use custom worker threading profile

Required: No
Default: None

Max Active Threads

The maximum number of threads to use. See Tuning Performance.

Required: No
Default: None

Max Idle Threads

The maximum number of idle or inactive threads that can be in the pool before they are destroyed. See Tuning Performance. The thread pool does not grow from Max Idle Threads towards Max Active Threads unless the queue is completely filled up.

Required: No
Default: None

Thread TTL

Thread time to live duration.

Required: No
Default: None

Pool Exhausted Action

When the maximum pool size or queue size is bounded, this value determines how to handle incoming tasks.

Possible values are:

  • WAIT - Wait until a thread becomes available; don’t use this value if the minimum number of threads is zero, in which case a thread may never become available.

  • DISCARD - Throw away the current request and return.

  • DISCARD_OLDEST - Throw away the oldest request and return.

  • ABORT - Throw a RuntimeException.

  • RUN - The default; the thread making the execute request runs the task itself, which helps guard against lockup.

Required: No
Default: None

Thread Wait Timeout

Thread wait timeout in milliseconds.

Required: No
Default: None

Max Buffer Size

Max buffer size.

Required: No
Default: None

About Common XML Elements

XML Element Description

doc:name

Configuration name.

Required: Yes
Default: None
XML Example:

<anypoint-mq:config name="Anypoint_MQ_Configuration" doc:name="Anypoint MQ Configuration">

clientMode

Specifies whether the Anypoint MQ connector uses an improved HTTP client (SYNC, the default) or a deprecated HTTP client provided by the Mule Runtime (MULE). The improved HTTP client can be either synchronous or asynchronous.

Possible values:

  • ASYNC - Require the MQ client to use an asynchronous HTTP client library.

  • SYNC(Default) - Require the MQ client to use a synchronous HTTP client library. This value is recommended when using MQ threading profiles.

  • MULE (Deprecated) - The HTTP connector used to communicate with MQ is the Grizzly library provided by the Mule Runtime.

Required: No
Default: SYNC XML Example:

<anypoint-mq:config name="Anypoint_MQ_Configuration" clientMode="SYNC" ... />

provider

Sets a provider configuration for the current app consisting of the URL, Client App ID, and Client Secret.

Required: Yes
Default: None
XML Example:

<anypoint-mq:provider url="..." clientId="..." clientSecret="..."/>

url

Region URL shown in Anypoint Platform.

Possible values are:

  • US East (N. Virginia): https://mq-us-east-1.anypoint.mulesoft.com/api/v1

  • US West (Oregon): https://mq-us-west-2.anypoint.mulesoft.com/api/v1

  • EU (Ireland): https://mq-eu-west-1.anypoint.mulesoft.com/api/v1

  • Asia Pacific (Singapore): https://mq-ap-southeast-1.anypoint.mulesoft.com/api/v1

  • Asia Pacific (Sydney): https://mq-ap-southeast-2.anypoint.mulesoft.com/api/v1

FIFO queues can reside in US East, US West, EU Ireland and Sydney.

Required: Yes
Default: None

XML Example:

<anypoint-mq:provider url="https://mq-us-east-1.anypoint.mulesoft.com/api/v1" .../>

clientId

From Anypoint Platform > MQ > Client Apps. Click the app and copy the Client App ID value.

Required: Yes
Default: None
XML Example:

<anypoint-mq:provider url="..." clientId="<id>" clientSecret="..."/>

clientSecret

From Anypoint Platform > MQ > Client Apps. Click the app and copy the Client Secret value.

Required: Yes
Default: None
XML Example:

<anypoint-mq:provider url="..." clientId="..." clientSecret="<secret>"/>

provider-ref

Sets the URL, Client App ID, and Client Secret for all apps.

Required: No
Default: None
XML Example:

<anypoint-mq:config name="..." doc:name="..." maxRedelivery="..." acknowledgementMode="..."
 acknowledgementTimeout="..." pollingTime="..." provider-ref="Provider_Settings">

maxRedelivery

Number of redeliveries to try in case a message fails. -1 indicates that Anypoint MQ retry indefinitely. If set to the default value of -1, this parameter does not appear in the XML flow.

Required: No
Default: -1
XML Example:

<anypoint-mq:config name="..." doc:name="..." maxRedelivery="10" ... >

acknowledgementMode

Defines how the Anypoint MQ messages are acknowledged when the message are removed from being inflight messages. If set to the default value of AUTO, this parameter does not appear in the XML flow.

Possible values are:

  • AUTO (Default)- Messages are acknowledged or negatively acknowledged depending on whether or not exceptions occur. See Acknowledgement Mode for more information.

  • MANUAL - Messages are acknowledged using a custom ACK message processor.

  • NONE - Messages are acknowledged and removed as soon as they are received.

Required: No
Default: AUTO
XML Example:

<anypoint-mq:config ... acknowledgementMode="NONE" acknowledgementTimeout="42" ...>

acknowledgementTimeout

The amount of time in milliseconds to take an Anypoint MQ message from a queue, the broker puts it in flight, and the message remains in that state until the ACK is performed (application reads the message and Anypoint MQ deletes it), or the Acknowledgement Timeout is reached. If ACK is performed, then the message is removed from the queue, if Acknowledgement Timeout is reached, the message returns to the queue. If set to the default value of 0, this parameter does not appear in the XML flow.

Required: No
Default: 0
XML Example:

<anypoint-mq:config ... acknowledgementMode="NONE" acknowledgementTimeout="42" ...>

pollingTime

Maximum time in milliseconds to wait for the expected message or messages. If set to the default value of 10000 (10 seconds), this parameter does not appear in the XML flow.

Required: No
Default: 10000 (10 seconds)
XML Example:

<anypoint-mq:config name="..." doc:name="..." pollingTime="99000">

worker-threading-profile

Define threading profile behavior or use default worker threading profile. See Tuning Performance. The threading profile options let you optimize connector performance for use with Anypoint MQ.

Note: After configuring worker-threading-profile, change the name of the statement to start with anypoint-mq, and switch the order of the statement with the anypoint-mq:provider statement in the anypoint-mq:config block.

This example shows how the finished statements should appear:

<anypoint-mq:config name="Anypoint_MQ_Configuration" doc:name="Anypoint MQ Configuration">
  <anypoint-mq:provider url="https://mq-us-east-1.anypoint.mulesoft.com/api/v1" clientId="ID" clientSecret="SECRET"/>
  <anypoint-mq:worker-threading-profile maxThreadsActive="42" maxThreadsIdle="42" threadTTL="4200" threadWaitTimeout="-1"/>
</anypoint-mq:config>

Required: No
Default: None
XML Example:

<http:worker-threading-profile maxThreadsActive="..." maxThreadsIdle="..."
threadTTL="..." poolExhaustedAction="..." threadWaitTimeout="..."
maxBufferSize="..."/>

maxThreadsActive

The maximum number of threads to use. See Tuning Performance.

Required: No
Default: None
XML Example:

<http:worker-threading-profile maxThreadsActive="42" maxThreadsIdle="42"
threadTTL="..." poolExhaustedAction="..." threadWaitTimeout="..."
maxBufferSize="..."/>

maxThreadsIdle

The maximum number of idle or inactive threads that can be in the pool before they are destroyed. See Tuning Performance. The thread pool does not grow from Max Idle Threads towards Max Active Threads unless the queue is completely filled up.

Required: No
Default: None
XML Example:

<http:worker-threading-profile maxThreadsActive="42" maxThreadsIdle="42"
threadTTL="..." poolExhaustedAction="..." threadWaitTimeout="..."
maxBufferSize="..."/>

threadTTL

Thread time to live duration in milliseconds.

Required: No
Default: None
XML Example:

<http:worker-threading-profile maxThreadsActive="..." maxThreadsIdle="..."
threadTTL="1000" poolExhaustedAction="..." threadWaitTimeout="..."
maxBufferSize="..."/>

poolExhaustedAction

When the maximum pool size or queue size is bounded, this value determines how to handle incoming tasks.

Possible values are:

  • WAIT - Wait until a thread becomes available; don’t use this value if the minimum number of threads is zero, in which case a thread may never become available.

  • DISCARD - Throw away the current request and return.

  • DISCARD_OLDEST - Throw away the oldest request and return.

  • ABORT - Throw a RuntimeException.

  • RUN - The default; the thread making the execute request runs the task itself, which helps guard against lockup.

Required: No
Default: RUN
XML Example:

<http:worker-threading-profile maxThreadsActive="..." maxThreadsIdle="..."
threadTTL="..." poolExhaustedAction="DISCARD_OLDEST" threadWaitTimeout="..."
maxBufferSize="..."/>

threadWaitTimeout

Thread wait timeout in milliseconds.

Type: Long
Required: No
Default: None
XML Example:

<http:worker-threading-profile maxThreadsActive="..." maxThreadsIdle="..."
threadTTL="..." poolExhaustedAction="..." threadWaitTimeout="1000"
maxBufferSize="..."/>

maxBufferSize

Max buffer size.

Type: Integer
Required: No
Default: None
XML Example:

<http:worker-threading-profile maxThreadsActive="..." maxThreadsIdle="..."
threadTTL="..." poolExhaustedAction="..." threadWaitTimeout="..."
maxBufferSize="1000"/>

About Basic XML Elements

XML Element Description

anypoint-mq:<operation>

Operation that this connector instance performs.

Possible values:

  • publish - Send a message to a queue or message exchange.

  • consume - Consume a message from a queue.

  • ack - Acknowledge a message, that is, accept a message and delete the message.

  • nack - Negatively acknowledge a message, that is, do not accept a message and return the message to the queue.

Required: Yes
Default: None
XML Example:

<flow name="demoFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <anypoint-mq:consume config-ref="Anypoint_MQ_Configuration" doc:name="Anypoint MQ"
    destination="MyQ" acknowledgementMode="NONE" acknowledgementTimeout="42" pollingTime="99000">
    </anypoint-mq:consume>
</flow>

About the Studio TLS/SSL and Proxy Tabs

The TSL/SSL and Proxy tabs share the same information as the HTTP Connector.

About the Studio Prefetch Tab

Lets you set the number of messages to receive at once when asking for messages. The response can contain fewer messages than this number depending on the Polling Time (pollingTime in XML) setting.

When you subscribe a flow to an Anypoint MQ queue, the flow pool regularly polls the queue looking for messages. This operation can be very time consuming. In order to avoid delays, prefetch was introduced. This is a component placed between the flow and the Anypoint MQ queue that polls the queue regularly, but without processing the pooled messages. You can change these values depending on your site’s performance and use case needs.

Note: Only global prefetch is supported; however prefetch within the MQ connector’s configuration (anypoint-mq:config) is not supported.

The Prefetch tab fields are:

Value Description

Fetch Size

Number of messages to prefetch.

Fetch Timeout

Maximum duration in milliseconds to wait for the required amount of messages. When this time elapses, the response is sent with as many messages as taken during the period.

Frequency

The duration in milliseconds to execute the retrieve operation when the prefetch queue is not empty.

Fetch Retry Attempts

(v1.3.0 and later) Number of times to retry prefetching in case of an error. Default value is -1 (infinite).

Fetch Retry Wait Time

(v1.3.0 and later) The duration in milliseconds to wait after a prefetching error before retrying.

Fetch Size Notes:

  • For best performance, set Fetch Size to 10 (maximum value) and reduce Frequency to increase the polling time and the resulting dequeuing of transactions per second (TPS). You can increase Fetch Timeout if message processing is slow. For example, if processing takes 5 seconds, set the Fetch Timeout to at least double this time (10000 milliseconds).

  • If Fetch Size is greater than 1, multiple messages are requested at the same time. This has the effect of launching separate messages though the Mule flow, potentially concurrently, depending on the Mule worker thread configuration (see Tuning Performance for thread configuration information).

  • Fetch Size does not guarantee messages process in parallel, some messages may, others do not.

Apart from these performance-related parameters, it is important to properly configure the Acknowledgement Mode.

The equivalent XML for the Prefetch default values is:

<anypoint-mq:prefetch fetchSize="10" fetchTimeout="1000" frequency="5000"/>

About Basic Settings

Studio Field Description

Operation

Operation that this connector instance performs.

Possible values:

  • publish - Send a message to a queue or message exchange.

  • consume - Consume a message from a queue.

  • ack - Acknowledge a message, that is, accept a message and delete the message.

  • nack - Negatively acknowledge a message, that is, do not accept a message and return the message to the queue.

Required: Yes
Default: None

About Publisher Settings

Studio Field Description

Destination

Queue or message exchange name.

Required: Yes
Default: None

Message ID

Optional ID of a message to publish. When publishing to FIFO queues, if you specify a custom Message ID and the Message ID is the same on multiple messages, the messages with the same Message ID cannot be redelivered. For applications such as those used in transactional use cases where messages need to be processed exactly once, Anypoint MQ supports exactly once delivery of messages when messages are published to FIFO queues. FIFO queues supports deduplication of messages. For example, if you retry sending a message with the same message ID within the 5-minute deduplication interval to a FIFO queue, Anypoint MQ guarantees the messages with the same message ID are retrieved and processed exactly once by the subscriber. When building applications requiring this feature on Anypoint Studio, you can set the message ID in publisher settings inside Anypoint MQ connector. If a message ID is not explicitly set, MQ auto generates a unique message ID for each message that’s sent to a queue.

Required: No
Default: None

Send Outbound Properties

Send properties when publishing.

Required: Yes
Default: Checked

Send Content Type

Send content type when publishing.

Required: Yes
Default: Checked

Property

Optional property content to set for publish.

Required: No
Default: None

Value

Optional value content to set for publish.

Required: No
Default: None

About Consumer Settings

Studio Field Description

Destination

Queue name.

Required: Yes
Default: None

Acknowledgement Mode

If you use the Anypoint MQ connector as a message processor, the operations are MANUAL (default) or NONE. If the MQ connector is used as an entry point, the mode options are From configuration (Default), AUTO, MANUAL, or NONE. For more information, see Anypoint MQ Acknowledgement Mode. Note: This value overrides the Acknowledgement Mode field in the Global Elements Properties Basic Settings.

Required: No
Default: MANUAL if connector is a message processor, or From configuration if connector is an entry point

Acknowledgement Timeout

Duration in milliseconds until the acknowledgement mode times out. Note: This value overrides the Acknowledgement Timeout field in the Global Elements Properties Basic Settings.

Polling Time

Duration in milliseconds that the MQ connector polls the queue or message exchange for messages. Note: This value overrides the Polling Time field in the Global Elements Properties Basic Settings. The default is 10000 milliseconds (10 seconds).

Reconnection Wait Time

Duration in milliseconds for how long to wait before MQ attempts to re-establish a connection to the MQ backend server. The default is 3000 milliseconds (3 seconds).

Reconnection Attempts

Number of times MQ should attempt to re-establish a connection to the MQ backend server. -1 means try forever.

About Subscriber Settings

Studio Field Description

Destination

Queue name.

Required: Yes
Default: None

Acknowledgement Mode

When the MQ connector is used as an entry point, the mode options are From configuration (Default), AUTO, MANUAL, or NONE.

Notes:

  • This value overrides the Acknowledgement Mode field in the Global Elements Properties Basic Settings.

  • The default value automatically ACKs every message sent to the destination queue.

Required: No
Default: From configuration if connector is an entry point

Acknowledgement Timeout

Duration in milliseconds until the acknowledgement mode times out. Note: This value overrides the Acknowledgement Timeout field in the Global Elements Properties Basic Settings.

Polling Time

Duration in milliseconds that the MQ connector polls a queue for messages. Note: This value overrides the Polling Time field in the Global Elements Properties Basic Settings.

Reconnection Wait Time

Duration in milliseconds for how long to wait before MQ attempts to re-establish a connection to the MQ backend server. The default is 3000 milliseconds (3 seconds).

Reconnection Attempts

Number of times MQ should attempt to re-establish a connection to the MQ backend server. -1 means try forever.

About Publish XML Elements

XML Element Description

destination

Queue or message exchange name.

Required: Yes
Default: None
XML Example:

<flow name="demoFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <anypoint-mq:consume config-ref="Anypoint_MQ_Configuration"
     doc:name="Anypoint MQ" destination="MyQ"
     acknowledgementMode="NONE" acknowledgementTimeout="42"
     pollingTime="99000">
    </anypoint-mq:consume>
</flow>

messageId

Optional ID of a message to publish. When publishing to FIFO queues, if you specify a custom Message ID and the Message ID is the same on multiple messages, the messages with the same Message ID will not be redelivered. For applications such as those used in transactional use cases where messages need to be processed exactly once, Anypoint MQ supports exactly once delivery of messages when messages are published to FIFO queues. FIFO queues supports deduplication of messages. For example, if you retry sending a message with the same message ID within the 5-minute deduplication interval to a FIFO queue, Anypoint MQ guarantees the messages with the same message ID are retrieved and processed exactly once by the subscriber. When building applications requiring this feature on Anypoint Studio, you can set the message ID in publisher settings inside Anypoint MQ connector. If a message ID is not explicitly set, MQ auto generates a unique message ID for each message that’s sent to a queue.

Required: No
Default: None
XML Example:

<flow name="demoFlow">
  <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
  <anypoint-mq:publish config-ref="Anypoint_MQ_Configuration" doc:name="Anypoint MQ" destination="QUEUEorMsgEx">
      <anypoint-mq:message-builder messageId="4254a4254b4254c4254"
       sendContentType="false" sendOutboundProperties="false">
          <anypoint-mq:properties>
              <anypoint-mq:property propertyName="THisisAProperty" value="4254"/>
          </anypoint-mq:properties>
      </anypoint-mq:message-builder>
  </anypoint-mq:publish>
</flow>

sendOutboundProperties

Send properties when publishing.

Required: Yes
Default: Checked
XML Example:

<flow name="demoFlow">
  <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
  <anypoint-mq:publish config-ref="Anypoint_MQ_Configuration" doc:name="Anypoint MQ"
  destination="QUEUEorMsgEx">
    <anypoint-mq:message-builder messageId="4254a4254b4254c4254" sendContentType="false"
       sendOutboundProperties="false">
     ...
    </anypoint-mq:message-builder>
  </anypoint-mq:publish>
</flow>

sendContentType

Send content type when publishing.

Required: Yes
Default: Checked
XML Example:

<flow name="demoFlow">
  <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
  <anypoint-mq:publish config-ref="Anypoint_MQ_Configuration" doc:name="Anypoint MQ"
  destination="QUEUEorMsgEx">
    <anypoint-mq:message-builder messageId="4254a4254b4254c4254" sendContentType="false"
       sendOutboundProperties="false">
     ...
    </anypoint-mq:message-builder>
  </anypoint-mq:publish>
</flow>

propertyName

Optional property content to set for publish.

Required: No
Default: None
XML Example:

<anypoint-mq:properties>
    <anypoint-mq:property propertyName="THisisAProperty" value="4254"/>
</anypoint-mq:properties>

value

Optional value content to set for publish.

Required: No
Default: None
XML Example:

source,xml,linenums]

<anypoint-mq:properties>
    <anypoint-mq:property propertyName="THisisAProperty" value="4254"/>
</anypoint-mq:properties>

About Consume XML Elements

XML Element Description

destination

Queue or message exchange name.

Required: Yes
Default: None
XML Example:

<flow name="demoFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <anypoint-mq:consume config-ref="Anypoint_MQ_Configuration"
     doc:name="Anypoint MQ" destination="MyQ"
     acknowledgementMode="NONE" acknowledgementTimeout="42"
     pollingTime="99000">
    </anypoint-mq:consume>
</flow>

acknowledgementMode

The modes are MANUAL (default) or NONE. For more information, see Anypoint MQ Acknowledgement Mode.

Required: No
Default: MANUAL if connector is a message processor, or From configuration if connector is an entry point
XML Example:

<flow name="demoFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <anypoint-mq:consume config-ref="Anypoint_MQ_Configuration" doc:name="Anypoint MQ"
     destination="ImaQ" acknowledgementMode="NONE" acknowledgementTimeout="42"
     pollingTime="99000">
    </anypoint-mq:consume>
</flow>

acknowledgementTimeout

Duration in milliseconds until the acknowledgement mode times out.

Required: No
Default: None
XML Example:

<flow name="demoFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <anypoint-mq:consume config-ref="Anypoint_MQ_Configuration" doc:name="Anypoint MQ"
     destination="ImaQ" acknowledgementMode="NONE" acknowledgementTimeout="42"
     pollingTime="99000">
    </anypoint-mq:consume>
</flow>

pollingTime

Duration in milliseconds that the MQ connector polls the queue or message exchange for messages.

Required: No
Default: None
XML Example:

<flow name="demoFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <anypoint-mq:consume config-ref="Anypoint_MQ_Configuration" doc:name="Anypoint MQ"
     destination="ImaQ" acknowledgementMode="NONE" acknowledgementTimeout="42"
     pollingTime="99000">
    </anypoint-mq:consume>
</flow>

reconnectionWaitTime

Duration in milliseconds to wait before attempting to reconnect to the MQ backend server.

Required: No
Default: 3000 milliseconds (3 seconds)
XML Example:

<flow name="mqAsEndpointFlow">
    <anypoint-mq:subscriber config-ref="Anypoint_MQ_Configuration" destination="Q1"
    doc:name="Anypoint MQ" reconnectionAttempts="-1" reconnectionWaitTime="3000"/>
    <logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>

reconnectionAttempts

Number of attempts to make to re-establish a connection to the MQ backend server. The -1 default value indicates to retry forever.

Required: No
Default: -1
XML Example:

<flow name="mqAsEndpointFlow">
    <anypoint-mq:subscriber config-ref="Anypoint_MQ_Configuration" destination="Q1"
    doc:name="Anypoint MQ" reconnectionAttempts="-1" reconnectionWaitTime="3000"/>
    <logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>

About Subscribe XML Elements

XML Element Description

destination

Queue name.

Required: Yes
Default: None
XML Example:

<flow name="demoFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <anypoint-mq:consume config-ref="Anypoint_MQ_Configuration"
     doc:name="Anypoint MQ" destination="MyQ"
     acknowledgementMode="NONE" acknowledgementTimeout="42"
     pollingTime="99000">
    </anypoint-mq:consume>
</flow>

acknowledgementMode

The mode options are From configuration (Default), AUTO, MANUAL, or NONE. For more information, see Anypoint MQ Acknowledgement Mode. The default mode automatically ACKs each message sent to the destination queue.

Required: No
Default: MANUAL if connector is a message processor, or From configuration if connector is an entry point
XML Example:

<flow name="demoFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <anypoint-mq:consume config-ref="Anypoint_MQ_Configuration" doc:name="Anypoint MQ"
     destination="ImaQ" acknowledgementMode="NONE" acknowledgementTimeout="42"
     pollingTime="99000">
    </anypoint-mq:consume>
</flow>

acknowledgementTimeout

Duration in milliseconds until the acknowledgement mode times out.

Required: No
Default: None
XML Example:

<flow name="demoFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <anypoint-mq:consume config-ref="Anypoint_MQ_Configuration" doc:name="Anypoint MQ"
     destination="ImaQ" acknowledgementMode="NONE" acknowledgementTimeout="42"
     pollingTime="99000">
    </anypoint-mq:consume>
</flow>

pollingTime

Duration in milliseconds that the MQ connector polls a queue for messages.

Required: No
Default: None
XML Example:

<flow name="demoFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
    <anypoint-mq:consume config-ref="Anypoint_MQ_Configuration" doc:name="Anypoint MQ"
     destination="ImaQ" acknowledgementMode="NONE" acknowledgementTimeout="42"
     pollingTime="99000">
    </anypoint-mq:consume>
</flow>

reconnectionWaitTime

Duration in milliseconds to wait before attempting to reconnect to the MQ backend server.

Required: No
Default: 3000 milliseconds (3 seconds)
XML Example:

<flow name="mqAsEndpointFlow">
    <anypoint-mq:subscriber config-ref="Anypoint_MQ_Configuration" destination="Q1"
    doc:name="Anypoint MQ" reconnectionAttempts="-1" reconnectionWaitTime="3000"/>
    <logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>

reconnectionAttempts

Number of attempts to make to re-establish a connection to the MQ backend server. The -1 default value indicates to retry forever.

Required: No
Default: -1
XML Example:

<flow name="mqAsEndpointFlow">
    <anypoint-mq:subscriber config-ref="Anypoint_MQ_Configuration" destination="Q1"
    doc:name="Anypoint MQ" reconnectionAttempts="-1" reconnectionWaitTime="3000"/>
    <logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>
View on GitHub