Announcement Announcement Module
Collapse
No announcement yet.
How can I force the message builder to create an ObjectMessage given a Map payload Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I force the message builder to create an ObjectMessage given a Map payload

    I have a situation where I need to send a message to Tibco Business Connect receiver that only accepts a map in an ObjectMessage form. Is it possible to force the JMS message type to be an ObjectMessage even when my payload is a HashMap?

  • #2
    You should be able to inject your own MessageConverter implementation that always returns an ObjectMessage. Let me know how it goes.

    -Mark

    Comment


    • #3
      Created my own MessageConverter by extending SimpleMessageConverter

      In my message converter, I overrode the toMessage method and performed the Serializable check before delegating back to super. That worked.

      Comment


      • #4
        That sounds good. So you are still able to support TextMessage and BytesMessage, but you are making sure that you always create an ObjectMessage instead of MapMessage, right?

        Out of curiosity, what's the rationale for the ObjectMessage for Maps?

        Comment

        Working...
        X