5 Replies Latest reply on Nov 13, 2008 4:57 AM by kconner

    ESB Action transactions and synhronization questions

    denix

      Hi Folks,

      I tried to figure out how JBoss ESB manages actions if multiply threads wants to invoke the same action
      I created scheduler which invokes every 5 sec. my service, which triggers RequestResponse action.
      I deployed service and connected via remote debugging and suspended first thread in process method.
      In 5 sec. no other thread in the process method. It means that JBoss ESB uses one action for all requests?
      i.e. no action pool? I added maxThreads="5" to scheduled-listener, but still result the same.
      Is it make scene to setup action pool and how to do it?

        • 1. Re: ESB Action transactions and synhronization questions
          denix

          ICE in docs

          To implement a custom Action Processor, simply implement the
          org.jboss.soa.esb.actions.ActionPipelineProcessor interface.
          This interface supports implementation of stateless actions that have a managed lifecycle. A
          single instance of a class implementing this interface is instantiated on a per pipeline basis (i.e.
          per action configuration). This means you can cache resources needed by the action in the
          initialise method, and clean them up in the destroy method.


          But it means that all threads access action by turns, so it is no synchronization needed?

          • 2. Re: ESB Action transactions and synhronization questions
            denix

            But if action executes one by one why we need
            maxThreads="5"?

            • 3. Re: ESB Action transactions and synhronization questions
              kconner

              It is not used in the scheduled listener case, but for all other listeners it will be.

              If you use a POJO as an action then a new instance will be created for every message passing through the pipeline. This is for historical reasons.

              If your action implements the ActionPipelineProcessor or ActionLifecycle interfaces then there will be a single instance created for each pipeline (incoming transport). The action must be thread safe as it is possible for multiple threads to access it concurrently.

              • 4. Re: ESB Action transactions and synhronization questions
                denix

                Thanks Kevin,

                Okey, if action processes each time when new message arrives in new thread, why we need maxThreads="5" param? If all 5 threads busy than 6nd request will wait? Or what behavior should be?

                • 5. Re: ESB Action transactions and synhronization questions
                  kconner

                  The parameter limits the number of concurrent jobs which can be processed by the listeners, with any further jobs having to wait for an active one to finish before it can be processed.

                  Kev