1 Reply Latest reply on Dec 17, 2009 5:49 PM by ryanhos

    ESB action inter communication

    jbossesbdev

      Hello,

      I'm new to Jboss ESB and am wondering about the inter communication between actions.

      Once a message has entered the ESB via a listener, and the first action has already been called, how is the message transferred to the next action in the ESB Service chain. Is it on the internal ESB bus? or some other sort of queing mechanism. Or can it go to a external JMS queue and then get routed to the next action somehow? Are all actions in the service chain called in a single thread?

      Thanks
      Sam

        • 1. Re: ESB action inter communication
          ryanhos

          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.