3 Replies Latest reply on Feb 11, 2008 9:46 AM by marklittle

    Master / Worker Pattern & jvm

    charliem

      Hi,

      1 ) Question concerning master/worker pattern
      I would like to know if JBoss ESB implement the Master/Worker pattern which is currently used to parrallelizing work ? If it is the case, How can we achieve the following scenario using ESB ?

      Scenario : A file copied in a directory contains thousands sales intructions. In order to process it in a efficient and quick way, the instructions must be splitted in group of hundreds instructions and associated to different work threads/queues. The master process which is probably a task (created through jbpl) will wait until the workers have finished their work.

      2) Can we split the work on different java virtual machine like it is possible to with Terracota product which is based on a hub-and-spoke architecture ?

      Regards,

        • 1. Re: Master / Worker Pattern & jvm
          marklittle

          We've been doing some work in that area with a customer. It's possible with the 4.2.1 ESB, but it'll be a lot easier in the next community and platform releases.

          If you have to roll your own, then you could use the event manager, for instance (if you don't want to tie yourself to JMS, say). Stripe the data in whatever way makes sense for you and then publish a notification on to the event bus. Depending on how you want to implement this, the event listeners could compete for the work. If they do the message receipt and work in the scope of the same transaction, then a failure will obviously place the work back in the pool for some other listener to pull.

          • 2. Re: Master / Worker Pattern & jvm
            charliem

            And concerning my second question (split on several machines) ?

            • 3. Re: Master / Worker Pattern & jvm
              marklittle

              If the workers are connected using JMS then they can be on different machines.