Announcement Announcement Module
Collapse
No announcement yet.
Propagate JMS user properties to response Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    How can i propagate jms user defiend properties to the respŤonse message
    Thanks

    Comment

    Working...
    X