@PostDeploy public void start(ProcessEngine processEngine) { System.out.println("Invoking @PostDeploy annotation in " + getClass().getName());
JMSListener jmsListener = new JMSListener(); Thread jmsListenerThread = new Thread(jmsListener); jmsListenerThread.start(); } @Override public void run() { try { consumer = new JMSConsumer(); while(true) { Object message = consumer.listen(); if(message instanceof ObjectMessage) { ObjectMessage objectMessage = (ObjectMessage)message; HashMap<String, Object> msgData = (HashMap<String, Object>)objectMessage.getObject(); // process the message and start process instance whith REST call postData(msgData,url); System.out.println("messageName:" + msgData.get("messageName")); System.out.println("businessKey:" + msgData.get("businessKey")); System.out.println("processVariables:" + msgData.get("processVariables")); } } } catch (Exception e) { System.err.println(e); } finally { consumer.close(); } }Hi Klime.
Personally I would recommend to use an Java EE app server if you do JMS – then you can simply use Message Driven Beans (calling the Java API injected by CDI) and the container keeps track of all the bootstrapping. My colleague Falko once did an example on this: https://github.com/camunda/camunda-consulting/blob/master/snippets/asynchronous-messaging-jms/src/main/java/org/camunda/bpm/example/asynchronous_messaging_jms/CallbackServiceMDB.java.
No option for you?
Cheers
Bernd
--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/6107f55e-34bb-40e3-87ac-569b18264873%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.