Skip to content

JMS in Martini

Martini Server Runtime supports JMS messaging, it offers multiple ways to list broker destinations and send messages using the Martini CLI, API Explorer, and Martini Designer.

Warning

It's important to acknowledge that the RabbitMQ JMS client currently does not offer a full implementation of the JMS API. However, it can be integrated with JMS systems by using a bridge or plugin, such as RabbitMQ's JMS Client or by converting JMS to AMQP. These tools allow you to receive JMS messages in a RabbitMQ environment by mapping JMS concepts (e.g., topics, queues) to RabbitMQ equivalents. This partial support may lead to connection issues or messages not being delivered as expected. Given these constraints, Martini defaults to utilizing an in-memory broker for handling WebSocket messages, thereby excluding RabbitMQ from WebSocket message routing.

List Destinations

List destinations using Martini CLI

  1. Open the Runtime Directory: <martini-home>/bin
  2. Run the Martini Server Runtime in debug mode:
1
./toro-martini debug
  1. Launch the Martini CLI:
1
java -jar toro-martini-cli.jar
  1. Connect to your Martini Server Runtime instance.
1
connect --uri http://[HOST] --client-id [YOUR-ID] --client-secret [YOUR-SECRET]
  1. Use the command to list available destinations:
1
list-destination

List destinations using API Explorer

  1. Open a web browser and navigate to [HOST]:8080/api-explorer/ to access the API Explorer.
  2. Locate and click on the broker tag within the API Explorer to view various broker configuration and operation endpoints.
  3. Use the /esbapi/broker/destinations endpoint found under the broker tag to list available destinations.
  4. Execute the request using the GET method at the /esbapi/broker/destinations endpoint.

Sending Messages

Send messages using Martini CLI

  1. Open the Runtime Directory: <martini-home>/bin
  2. Run the Martini Server Runtime in debug mode:
1
./toro-martini debug
  1. Launch the Martini CLI:
1
java -jar toro-martini-cli.jar
  1. Connect to your Martini Server Runtime instance.
1
connect --uri http://[HOST] --client-id [YOUR-ID] --client-secret [YOUR-SECRET]
  1. Use the command publish-string or publish-file:
  2. To publish a string, which will send a string to the consumer:

    1
    publish-sting --destination [URI] --value [STRING]
    
  3. To publish a file, which will send a file to the consumer:

    1
    publish-file --destination [URI] --file [PATH] --media-type [TYPE]
    

URI can be queue://[name] or topic://[name].

Send messages using API Explorer

  1. Open a web browser and navigate to [HOST]:8080/api-explorer/ to access the API Explorer.
  2. Locate and click on the broker tag within the API Explorer to view various broker configuration and operation endpoints.
  3. Choose a endpoint and type you want to use for sending messages:
  4. To publish a string, use /esbapi/broker/destinations/{type}/{name}/sendString.
  5. To publish bytes, use /esbapi/broker/destinations/{type}/{name}/sendBytes.
  6. To publish an object, use /esbapi/broker/destinations/{type}/{name}/sendObject.

!!! warning Sending objects to a RabbitMQ Queue will only work if the amqp parameter is set to false.

  1. For the type field, you can type queue or topic based on your needs. For the name field, specify the destination name you want to send to.
  2. Execute the request using the POST method at the chosen endpoint.

Using Martini Designer

To list destinations and send messages using Martini Designer refer to the developing documentation here.