-
Sep 29th, 2008, 06:59 AM
#1
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
-
Sep 29th, 2008, 07:53 AM
#2
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
-
Forum Rules