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-circle icon to display the menu:

    mq create an exchange
  5. Click Exchange.

  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:

    mq name 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:

    mq exchange details2

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:

    mq bind queue to exchange2
  3. In the settings page, click Bind or Unbind for each queue you want to bind to or unbind from the message 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:

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

    mq exchange payload2
  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 trash can icon in the upper right:

    mq exchange delete
  4. In the Delete Exchange page, click the checkbox, and then click Delete Exchange:

    mq delete exchange

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.