JMS is a Java API that standardizes the sending and receiving of messages with a publish/subscribe pattern(https://www.oracle.com/technical-resources/articles/java/intro-java-message-service.html).
A message queue server that can be addressed via JMS is, for example, IBM MQ(https://www.ibm.com/docs/en/ibm-mq/9.3). An open-source alternative is ActiveMQ(https://activemq.apache.org/).
Requirement
A TopLogic application should be able to send messages to and receive messages from a JMS message broker.
For sending messages it should be possible to configure the connection to a JMS message broker in a service "JMSSenderService". This service is to be used, in order to be able to send a message in a new TL Script function "sendMessage(channel, message)". The message shall be either a binary value, a string, a JSON object (map), or an XML structure ("HTMLFragment").
For the receipt of messages a service "JMSReceiverService" is to be able to be configured likewise a connection to a JMS-Message-Broker and a set of channel subscriptions. For each configured channel it shall be possible to register a handler which is called when a message is received via this channel. There shall be a handler implementation that can be parameterized via a TL script function. The script shall receive the message and the channel as argument and shall be able to execute any action.
Test
- Install IBM MQ(https://developer.ibm.com/tutorials/mq-connect-app-queue-manager-containers/)
- Configure the send connection to IBM MQ in TopLogic.
- Send message via jmsSend().
- Check in the IBM MQ admin interface if the message has arrived.
- Configure the recipient in TopLogic.
- (Generate message from IBM MQ admin interface.) Not necessary if there are still messages from sending in the queue.
- Check that the message has arrived in TopLogic and has been processed.
- Test yourself with ActiveMQ.
- e.g. via or Podman(https://github.com/apache/activemq-artemis/blob/main/docs/user-manual/docker.adoc/)