Announcement Announcement Module
No announcement yet.
Same Message needs to go to two different Queues. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Same Message needs to go to two different Queues.

    I have a message that needs to gets converted into BytesMessage before being sent to two channels.
    Currently, I have a message that gets put into two different channels through a Router and gets routed to two different message-channel-adapters which have messageConverters for them.
    What I want to do is to instead of converting twice, can I convert once and send it to message-driven-channel-adapters without having messageConverters? If I can do that, what model do you recommend? A service-activator or anything else?

  • #2
    Without knowing much about your process beyond your description below I'd suggest a shape like Transformer > Splitter > Router
    1. Transform payload to byte array
    2. Split into 2 messages, enrich header with appropriate value for routing
    3. Route to appropriate channel adapter on header value

    I believe the default behavior of the channel adapter will extract the byte array payload for you and construct a JMS BytesMessage.


    • #3
      I think if you use receipientListRouter you don't need to split the message, just define a list of channels to route the message to


      • #4
        Ah, good suggestion rhart -- I was unfamiliar with RecipientListRouter.