5 Replies Latest reply on Sep 4, 2008 9:25 AM by Tom Fennelly

    message splitter

    Sebastian Pätzold Newbie


      I've currently evaluating JBoss and I have to sa it is powerful. Currently I'm trying to get some ideas to work. I try to describe my scenario:

      I have a legacy application for managing university course related informations. It has only a XML export function, which outputs all courses and releated information in a single XML file. Now I would like to read this XML file periodically with a file gateway and forward it to an action pipeline. The first action is a Smooks (XSLT) transformation which takes one course element after another and transforms it in a standardized course message format. However, a single course message should contain only the data for a single course. So this means I have one inbound message (the course message from the legacy app) and several outbound messages (standardized course messages).

      As far as I am aware one action outputs only one message. So how can I split an inbound message in several outbound messages? Is there a message splitter class? I've found nothing about this topic.

      Any help is appreciated!

        • 1. Re: message splitter
          Sebastian Pätzold Newbie


          I've found the aggregator quickstart which has a splitter service included. However, I don't really understand it.

           <action class="org.jboss.soa.esb.actions.StaticRouter" name="StaticRouter">
           <property name="destinations"> <!-- process="split" is the trick -->
           <route-to destination-name="red" service-category="RedTeam" service-name="GoRed" />
           <route-to destination-name="blue" service-category="BlueTeam" service-name="GoBlue" />
           <route-to destination-name="green" service-category="GreenTeam" service-name="GoGreen" />

          Where is this process="split" trick used?

          Well, after some more thinking I think that I need an action which evaluates an xpath expression and packs each of the results in a ESB message which can then be processed in a second service with Smooks. I guess there are no classes which do just that, but it should be fairly simple to implement by myself.


          • 2. Re: message splitter
            Kurt Stam Master

            Any router with multiple destinations will split the message. It's not really a trick anymore ;)


            • 3. Re: message splitter
              Mike Trzcianowski Newbie

              How does the router split the message? How does it know where to split the message?

              The parameters for the router only seem to indicate where to send the message but not how to split it.

              I'm currently using smooks for splitting and routing but I how would I do that with a static router for example?

              • 4. Re: message splitter
                Mike Trzcianowski Newbie

                Well, I get to answer my question too. :)

                Message splitting by the router does not really mean "message splitting" but rather "process flow splitting". A static router with multiple destinations will send the same message to multiple services at the same time for parallel processing.

                • 5. Re: message splitter
                  Tom Fennelly Master

                  Sorry for not catching this one earlier.

                  You are totally correct.. the Splitter Router doesn't actually split the message into smaller messages. You need to use the Smooks stuff for this. I assume you've seen the huge, split, transform and route quickstart??