Nav

To Configure Message Exchanges

A message exchange lets you send a message to one or more queues that are bound to the message exchange.

Notes:

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

  • Message exchange names can contain alphanumeric characters (a-z, A-Z, 0-9), dots (.), and dashes (-). All other characters are not allowed.

  • Message exchange names are limited to 127 characters in length.

  • The maximum size of a message sent to a message exchange is 10 MB.

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

To create a message exchange:

  1. Log into Anypoint Platform.

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

  3. Click Destinations.

  4. Click the blue plus circle.

  5. Click Exchange.

    mq-create-an-exchange

  6. Name the message exchange. For example, if the message exchange is called MessageExchange and a queue, MyDemoQueue, the Create Exchange screen is:

    mq-name-the-exchange

    Message exchange names can only contain these characters: a-z, A-Z, 0-9, period (.), and hyphen (-). Message exchange names cannot contain spaces or other characters, and the name can be up to 127 characters in length.
  7. Click the checkbox to bind MyDemoQueue to this message exchange.

  8. Click Save Changes.

  9. In the Destinations screen. click the message exchange name to list its details:

    mq-exchange-details2

Note: If you need to delete a message exchange, see FAQ: How do I delete a message exchange?

To Bind a Queue to a Message Exchange

To bind a queue to a message exchange:

  1. Log into Anypoint Platform.

  2. In the top task bar, click MQ.

  3. Click Destinations.

  4. Click the left side of the message exchange entry in Destinations.

    Note: Where you click on a message exchange entry in the Destinations table governs what you see next:

    mq-where-to-click-x2

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

    mq-bind-queue-to-exchange2

To Send a Message to a Message Exchange

Sending a message to a message exchange is very 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 message size sent to a message exchange is 10 MB.

To send a message to a message exchange:

  1. Log into Anypoint Platform.

  2. In the top task bar, click MQ.

  3. Click Destinations.

  4. Click the MessageExchange entry in Destinations to view details about the message exchange.

  5. Click the MessageExchange link in the details screen to access the Message Sender:

    mq-exchange-msg-access2

  6. Click Message Sender:

    mq-exchange-msg-sender2

  7. Type the contents of the Payload and click Send:

    mq-exchange-payload2

You can now use the Message Browser to get the message from the MyDemoQueue as described in To Get a Message From a Queue.

You can also send comma-separated value (CSV) or JSON content in the payload by changing the message Type value. For more information, see To Send a CSV or JSON Message.

See Also