2 Replies Latest reply on Dec 2, 2009 5:53 AM by Kevin Conner

    ESB threading model

    Sam P Newbie

      Hello,

      I new to jboss ESB and am trying to figure out the threading model for ESB services.

      ESB Services are typically exposed via listeners. Are the listeners multi threaded? Meaning are they like a servlet on a web container that can service multiple requests in different threads? I know there is a way to set number of threads at the Service level, but what exactly does that mean? does that mean the listener is multi threaded?

      I'm having these questions arise because I'm also trying to figure out where EJB fit in (e.g. Stateless Session Beans). Or are they not needed?

      If someone could explain the flow of a message through the system in terms of the threads, I would really appreciate it.

      Thanks

        • 1. Re: ESB threading model
          Tom Eicher Newbie

          Hi,

          all AbstractActionPipelineProcessors must be "reentrant" in the way that
          multiple message on the same service go through the same instance of
          the processor.

          However, if you have an AbstractActionPipelineProcessors used in two
          different services, that will be two different instances.

          That's why it's ok to store the ConfigTree as a member variable, but not
          any information related to a specific message being processed.

          Right?
          Cheers, Tom.

          • 2. Re: ESB threading model
            Kevin Conner Master

            There are two 'types' of instantiation for the processors, depending on how they are written.

            The original pipeline code in the ESB created a new instance of each action per message and invoked the process methods via reflection. In order to speed this up, while supporting existing pipelines, we added new interfaces (ActionLifecycle and its sub-interfaces) which are only instantiated once per pipeline.

            The actions implementing the new interfaces need to be thread safe, as they will be invoked concurrently.