We are trying to configure multiple Spring-WS endpoints as durable subscribers on the same topic. We want the spring-ws endpoints to subscribe to the same message.
However, when we configure two spring-ws endpoints as durable subscribers for the same topic only one of the endpoints is invoked when a SOAP-message is put on the topic. We would like both endpoints to be invoked.
This is our configuration:
As can be seen from the configuration above these lines:Code:<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller" p:contextPath="package.event.ws.schemas" /> <bean id="subscriber1" class="package.subscribers.examples.Subscriber1"> <property name="marshaller" ref="marshaller" /> <property name="unmarshaller" ref="marshaller" /> </bean> <bean id="subscriber2" class="package.subscribers.examples.Subscriber2"> <property name="marshaller" ref="marshaller" /> <property name="unmarshaller" ref="marshaller" /> </bean> <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" /> <bean id="payloadMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping"> <property name="mappings"> <props> <prop key="{http://www.skat.package/ws/schemas}AnnounceEventRequest">subscriber1</prop> <prop key="{http://www.skat.package/ws/schemas}AnnounceEventRequest">subscriber2</prop> </props> </property> <property name="interceptors"> <bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/> </property> </bean> <!-- Spring-WS beans --> <bean id="messageDispatcher" class="org.springframework.ws.soap.server.SoapMessageDispatcher"> <description> The MessageDispatcher is responsible for routing messages to endpoints. </description> <property name="endpointMappings"> <ref local="payloadMapping" /> </property> </bean> <bean id="wsListener" class="org.springframework.ws.transport.jms.WebServiceMessageListener"> <property name="messageFactory" ref="messageFactory" /> <property name="messageReceiver" ref="messageDispatcher" /> </bean> <jms:listener-container container-type="default" connection-factory="jmsConsumerConnectionFactory" acknowledge="auto"> <jms:listener destination="org.springbyexample.jms.test" ref="wsListener" /> </jms:listener-container>
<prop key="{http://www.skat.package/ws/schemas}AnnounceEventRequest">subscriber1</prop>
<prop key="{http://www.skat.package/ws/schemas}AnnounceEventRequest">subscriber2</prop>
should map the AnnounceEventRequest to both Subscribers (Or that is what we think). But only one of these endpoints are actually invoked.
Hope that somebody can shed some light on what we are doing wrong.
Thanks in advance.
Best Regards Johan


Reply With Quote
