activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: JMSXUserID propagation not working
Date Fri, 25 May 2012 13:55:06 GMT
On Thu, 2012-05-24 at 08:14 -0700, gauche wrote: 
> 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.

One possiblity here is that this isn't working because the JMSXUserID
value isn't returned in the ActiveMQConnectionMetaData's
getJMSXPropertyNames which could be why the mapper isn't catching that
property.  That is of course if it uses that method to catch the vendor
specific property names. 

-- 
Tim Bish
Sr Software Engineer | FuseSource Corp
tim.bish@fusesource.com | www.fusesource.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Mime
View raw message