-
Because MuleSoft Government Cloud includes only one region, it does not support failover.
-
Anypoint MQ is available in only one region in some countries.
If failover is enabled for queues in those regions and the primary region goes down, data resides in a region outside the country until the primary region is available.
Configuring Cross-Region Failover for Standard Queues
Anypoint Connector for Anypoint MQ (Anypoint MQ Connector) for Mule 4 version 4.0.7 provides failover capability for standard queues.
When you enable failover for a queue, Anypoint MQ automatically creates a fallback queue in a fallback region. If a Mule app can’t reach an Anypoint MQ server in a region, it switches to the fallback queue to publish and consume messages. For information about situations that can cause a region to be considered unavailable, see Region Unavailability.
This feature provides resiliency by switching to a fallback queue in a fallback region when the primary region is down. It doesn’t provide data redundancy by replicating messages across the primary and fallback queues. |
When the connector detects that the primary region is down, it:
-
Switches to the fallback queue to publish and consume new messages.
-
Periodically checks if the primary region is back up.
When the connector detects that it can communicate with the primary region, it switches processing back to the primary queue. The consumer continues to read from the fallback queue until all messages in that queue are processed.
The fallback queue inherits the settings of the primary queue, such as message TTL (time-to-live) and default acknowledgment timeout. The Anypoint MQ server manages fallback queues and regions; end users can’t configure them.
You can disable failover, but you can’t delete the fallback queue. When you disable failover for a queue, apps can still consume any messages that remain in the fallback queue but can’t publish new messages to it.
Failover Limitations and Considerations
-
Failover Support
-
This feature is not enabled by default.
For information about enabling this feature in your app, see Enable Failover in Your App.
-
Failover support requires Anypoint MQ Connector 4.0.7 or later.
-
Failover is supported for standard queues only.
-
Failover isn’t supported for message exchanges or FIFO queues.
-
-
Fallback Regions
For the list of fallback regions, see Primary-Fallback Regions.
-
Authentication
If access management is unavailable when the connector switches to the fallback region, the connector might not be able to switch to the fallback region if it can’t validate the access token.
-
Anypoint MQ UI
The Message Sender and Message Browser in the Anypoint MQ UI don’t support the failover feature.
When you send a message using the Message Sender, the message is published to the specified queue and appears in the Message Browser. However, if the primary region is down, the message is not forwarded to the fallback queue, so it doesn’t appear in the Message Browser for the fallback queue.
-
Performance and Billing
The Consumer and Subscriber operations in Anypoint MQ Connector periodically check the fallback queue for new messages. Each request counts against your monthly API request quota. These checks can also cause latency.
Publishing to or consuming from the fallback queue might be slower than with the primary queue due to the checks and the expected network latency of processing from a queue in a different region.
You can configure how frequently the connector checks the fallback queue. See Configure the Frequency of Fallback Queue Checks.
Before You Begin
To use failover, you must first:
-
Upgrade Anypoint MQ Connector to 4.0.7 or later.
For information, see Upgrading and Migrating Anypoint MQ Connector.
-
Enable the failover feature in your app.
For information, see Enable Failover in Your App.
Enable Failover for a New or Existing Queue
Enabling cross-region failover creates a fallback queue in a fallback region.
If either the primary or fallback region is unavailable, enabling failover via the Anypoint MQ UI or REST API might not work. |
If the primary queue has an assigned dead-letter queue (DLQ), you must enable failover for the DLQ before enabling failover for the primary queue.
To enable failover for a new or existing queue:
-
Sign in to Anypoint Platform and click MQ in the navigation menu.
-
Click Destinations.
-
Create a queue or modify an existing queue:
-
Create a queue
-
Modify an existing queue
-
Click the Add icon to display the menu:
-
Select Queue.
Anypoint MQ supports failover for standard queues only.
-
Complete the fields in Create Queue.
For information about queue settings, see Create a Queue.
-
Select Enable Cross-Region Failover:
-
Click Create Queue.
Anypoint MQ creates the queue and also creates a fallback queue in the fallback region. The name of the fallback queue is the primary queue name with the
_fb
suffix. For example, if the primary queue name ismyDemoQueue
, the fallback queue name ismyDemoQueue_fb
.The Anypoint MQ server manages fallback queues and regions; end users can’t configure them.
-
Click the queue name.
Anypoint MQ supports failover for standard queues only.
-
In the Queue Settings page, select Enable Cross-Region Failover:
-
Click Save Changes.
Anypoint MQ updates the queue settings and creates a fallback queue in the fallback region. The name of the fallback queue is the primary queue name with the
_fb
suffix. For example, if the primary queue name ismyDemoQueue
, the fallback queue name ismyDemoQueue_fb
.The Anypoint MQ server manages fallback queues and regions; end users can’t configure them.
If you previously enabled failover for the queue, the fallback queue already exists and is reinstated.
-
Restart all applications consuming from or publishing to the queue.
-
View Fallback Queue Details
To view failover configuration for the primary and fallback queues, display the queue details:
-
Sign in to Anypoint Platform and click MQ in the navigation menu.
-
Click Destinations.
-
Click the queue type to display its details, including the failover configuration.
-
The queue details pane for the primary queue includes the fallback queue:
1 Queue type displays the queue details pane for the primary queue. 2 The name of the fallback queue is the primary queue name with the _fb
suffix. -
The queue details pane for the fallback queue includes the primary queue:
1 Queue type displays the queue details pane for the fallback queue. The fallback queue can’t be deleted.
2 The name of the primary queue is the fallback queue name without the _fb
suffix.
-
Disable Failover for a Queue
When you disable failover for a queue, apps can still consume any messages that remain in the queue but can’t send new messages to the queue.
When you disable failover for a queue, you must restart all applications that consume from or send to the queue. |
When you re-enable failover, Anypoint MQ reinstates the same fallback queue.
To process any messages that remain in the fallback queue after disabling failover, see Process Messages Directly from the Fallback Queue.
To disable failover for a queue:
-
Sign in to Anypoint Platform and click MQ in the navigation menu.
-
Click Destinations.
-
Click the queue name.
-
In the Queue Settings page, deselect Enable Cross-Region Failover
Anypoint MQ disables failover for the queue:
-
Click Save Changes.
The primary queue details shows that failover is disabled:
-
Restart all applications consuming from or publishing to the queue.
Primary-Fallback Regions
Location | Primary Region Name | Primary Region | Fallback Region Name | Fallback Region |
---|---|---|---|---|
US Control Plane |
||||
North America |
US East (N. Virginia) |
|
US East (Ohio) |
|
US East (Ohio) |
|
US West (Oregon) |
|
|
US West (Oregon)** |
|
Canada (Central) |
|
|
Canada (Central)* |
|
US East (N. Virginia) |
|
|
Europe |
Europe (Ireland)** |
|
Europe (London) |
|
Europe (London)** |
|
Europe (Ireland) |
|
|
APAC |
Asia Pacific (Singapore)** |
|
Asia Pacific (Tokyo) |
|
Asia Pacific (Sydney)* |
|
Asia Pacific (Singapore) |
|
|
Asia Pacific (Tokyo)** |
|
Asia Pacific (Sydney) |
|
|
EU Control Plane |
||||
Europe |
Europe (Frankfurt)** |
|
Europe (Ireland) |
|
Europe (Ireland)** |
|
Europe (Frankfurt) |
|
** The fallback region for this region is not in the same country as the primary region.
Region Unavailability
The connector considers a region as unavailable in cases where the Anypoint MQ backend server is:
-
Down, resulting in HTTP 5xx (Server Error) status codes to the connector.
-
Up, but is slow or unresponsive.
For example, the connector receives Timeout errors while making REST API calls to the backend server.
-
Available in some situations, but not others.
For example, unresponsive for queues, but available for other usage, such as message exchanges.
When the connector receives an HTTP 5xx or any server-side error, it temporarily marks the region as down for the specific queue and switches to the fallback queue.
The connector periodically checks for new messages in the primary queue to determine if the primary region is back up. You can change the frequency of these checks. For information, see Configure the Frequency of Fallback Queue Checks.