activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gauche <>
Subject Re: JMSXUserID propagation not working
Date Thu, 24 May 2012 15:14:09 GMT
OK, I've found out what's causing this and would greatly appreciate some
advice for moving forward. I'm not even sure that this is an AMQ issue

The internal framework I depend on uses spring-integration-jms to wrap the
JMS message. The code in question looks like this:

		Map<String, Object> headers = headerMapper.toHeaders(jmsMessage);
		Message<?> requestMessage = (result instanceof Message<?>) ?
result).copyHeaders(headers).build() : 

jmsMessage in my case is an instance of ActiveMQTextMessage. It has the
userID correctly set, and the "JMSXUserID" property is not present in its
property map. This is also the case when I run the relevant unit tests in
the AMQ code base, so I assume it's all working correctly at this point.

However, the header mapper being used is DefaultJmsHeaderMapper, which is
part of spring-integration-jms. This mapper does not set JMSXUserID, and it
kind of can't without taking a dependency on AMQ. Since JmsMessage does not
have a getUserID() method, it would need to cast the message to AMQ's
Message type first.

And thus, the user ID just kind of gets lost.

I'm interested to hear whether this is an issue with AMQ,
spring-integration, neither, or both.

Meanwhile, I'm at least attempting to get this internal framework to use my
own header mapper, but it looks tedious at best.


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message