Camunda JMS Connector is a Camunda Connect plugin extension that allows to enqueue and dequeue messages on Java Message Service in any project that uses Cammunda Engine with BPMN processes. It is fully customizable and by using it in a project, a user can model a BPMN process where it is possible to enqueue any messages on a particular instance of JMS. JMS Connector also features receiving messages from the desirable queue and upon receiving the payload it triggers a message in the Camunda Engine, which ultimately can start a new instance of a process or continue an existing one depending on how the connector and a processes are customized.
To get a local copy up and running follow these simple steps.
An alternative, more straightforward way is to use the connector as maven dependency. For this purpose just include publisher and listener just like below.
<!-- https://mvnrepository.com/artifact/io.devapo.camunda/camunda-jms-publisher -->
<dependency>
<groupId>io.devapo.camunda</groupId>
<artifactId>camunda-jms-publisher</artifactId>
<version>1.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.devapo.camunda/camunda-jms-listener -->
<dependency>
<groupId>io.devapo.camunda</groupId>
<artifactId>camunda-jms-listener</artifactId>
<version>1.0.0</version>
</dependency>
- clone Camunda JMS Connector repository
- get your favourite IDE
- Maven
- ActiveMQ - a local instance in Docker should do
- Camunda Modeler
- Customize listener
- To choose the queue that you want to listen get into
TransactionReceiver.java
and change the value of destination in@JmsListener
annotation. - To choose the instance of a JMS that you would like to listen get into your project and customize necessary variables in
application.properites
.
- To choose the queue that you want to listen get into
# Example application.properites
# activemq credentials
spring.activemq.user=admin
spring.activemq.password=admin
# activemq url
spring.activemq.broker-url=tcp://localhost:61616?jms.redeliveryPolicy.maximumRedeliveries=1
# json keys that you would like your listener should look for
# key for an id of an instance of a process
json.instanceid=bkey
# key for a message that you would like to send
json.payload=msg
-
Customize publisher
- Select
service-task
in cammunda modeler block and customize it according to your needs. Example customization below will enqueue ontest
queue that is run on anfailover://tcp://localhost:61616
address a message that is a json -{'bkey':'first','msg':'start'}
. Mind the fact that those values reflect on how you customized your listener. JMS Connector's Id is jms-publish-connector. It is very important as it points out which connector you would like to use.
- Select
-
Build the project
- run
mvn package
in respository directory
- run
-
Use output JAR's as external library
In\target
directory of listener and publisher you will find both fat jars and light jars. Use one of them regarding your project preferences.
Any contributions you make are greatly appreciated.
Software is licensed under MIT License.
Project Link: https://github.com/