cancel
Showing results for 
Search instead for 
Did you mean: 

External JMS application

fitzcaraldo
Champ in-the-making
Champ in-the-making
<<Newbie alert>>

Hello

I have a number of legacy applications I would like to orchestrate using Activiti.  Each of then uses JMS queues for request/response interactions: Request messages are written to a nominated queue and responses are written to another queue using correlationID to match back to a request.  The responses can vary from milliseconds to minutes.

Could someone please give me some pointers as to how I could model this interaction in Activiti - especially the async response? 
Can Activiti handle JMS endpoints natively?
Would there be any advantage in using Camel to mediate (eg wrap in a SOAP interface - or something else)?

Anything else I need to consider?

Thanks
6 REPLIES 6

frederikherema1
Star Contributor
Star Contributor
There is no built-in support for reading or sending JMS-messages. However, BPMN has a notion of message-events and signal-events. Using a correlationId that is stored in the process-instance business-key (can be provided when started) you can easily lookup the appropriate activiti-process using our API when a JMS-message has been received and signal the process to carry on (optionally passing in payload based on the message). For sending JMS-messages, you can create a JavaDelegate that queues a message on JMS and model that in a service-task in your process.

Off course, using the camel integration for this makes a lot of sense, as Camel has a lot of stuff built-in for handling queues and JMS.

davidnguyen
Champ in-the-making
Champ in-the-making
Hi,

I have the same kind of problem and got the same conclusion : using an intermediate receive event (message or signal) a receive task so the process waits until the response is available. However, I could not find how to send a message event to a specific process instance using the REST api. Is this currently supported in 5.13?

There is an operation to send a signal (http://activiti.org/userguide/index.html#N15FFB) but it seems to be in the legacy api so I guess it is not safe to use.

trademak
Star Contributor
Star Contributor
This service should provide the functionality you are looking for:

http://activiti.org/userguide/index.html#N13D8A

Best regards,

davidnguyen
Champ in-the-making
Champ in-the-making
Hi Tijs, thank you for your answer, this was indeed what I was looking for.

imbaczek
Champ in-the-making
Champ in-the-making
Related question: I've got a requirement to orchestrate processes like this:
[img]http://i.imgur.com/QDmbzsY.png[/img]
I'm new to Activiti and generally BPM - is Activiti a good choice for such stuff? I'm trying to get something working right now and keep running into server-side issues like NPE/XML parse errors (probably forgot to set a field somewhere in the designer and your validation is… not enough). It's still much more approachable than jBPM (don't get me started…), but still it looks like there's room for improvement.

I digress… question is: is Activiti a good choice if I don't have any human tasks in my processes?

jbarrez
Star Contributor
Star Contributor
You could use Activiti for it, but imho solutions like Apache Camel are way better suited for your use case.

Activiti does have great support for Apache Camel 😉