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

  • Propagate JMS user properties to response


    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=" 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">
    class=" viceMessageListener">
    <property name="messageFactory" ref="messageFactory" />
    <property name="messageReceiver"
    ref="messageDispatcher" />

    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.");

    Thanks in advance

  • #2
    How can i propagate jms user defiend properties to the respŤonse message