Sends the body of the request or the response as a message to a JMS queue or topic.
In the flow of an API, the interceptor sends a message for the request and another one for the response. Put it into request or response to send only one of them.
Any broker with a Jakarta Messaging (JMS 3) client can be used.
The interceptor needs the Membrane JMS Extension. Without the extension Membrane does not start. Contact predic8 for the extension.
Example Configuration
api:
port: 2000
flow:
- request:
- jmsProducer:
jmsConnection:
connectionFactory: org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
brokerURL: tcp://mq.example.com:61616
queue: orders
- return:
status: 202
api:
port: 2000
flow:
- request:
- jmsProducer:
jmsConnection:
connectionFactory: org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
brokerURL: tcp://mq.example.com:61616
queue: orders
- return:
status: 202
Syntax
jmsProducer:
'$ref': <string>
deliveryMode: persistent
jmsConnection:
<jmsConnection>: <string>
queue: <string>
sendTimeout: <int>
topic: <string>
jmsProducer:
'$ref': <string>
deliveryMode: persistent
jmsConnection:
<jmsConnection>: <string>
queue: <string>
sendTimeout: <int>
topic: <string>
Attributes
| Name | Required | Default | Description | Examples |
|---|---|---|---|---|
| $ref | false | - | Reference a component defined under components. | - |
| deliveryMode | false | persistent | Whether the broker stores the messages so that they survive a restart of the broker. | persistent | non_persistent |
| queue | false | - | Queue the messages are sent to. Set either queue or topic. | orders |
| sendTimeout | false | 10000 | Time in milliseconds the broker may take to accept a message. If it takes longer, e.g. because the broker blocks producers when its disk is full, the request is answered with 500. 0 waits without limit. | 30000 |
| topic | false | - | Topic the messages are published to. Set either queue or topic. | order-events |
Child Structure
| Element | Cardinality | Description |
|---|---|---|
| jmsConnection | 0..1 | Connection to a JMS broker. Works with every broker that has a Jakarta Messaging (JMS 3) client, e.g. ActiveMQ Artemis, ActiveMQ Classic 6, IBM MQ or AMQP brokers through Qpid JMS. The client library of the broker has to be put into the lib folder of Membrane. |