tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Laws <simonsl...@googlemail.com>
Subject Re: Filtering JMS Header in a Request/Reply SCA
Date Tue, 24 Jan 2012 15:23:52 GMT
On Mon, Jan 23, 2012 at 9:15 PM, Matt Madhavan <mattmadhavan@gmail.com> wrote:
> Hello,
> I have an SCA binding that reads a message from a JMS Queue
> (REQUEST_QUEUE)invokes a bean and sends the reply to another JMS
> Sometimes the message sender adds a replyTo Destinationmessage header value
> (Lets say OTHER_RESPONSE_QUEUE). This 'overrides' my RESPONSE_QUEUE.
> I would like an example where I can filter this Header value to that the
> reply gets put in RESPONSE_QUEUE and not in  OTHER_RESPONSE_QUEUE.
> Can some one please point me to an example please?
> Thanks in advance!
> Matt Madhavan

Hi Matt

I don't remember that there is a specific example like this but you
could do it I think by dropping in a binding interceptor using a
policy. There is a header policy for JMS you could take a look at [1]
but I'm a little confused as the interceptor doesn't seem to do
anything useful at the moment. The comment suggest that the processing
happens elsewhere. There is a test for this policy [2]. You could
write a policy specifically for redirecting the response.

The basic idea of this is that you write an policy interceptor (that
has access to the JMS message). To get this interceptor in the right
place you then write appropriate policy configuration to tell the
runtime to apply the policy to the service you are interested in. I
can give you the basic steps if looking at the code doesn't help.


[1] http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/
[2] http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/testing/itest/jms/policy-headers/

Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

View raw message