Announcement Announcement Module
Collapse
No announcement yet.
JMS Consumer with JAXB-MessageListenerAdapter Question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JMS Consumer with JAXB-MessageListenerAdapter Question

    I have a JMS client and am receiving XML messages. I already have the generated source files from the XSD of the XML file that I will be receiving.

    I am unsure if I should be using the MessageListenerAdapter to convert those XMLS into JAXB Objects as follows. If this is correct, then should the onMessage of com.batch.loa.loaJMSReceiver just deal with OBjectMessages?

    Here is the config.
    <!-- and this is the message listener container -->
    <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMes sageListenerContainer">
    <property name="connectionFactory" ref="cachingConnectionFactory"/>
    <property name="destination" ref="loaReceiveQueue"/>
    <property name="messageListener" ref="loajmsListener" />
    <!--<property name="concurrentConsumers" value="5" />-->
    </bean>

    <bean id="loajmsListener" class="org.springframework.jms.listener.adapter.Me ssageListenerAdapter">
    <constructor-arg>
    <bean class="com.batch.loa.loaJMSReceiver"/>
    </constructor-arg>
    <property name="defaultListenerMethod" value="receive"/>
    <property name="messageConverter" ref="jmsMessageConverter"/>

    </bean>


    <bean id="jmsMessageConverter" class="org.springframework.jms.support.converter.M arshallingMessageConverter">
    <property name="marshaller" ref="marshaller" />
    <property name="unmarshaller" ref="marshaller" />
    </bean>


    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">

    <property name="contextPaths">
    <list>
    <value>com.cds.authz</value>
    </list>
    </property>
    </bean>


    Thanks in advance.
Working...
X