Contact Free trial Login

Configure Message Exchanges

Using a message exchange, you can send a message to one or more standard queues that are bound to the message exchange. The maximum size of a message sent to a message exchange is 10 MB.

FIFO does not support the use of a message exchange. Similarly, FIFO queues cannot be bound to a message exchange.

Before creating a message exchange, create one or more queues. For information, see Create Queues.

To create a message exchange:

  1. Log in to Anypoint Platform.

  2. Click MQ from the left navigation area or the main Anypoint Platform screen.

  3. Click Destinations.

  4. Click the blue plus icon (+) to display the menu:

    Blue plus icon used for adding a message exchange
    Figure 1. The arrow shows the blue plus icon at the top of the Destinations page.
  5. Select Exchange.

    For Queue or FIFO Queue, see Configure Queues.

  6. In the Create Exchange page, name the message exchange.

    Message exchange names can contain up to 127 alphanumeric characters (a-z, A-Z, 0-9), periods (.), and hyphens (-). They cannot contain spaces or other characters.

  7. Click the checkboxes to bind queues to this message exchange:

    Checkboxes to bind queues to an exchange
    Figure 2. The arrow shows the checkboxes to select to bind queues to the exchange.
  8. Click Save Changes.

  9. In the Destinations page, click the message exchange type for the new exchange to display its details in the right pane:

    Click the exchange type to display its details in the details pane.
    Figure 3. The screen shows (1) where to click to display (2) the queues bound to the exchange in the details pane.

Bind a Queue to a Message Exchange

To bind a queue to a message exchange:

  1. In Anypoint Platform > MQ, click Destinations in the left pane.

  2. Click the message exchange ID to display the Exchange Settings page:

    Checkboxes for multiple select
    Figure 4. The screen shows (1) the checkboxes to select multiple queues and (2) the Unbind and (3) Bind buttons to unbind or bind a single queue to the exchange.
  3. In the settings page, click Bind or Unbind for each single queue you want to bind to or unbind from the message exchange.

    To select multiple queues to bind to the exchange, select the checkboxes and click the Bind Selected Queues button that appears:

    Bind Selected Queues button
    Figure 5. The arrow shows the Bind Selected Queues button to bind a multiple queues to the exchange.

Send a Message to a Message Exchange

Sending a message to a message exchange is similar to sending a message to a queue. The only difference is that you can get the message from any queue bound to a message exchange. The maximum size for a message sent to a message exchange is 10 MB.

To send a message to a message exchange:

  1. In Anypoint Platform > MQ, click Destinations in the left pane.

  2. Click the message exchange ID to display the Exchange Settings page.

  3. In the settings page, click Message Sender in the left pane:

    Message Sender option for the exchange
    Figure 6. The arrow shows the Message Sender option for the exchange.
  4. Leave the Type field set to Text.

  5. Enter text in the Payload field, such as Hello Queues from myMessageExchange.

  6. Click Send.

  7. Click View Messages for a queue that is bound to the exchange to view the queue with the Message Browser.

You also send JSON content or comma-separated values (CSV) in the payload by changing the message Type value. See Send a JSON Message to a Queue and Send a CSV Message to a Queue.

Delete a Message Exchange

If a message exchange is no longer needed, you can delete it. All queue bindings for the deleted exchange queue are lost. Clients can’t publish or subscribe to the exchange.

To delete a message exchange:

  1. In Anypoint Platform > MQ, click Destinations in the left pane.

  2. In the Destinations page, click the message exchange type for the exchange to display its details in the right pane.

  3. Click the Delete icon:

    Delete icon in the details pane for deleting an exchange
    Figure 7. The arrow shows the Delete icon in the details pane for deleting an exchange.
  4. In the Delete Exchange window, select the checkbox and click Delete Exchange:

    Accept checkbox for deleting an exchange
    Figure 8. The arrow shows the accept checkbox for deleting an exchange.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub