Run JMS messages

Tricentis Tosca API Scan enables you to run Java Message Service (JMS) messages using API connections such as Active MQ, ActiveMQ Artemis, IBM MQ, Oracle WebLogic, Rabbit MQ, or Tibco EMS.

You can work with the following options:

  • JMS queues, which is a one-to-one messaging model including a sender and a receiver

  • JMS topics, which is a one-to-many messaging model including a publisher and subscribers

You can select whether your JMS message is incoming or outgoing, this means if you want to pull messages from a JMS queue/topic, or push messages to a JMS queue/topic.

In the API Connection Manager, you can also enable peeking for your API connections. This allows you to retrieve messages from topics or queues without consuming them. For more information, see the configuration instructions for Active MQ, ActiveMQ Artemis, IBM MQ, Oracle WebLogic, Rabbit MQ, or Tibco EMS.

After running your JMS messages in API Scan, you can export them to Tosca Commander, and use the message information to define Module Attributes and verify their values. Depending on your tests, you have to export the messages either as an API TestCase or as an OSV Scenario. It is not possible to convert a JMS TestCase into a JMS Scenario, or vice versa.

You can not export JMS messages directly from API Scan to OSV. You have to export them to Tosca Commander first and set the correct ActionModes manually before uploading to OSV.

For an example of working with queue messages, see chapter "Example: Work with queue messages".

Run inbound JMS messages

To pull JMS messages from a queue/topic, follow the steps below:

  1. Create a message from a URI or file, or create a new message.

  2. Select a JMS connection from the Connection dropdown menu.

  3. Select Pull from the Action dropdown menu.

Select Connection and Action

  1. Depending on your connection, you can specify the following details:

    • If you receive inbound messages from a queue, you can specify a Selector to filter the message headers and properties (see chapter "Specify a selector"). If you don't specify a selector, you receive the first message from the queue.

      If more than one message matches your selector, you receive the first matching message from the queue.

    • If you receive inbound messages from a topic, you have to specify your individual Subscription Id to subscribe to the topic.

  1. Click Run in the API Scan menu to pull a message from the queue.

    If you have added a Subscription Id, the first run only submits the ID and no message is returned. To receive a message, click Run again.

Response of a pull message

All relevant message information is stored in the headers and properties of the response message. The Headers section is collapsed by default.

To display the header and property list, click the arrow icon on the right side of the message section.

Run outbound JMS messages

To push JMS messages to a queue/topic, follow the steps below:

  1. Create a message from a URI or file, or create a new message.

  2. Select a JMS connection from the Connection dropdown menu.

Select Connection and Action

  1. Select Push from the Action dropdown menu.

  2. To subscribe to a topic when running outbound messages, you have to submit your subscription ID through an inbound message first.

  3. Click on Run in the API Scan menu to push your message on the queue.

Response of a push message

All relevant message information is stored in the headers and properties of the message. The Headers section is collapsed by default.

To display the header and property list, click the arrow icon on the right side of the message section.