You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Ridire123 <ri...@gmail.com> on 2008/08/18 15:27:01 UTC

JMS Provider -- Header access?

I am using a JMS Provider to implement a publish-subscribe pattern and am
having no problems with the default provider, as expected.  However, I want
to make the header properties on the JMS message dynamic, so things like
time to live, priority, etc. are to be pulled from the message and set based
on their values.  I am having a problem finding any place in the provider
where implementing this is possible, though.  I expected it would be
available in the marshaller, but have not had any success there.  Is this
even achievable?

Thanks for any help,
-Ridire123
-- 
View this message in context: http://www.nabble.com/JMS-Provider----Header-access--tp19031372p19031372.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: JMS Provider -- Header access?

Posted by Ridire123 <ri...@gmail.com>.
Thank you for the reply, Gert.  I have done that and am able to add
additional application specific properties to the JMS message just fine.  I
am asking in specific regard to the JMS Header properties, such as
JMSPriority, JMSExpiration (TimeToLive), etc.  I know the <jms:provider/>
endpoint allows you set these statically (the same for all messages that
pass through), but I am looking to make them dynamic based on a section of
the message being sent.  Looking at the code, it looks like these are set in
the JMSTemplate in the endpoint's start() method (based on data members in
the endpoint, which I assume are set from the xbean, for instance) and then
are never changed again.  I've followed the method calls all the way down to
the JMS send in the Spring Framework and these JMS Header properties are
definitely never retrieved from the message properties (the final send call
includes a message producer, the priority, timetolive, and one other header
prop I cannot recall).  It seems to me that the JMS header properties should
be message specific as opposed to endpoint specific, but perhaps I am not
understanding the JMS API correctly.

Thanks,
-Ridire123


Gert Vanthienen wrote:
> 
> -Ridire123,
> 
> You can do that by implementing the JmsProviderMarshaler interface or 
> extending the DefaultJmsProviderMarshaler and pluging that one into your 
> <jms:provider/> endpoint.
> The DefaultJmsProviderMarshaler already shows you how to create the JMS 
> message and set properties on it (from the properties map), so you just 
> have to override that method and add some more properties based on your 
> message payload.
> 
> Regards,
> 
> Gert
> 
> Ridire123 wrote:
>> I am using a JMS Provider to implement a publish-subscribe pattern and am
>> having no problems with the default provider, as expected.  However, I
>> want
>> to make the header properties on the JMS message dynamic, so things like
>> time to live, priority, etc. are to be pulled from the message and set
>> based
>> on their values.  I am having a problem finding any place in the provider
>> where implementing this is possible, though.  I expected it would be
>> available in the marshaller, but have not had any success there.  Is this
>> even achievable?
>>
>> Thanks for any help,
>> -Ridire123
>>   
> 
> 
> 
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
> 

-- 
View this message in context: http://www.nabble.com/JMS-Provider----Header-access--tp19031372p19107533.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: JMS Provider -- Header access?

Posted by Gert Vanthienen <ge...@skynet.be>.
-Ridire123,

You can do that by implementing the JmsProviderMarshaler interface or 
extending the DefaultJmsProviderMarshaler and pluging that one into your 
<jms:provider/> endpoint.
The DefaultJmsProviderMarshaler already shows you how to create the JMS 
message and set properties on it (from the properties map), so you just 
have to override that method and add some more properties based on your 
message payload.

Regards,

Gert

Ridire123 wrote:
> I am using a JMS Provider to implement a publish-subscribe pattern and am
> having no problems with the default provider, as expected.  However, I want
> to make the header properties on the JMS message dynamic, so things like
> time to live, priority, etc. are to be pulled from the message and set based
> on their values.  I am having a problem finding any place in the provider
> where implementing this is possible, though.  I expected it would be
> available in the marshaller, but have not had any success there.  Is this
> even achievable?
>
> Thanks for any help,
> -Ridire123
>