-
1. Re: ESB action inter communication
ryanhos Dec 17, 2009 5:49 PM (in response to jbossesbdev)Sam,
Everything I'm about to say pertains to JBoss ESB 4.5, but I can't imagine it has changed much. Yes, all actions in the service chain are executed in a single thread per message.
Once a listener picks up a message from it's communications channel, it gives the message to one of it's available threads (the number of which is configured by the <listener maxThreads=""> argument). This is a simplification of the actual process, but that thread iterates over each action in the service, calling the process methods, success callbacks, and if necessary, failure callbacks, passing the message to each as an argument. process() is allowed to return a message, which is in turn used as the argument to the next action's process() method.
It is also important to note that the ESB instantiates one instance of your action for each time it appears in the jboss-esb.xml file. Thus, if <listener maxThreads="5">, there are 5 threads sharing one intance of org.demo.SamsCustomEsbAction, so keep your actions threadsafe.