jms-source cannot be configured with a jms-template
Hello,
I am working on a Spring Integration (1.0.0m1) sample that uses both a jms-target and a jms-source in my configuration. Even though the spring-integration.xsd for 1.0.0m1 states that both jms-target and jms-source can be configured with a jms-template attribute, I get an error if I try to configure a jms-template on a jms-source node. However, I am able to configure a jms-template on a jms-target. This behavior seems inconsistent.
Snippet from spring-integration.xsd (1.0.0m1):
Quote:
<xsd:element name="jms-source">
<xsd:complexType>
<xsd:annotation>
<xsd:documentation>
Defines a jms-based source channel adapter.
</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="id" type="xsd:string"/>
<xsd:attribute name="jms-template" type="xsd:string"/>
<xsd:attribute name="connection-factory" type="xsd:string"/>
<xsd:attribute name="destination" type="xsd:string"/>
<xsd:attribute name="destination-name" type="xsd:string"/>
<xsd:attribute name="channel" type="xsd:string" use="required"/>
<xsd:attribute name="poll-period" type="xsd:int"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="jms-target">
<xsd:complexType>
<xsd:annotation>
<xsd:documentation>
Defines a jms-based target channel adapter.
</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="id" type="xsd:string"/>
<xsd:attribute name="jms-template" type="xsd:string"/>
<xsd:attribute name="connection-factory" type="xsd:string"/>
<xsd:attribute name="destination" type="xsd:string"/>
<xsd:attribute name="channel" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
In my configuration for SpringIntegration both of these things should be possible:
this works:
Quote:
<jms-target id="fooJmsProvider"
channel="fooJmsProviderChannel" jms-template="someJmsTemplate" />
this fails:
Quote:
<jms-source id="fooJmsConsumer"
channel="fooJmsConsumerChannel" jms-template="someOtherJmsTemplate" />
The actual failure message is this:
Quote:
org.springframework.beans.factory.BeanDefinitionSt oreException: Unexpected exception parsing XML document from class path resource [/spring/swiftAdapterServiceDemo.xml]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: JmsMessageDrivenSourceAdapter does not accept a 'jms-template' reference, both 'connection-factory' and 'destination' (or 'destination-name') must be provided.
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:405)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:327)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:295)
at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:108)
at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:79)
I need to use a Spring jmsTemplate to leverage the power of a messageConverter on my reply messages.
Thanks,
Brad
message-converter on jms-source not working
Hi Mark,
I built the SI code from svn , and I see that message-converter is now supported in <jms-source> namespace as follows :
<jms-source id="wmqConsumer2"
connection-factory="connectionFactoryWMQ"
destination-name="A.B.REQUEST"
message-converter="messageConverter"
channel="MyRequestChannel"/>
<beans:bean id="messageConverter" class="com.my.IncomingMessageConverter"/>
Still, the message converter is not being invoked when the message is read from the queue.. What am I missing ?