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
anymore...

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<?>) ?
                                MessageBuilder.fromMessage((Message<?>)
result).copyHeaders(headers).build() : 
                                
MessageBuilder.withPayload(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.

Thanks

--
View this message in context: 
http://activemq.2283324.n4.nabble.com/JMSXUserID-propagation-not-working-tp4644649p4652689.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to