AMQP/JMS (Input Agent)
Introduction: Phase 1.
The Input Agent AMQP can receive data from a message queue of a server that implements the Advanced Message Queuing Protocol. This protocol is platform independent and is supported by a large number of systems. Most JMS servers already have an AMQP plugin
Lobster_data can access an AMQP server installed on the same or a different computer. That means that Lobster_data is in the client role.
Note: This Input Agent can also be used to read from JMS server queues.
(1) Only relevant for the add-on module Load Balancing to start the profile on a specific node.
(2) Selection of a AMQP or JMS alias. See section AMQP Connections.
(3) Selection of the message type (Subscriber, Topic, Routing or RPC). The style RPC is synchronous, the others are asynchronous. Note: If you use style RPC, it is additionally necessary to use a Response Route of type Custom Class and the specific class PassBackDataResponse. The reason is that in the case of an RPC call a response is expected by the calling client, which is generated by the mentioned Response Route class in Lobster_data and from there returned to the Input Agent and then to the client. See also sections Third Possibility - HTTP Response Chain and AMQP Networks with Style RPC. Note: If you use style Topic, the checkbox Persistent ('Durable') will appear. Set this checkbox if (4) is a durable queue (such a queue will survive a broker restart) . If you are using ActiveMQ, you must use a JMS Client ID in the connection, otherwise, this generates an error, which you cannot detect directly, but only in the Server Logs under _data/error.logs in the following form:
...javax.jms.JMSException: You cannot create a durable subscriber without specifying a unique clientID on a Connection... |
(4) Name of the queue to listen to, resp. the topic. See also (3). Note: If an Azure Service Bus is used and Topic is selected in (3), the following syntax must be used here: <topic_name>/subscriptions/<subscription_name>, e.g. mytopic/subscriptions/mysubscription.
(5) If you need to filter the messages you want to receive, you can use a JMS API message selector, which allows you as consumer to specify the messages you are interested in. See Oracle JMS Message Selectors and the section below.
(6) Here you can set the Consumer Delivery Acknowledgement behaviour, i.e. how Lobster_data confirms the receipt of a message to the message bus, see here, for example. If the checkbox is not set, the default behavior applies, i.e. the receipt is acknowledged after the backup file of the profile job has been created (except for message type RPC). If the checkbox is set, a received message will only be confirmed after the job has been successfully completed. Processing in the background is not possible in that case (parallel processing and queueing of jobs). If the Response Routes have checkbox Execute response in own thread set, the receipt of a message is always confirmed after phase 6. Note: If a message is not confirmed by Lobster_data, the setting of the JMS/AMQP server takes effect and the message may be delivered again or rejected and forwarded to the Dead Letter Queue. If this is the case, you can therefore, similar to working with databases, "commit" a transaction at the end of the processing in the profile if no error has occurred. In the event of an error, profiles for error handling can be set up, for example, which may then process the erroneous messages from the dead letter queue. Note: A dead letter queue can also be created via an AMQP Response Route if the profile that uses this Response Route has a defined system variable AMQP_SYS_<name of the queue argument>. For RabbitMQ, for example, that would be AMQP_SYS_x-dead-letter-exchange, see here.