Results 1 to 4 of 4

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

  1. #1
    Join Date
    May 2010
    Posts
    6

    Default 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

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

    -Mark

  3. #3
    Join Date
    May 2010
    Posts
    6

    Default 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.

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •