Contact Free trial Login

Configure Message Exchanges

A message exchange lets you send a message to one or more 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.

  5. Click Exchange.

    mq create an exchange
  6. 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 checkbox to bind queues to this message exchange.

    mq name the exchange
  8. Click Save Changes.

  9. In the Destinations screen, 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. 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 message exchange ID.

  5. In the Exchange Settings page, click Bind or Unbind for each queue you want to bind to or unbind from the message exchange:

    mq bind queue to exchange2

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. 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 message exchange ID or details label to access the Messaging feature:

    mq exchange msg access2
  5. In the settings page, click Message Sender in the left pane.

  6. Leave the Type field set to Text.

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

  8. Click Send.

    mq exchange payload2
  9. Click View Messages for a queue bound to the exchange to use 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. Click Destinations.

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

  3. Click the trash can icon in the upper right.

    mq click type e2
  4. In the Delete Exchange screen, click the checkbox:

    mq delete exchange
  5. Click Delete Exchange.