[jbpm-commits] JBoss JBPM SVN: r3343 - jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/msg/jms.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Dec 11 11:44:51 EST 2008


Author: camunda
Date: 2008-12-11 11:44:51 -0500 (Thu, 11 Dec 2008)
New Revision: 3343

Modified:
   jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageService.java
Log:
added hook to modify JMS message before sending, this allows overwriting and adding additional properties to the JMS message

Modified: jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageService.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageService.java	2008-12-11 16:28:14 UTC (rev 3342)
+++ jbpm3/trunk/modules/enterprise/src/main/java/org/jbpm/msg/jms/JmsMessageService.java	2008-12-11 16:44:51 UTC (rev 3343)
@@ -80,12 +80,22 @@
       if (job.getTaskInstance()!=null) {
         message.setLongProperty("taskInstanceId", job.getTaskInstance().getId());
       }
+      modifyMessage(message, job);
       getMessageProducer().send(message);
     } catch (JMSException e) {
       throw new JbpmException("couldn't send jms message", e);
     }
   }
 
+  /**
+   * Hook to modify the message, e.g. adding additional properties
+   * to the header required by the own application. One possible 
+   * use case is to rescue the actor id over the "JMS" intermezzo
+   * of asynchronous continuations.
+   */
+  public void modifyMessage(Message message, Job job) throws JMSException {
+  }
+
   public void close() {
     JbpmException exception = null;
 




More information about the jbpm-commits mailing list