You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2012/02/01 11:58:14 UTC

Re: Filtering JMS Header in a Request/Reply SCA

On Fri, Jan 27, 2012 at 11:26 PM, Matt Madhavan <ma...@gmail.com> wrote:
> Hi Simon,
> Can u please throw some more light on this one? Any additional information
> will be appreciated.
>
> Thanks
> Matt
>
> On Jan 27, 2012 1:15 PM, "Simon Laws" <si...@googlemail.com> wrote:
>>
>> On Thu, Jan 26, 2012 at 11:31 PM, Matt Madhavan <ma...@gmail.com>
>> wrote:
>> > HiSimon,
>> > Is there any sample for SCA 1.x? We are limited to IBM implementation
>> > which
>> > is 1.x.
>> >
>> > Thanks
>> > Matt
>> >
>> >
>> > On Tue, Jan 24, 2012 at 9:23 AM, Simon Laws <si...@googlemail.com>
>> > wrote:
>> >>
>> >> On Mon, Jan 23, 2012 at 9:15 PM, Matt Madhavan <ma...@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
>> >> > Queue(RESPONSE_QUEUE).
>> >> >
>> >> > 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.
>> >>
>> >> Simon
>> >>
>> >> [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
>> >
>> >
>> Hi Matt
>>
>> IIRC in the IBM implementation there is a customer wire format handler
>> in the JMS binding that we don't have in Tuscany. If that has access
>> to the Message you may be able to do something directly with that.
>>
>> Regards
>>
>> Simon
>>
>> --
>> Apache Tuscany committer: tuscany.apache.org
>> Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Hi Matt

I looked into this and it's not obvious you can get at the whole JMS
message in the custom wire format handler and WebSphere doesn't
currently expose a mechanism for adding arbitrary interceptors like
Tuscany does. A question for the WebSphere list I think. Try
https://www.ibm.com/developerworks/forums/forum.jspa?forumID=1662

Regards

Simon

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

Re: Filtering JMS Header in a Request/Reply SCA

Posted by Matt Madhavan <ma...@gmail.com>.
Hi Simon,
This is the approach we are taking now. But I would like to have a uniform
and cleaner approach. We use MDB, SCA and in the feature Camel.

If I can find a way to fillter JMS headers it would be great.

Thanks
Matt


On Wed, Feb 1, 2012 at 5:17 AM, Simon Laws <si...@googlemail.com>wrote:

> On Wed, Feb 1, 2012 at 10:58 AM, Simon Laws <si...@googlemail.com>
> wrote:
> > On Fri, Jan 27, 2012 at 11:26 PM, Matt Madhavan <ma...@gmail.com>
> wrote:
> >> Hi Simon,
> >> Can u please throw some more light on this one? Any additional
> information
> >> will be appreciated.
> >>
> >> Thanks
> >> Matt
> >>
> >> On Jan 27, 2012 1:15 PM, "Simon Laws" <si...@googlemail.com>
> wrote:
> >>>
> >>> On Thu, Jan 26, 2012 at 11:31 PM, Matt Madhavan <
> mattmadhavan@gmail.com>
> >>> wrote:
> >>> > HiSimon,
> >>> > Is there any sample for SCA 1.x? We are limited to IBM implementation
> >>> > which
> >>> > is 1.x.
> >>> >
> >>> > Thanks
> >>> > Matt
> >>> >
> >>> >
> >>> > On Tue, Jan 24, 2012 at 9:23 AM, Simon Laws <
> simonslaws@googlemail.com>
> >>> > wrote:
> >>> >>
> >>> >> 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
> >>> >> > Queue(RESPONSE_QUEUE).
> >>> >> >
> >>> >> > 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.
> >>> >>
> >>> >> Simon
> >>> >>
> >>> >> [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
> >>> >
> >>> >
> >>> Hi Matt
> >>>
> >>> IIRC in the IBM implementation there is a customer wire format handler
> >>> in the JMS binding that we don't have in Tuscany. If that has access
> >>> to the Message you may be able to do something directly with that.
> >>>
> >>> Regards
> >>>
> >>> Simon
> >>>
> >>> --
> >>> Apache Tuscany committer: tuscany.apache.org
> >>> Co-author of a book about Tuscany and SCA: tuscanyinaction.com
> >
> > Hi Matt
> >
> > I looked into this and it's not obvious you can get at the whole JMS
> > message in the custom wire format handler and WebSphere doesn't
> > currently expose a mechanism for adding arbitrary interceptors like
> > Tuscany does. A question for the WebSphere list I think. Try
> > https://www.ibm.com/developerworks/forums/forum.jspa?forumID=1662
> >
> > Regards
> >
> > Simon
> >
> > --
> > Apache Tuscany committer: tuscany.apache.org
> > Co-author of a book about Tuscany and SCA: tuscanyinaction.com
>
> Another thought on this is that you could define your service
> interface with a single operation that takes a JMS message and reset
> the replyTo destination inside that service implementation. This is a
> more manual approach and you'd have to take responsibility of
> forwarding the message on to the real service implementation but it
> may allow you to do what you need to do.
>
> Regards
>
> Simon
>
> --
> Apache Tuscany committer: tuscany.apache.org
> Co-author of a book about Tuscany and SCA: tuscanyinaction.com
>

Re: Filtering JMS Header in a Request/Reply SCA

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Feb 1, 2012 at 10:58 AM, Simon Laws <si...@googlemail.com> wrote:
> On Fri, Jan 27, 2012 at 11:26 PM, Matt Madhavan <ma...@gmail.com> wrote:
>> Hi Simon,
>> Can u please throw some more light on this one? Any additional information
>> will be appreciated.
>>
>> Thanks
>> Matt
>>
>> On Jan 27, 2012 1:15 PM, "Simon Laws" <si...@googlemail.com> wrote:
>>>
>>> On Thu, Jan 26, 2012 at 11:31 PM, Matt Madhavan <ma...@gmail.com>
>>> wrote:
>>> > HiSimon,
>>> > Is there any sample for SCA 1.x? We are limited to IBM implementation
>>> > which
>>> > is 1.x.
>>> >
>>> > Thanks
>>> > Matt
>>> >
>>> >
>>> > On Tue, Jan 24, 2012 at 9:23 AM, Simon Laws <si...@googlemail.com>
>>> > wrote:
>>> >>
>>> >> On Mon, Jan 23, 2012 at 9:15 PM, Matt Madhavan <ma...@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
>>> >> > Queue(RESPONSE_QUEUE).
>>> >> >
>>> >> > 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.
>>> >>
>>> >> Simon
>>> >>
>>> >> [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
>>> >
>>> >
>>> Hi Matt
>>>
>>> IIRC in the IBM implementation there is a customer wire format handler
>>> in the JMS binding that we don't have in Tuscany. If that has access
>>> to the Message you may be able to do something directly with that.
>>>
>>> Regards
>>>
>>> Simon
>>>
>>> --
>>> Apache Tuscany committer: tuscany.apache.org
>>> Co-author of a book about Tuscany and SCA: tuscanyinaction.com
>
> Hi Matt
>
> I looked into this and it's not obvious you can get at the whole JMS
> message in the custom wire format handler and WebSphere doesn't
> currently expose a mechanism for adding arbitrary interceptors like
> Tuscany does. A question for the WebSphere list I think. Try
> https://www.ibm.com/developerworks/forums/forum.jspa?forumID=1662
>
> Regards
>
> Simon
>
> --
> Apache Tuscany committer: tuscany.apache.org
> Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Another thought on this is that you could define your service
interface with a single operation that takes a JMS message and reset
the replyTo destination inside that service implementation. This is a
more manual approach and you'd have to take responsibility of
forwarding the message on to the real service implementation but it
may allow you to do what you need to do.

Regards

Simon

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