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.

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.
  7. 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.
  8. 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.