Announcement Announcement Module
Collapse
No announcement yet.
Splitter + Router Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Splitter + Router

    Hi!

    Imagine scenario:

    I have a message with a list of different kind of data (list with some kind of POJO). I would like to split that message (iterate over the list) and then route (depends on the kind of data) to different channels...Is there any way to do that?

  • #2
    Hello.
    Maybe this is enough?
    HTML Code:
    <payload-type-router input-channel="routingChannel">
      <mapping type="java.lang.String" channel="stringChannel" />
      <mapping type="java.lang.Integer" channel="integerChannel" />
    </payload-type-router>
    You determine the outbound channel on pyload type

    Nevertheless you can implement your own logic in custom router.
    Please, read this: http://static.springsource.org/sprin...outing-chapter

    Artem
    Last edited by Artem Bilan; May 31st, 2011, 04:14 AM.

    Comment


    • #3
      But I want to slice the payload to smaller messages (each having it's own type) and then (depends on type) send it to some kind of component...

      Comment


      • #4
        But this is your solution:
        HTML Code:
         <channel id="input"/>
         <channel id="router">
           </queue/>
        </channel>
           <splitter id="splitter"  ref="splitterBean"  method="split" input-channel="input" output-channel="router"/>
         
         <payload-type-router input-channel="input">
                 <mapping type="java.lang.String" channel="stringChannel" />
                 <mapping type="java.lang.Integer" channel="integerChannel" />
           </payload-type-router>
        Your splitter partitions message and sends each part to async channel for router.
        Last edited by Artem Bilan; May 31st, 2011, 07:42 AM.

        Comment


        • #5
          Thanks for Your reply...I've managed to do it in a way that You described in the post...

          Comment

          Working...
          X