Announcement Announcement Module
Collapse
No announcement yet.
org.springframework.integration.message.GenericMes sage to javax.jms.Me Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.springframework.integration.message.GenericMes sage to javax.jms.Me

    Hi,

    Is there any way I can cast org.springframework.integration.message.GenericMes sage to javax.jms.Message?

    I tried to do so and i'm getting ClassCastException. I'm confused here. Y is the GenericMessage not a type of javax.jms.Message?

    Any help here is appreciated.

    Thanks,
    Jey

  • #2
    No, GenericMessage is a Spring Integration type, not a JMS type. Spring Integration is a general messaging framework and not tied to JMS, although it does provide JMS adapters and gateways.

    http://static.springsource.org/sprin.../html/jms.html

    If you use the standard Spring Integration JMS adapters, they use a header mapper and message converter to convert between the Spring Integration message and a JMS message.

    Comment


    • #3
      So what if I need to place a GenericMessage in a queue without using spring integration components? I want to use jmstemplate to send the message. How to do that?

      Comment


      • #4
        I don't understand the question - if you are using GenericMessage, you "ARE" using Spring Integration.

        The outbound channel adapter wraps the JmsTemplate and does all the mapping for you.

        So, why not just use a JmsSendingMessageHandler and call its handleMessage() method?

        Comment

        Working...
        X