Results 1 to 1 of 1

Thread: Multiple Subscribers for the same message

  1. #1
    Join Date
    Jan 2010
    Posts
    2

    Default Multiple Subscribers for the same message

    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:

    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>
    As can be seen from the configuration above these lines:


    <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
    Last edited by JohanBjorn; Feb 2nd, 2010 at 01:19 AM.

Tags for this Thread

Posting Permissions

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