Sending a JMS message
The Java Message Service (JMS) API is a Java message-oriented API for sending messages between applications. On the surface, JMS behaves like a simple producer-consumer; i.e. there are things that create messages (the producer), and there are things that receives those messages (the consumer). This page will show you some of the many ways you can easily send a JMS message.
Using Functions
The JMS
class offers various functions for sending JMS
messages. This example will use the
publishTo(String, String)
function:
1 2 |
|
Using the user interface
There are various ways of sending JMS messages in Martini Desktop and Online. These are features intended for use during development, useful when testing the consumption of JMS messages (e.g., by the JMS listener endpoint). You can send JMS messages from the following parts of Martini:
- the package configuration editor;
- the Navigator view's context menu for instances;
- the Navigator view's context menu for JMS listener endpoints; and
- the JMS listener endpoint editor.
From the package configuration editor
The package configuration editor has a Send Message button under the JMS Queues/Topics section that allows you to send a JMS message to the selected JMS queue/topic.
The image below demonstrates how to send a JMS message using this method:
From the instance context menu
From the Navigator, you can right click on an instance, and then select Send JMS Message to send a JMS message to the JMS queue/topic of your choice.
The image below demonstrates how to send a JMS message using this method:
From the JMS listener endpoint context menu
You can also right click a JMS listener endpoint from the Navigator, and then select Send JMS Message from the appearing context menu in order to send a JMS message to the configured destination of the endpoint.
The image below demonstrates how to send a JMS message using this method:
From the JMS listener endpoint editor
The JMS listener endpoint editor also has a Send Message button next to the Destination text field. You can use this button to send a JMS message to the configured destination of the endpoint.
Where is the button?
The Send Message button can only be seen when the endpoint has started.
The image below demonstrates how to send a JMS message using this method: