Results 1 to 2 of 2

Thread: Propagate JMS user properties to response

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Posts
    11

    Default Propagate JMS user properties to response

    Hello,

    i would like to propagate jms request user properties to the response.

    For example i could define an user property 'application'
    and set it to some value:

    textMessage.setStringProperty("application", "****");

    i would like to have this property in the response.

    I'am using spring-ws with jms transport

    <bean id="messageDispatcher"
    class="org.springframework.ws.soap.server.SoapMess ageDispatcher" />


    <bean class="org.springframework.jms.listener.DefaultMes sageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory" />
    <property name="destination" ref="requestsQueue" />
    <property name="taskExecutor" ref="taskExecutor" />
    <property name="messageListener">
    <bean
    class="org.springframework.ws.transport.jms.WebSer viceMessageListener">
    <property name="messageFactory" ref="messageFactory" />
    <property name="messageReceiver"
    ref="messageDispatcher" />
    </bean>
    </property>
    </bean>

    The problem is that all the properties set in the request are lost.
    I can not intercept the message before it's sent as the java class which is instatiated to send the message is not a spring bean.
    A new instance is created for each message sending
    protected final void handleMessage(Message request, Session session) throws Exception {
    WebServiceConnection connection;
    if (request instanceof BytesMessage) {
    connection = new JmsReceiverConnection((BytesMessage) request, session);
    }
    else if (request instanceof TextMessage) {
    connection = new JmsReceiverConnection((TextMessage) request, textMessageEncoding, session);
    }
    else {
    throw new IllegalArgumentException("Wrong message type: [" + request.getClass() +
    "]. Only BytesMessages or TextMessages can be handled.");
    }
    handleConnection(connection);
    }

    Thanks in advance

  2. #2
    Join Date
    Mar 2008
    Posts
    11

    Default

    How can i propagate jms user defiend properties to the respèonse message
    Thanks

Posting Permissions

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