How can I refer two SAs?

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I refer two SAs?

pratibhaG
I am facing a problem when two of my SAs refer each other.

1)I have two SAs one which does updateProfile Operation and another which does errorHandling
2)If any error occurs during update profile the message is sent to errorHandler to a jms error queue in errorHandling
3)I read the message from error queue and after modifications send it to resolved queue in errorHandling.
4)A jms consumer for resolved queue in errorHandling consumes the message and sends it to http provider service in updateprofile.
5)Suppose when I send a message from resolved error consumer to http provider servicemix restarts.
6)The message would be resent during servicemix restart when it starts different components
7)In my case errorHandler is started first then update profile, it gives me
ServiceName ({http://servicemix.in2m.com/operations/updateprofile}DirectorService) specified for routing, but can't find it registered

and registers this service later

How to solve this problem?
Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

Lichota, Lukasz
This seems similar to this topic: http://cwiki.apache.org/SM/discussion-forums.html#nabble-tt19165250
unfortunately it seems that there's no solution for this

pratibhaG wrote
I am facing a problem when two of my SAs refer each other.

1)I have two SAs one which does updateProfile Operation and another which does errorHandling
2)If any error occurs during update profile the message is sent to errorHandler to a jms error queue in errorHandling
3)I read the message from error queue and after modifications send it to resolved queue in errorHandling.
4)A jms consumer for resolved queue in errorHandling consumes the message and sends it to http provider service in updateprofile.
5)Suppose when I send a message from resolved error consumer to http provider servicemix restarts.
6)The message would be resent during servicemix restart when it starts different components
7)In my case errorHandler is started first then update profile, it gives me
ServiceName ({http://servicemix.in2m.com/operations/updateprofile}DirectorService) specified for routing, but can't find it registered

and registers this service later

How to solve this problem?
Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

rlg673
In reply to this post by pratibhaG
Feel free to vote for issue https://issues.apache.org/activemq/browse/SM-1607 and potentially SM-1608.

/Ron



----- Original Message ----
From: Lukasz L. <[hidden email]>
To: [hidden email]
Sent: Tuesday, October 21, 2008 7:50:47 AM
Subject: Re: How can I refer two SAs?


This seems similar to this topic:
http://cwiki.apache.org/SM/discussion-forums.html#nabble-tt19165250
unfortunately it seems that there's no solution for this


pratibhaG wrote:

>
> I am facing a problem when two of my SAs refer each other.
>
> 1)I have two SAs one which does updateProfile Operation and another which
> does errorHandling
> 2)If any error occurs during update profile the message is sent to
> errorHandler to a jms error queue in errorHandling
> 3)I read the message from error queue and after modifications send it to
> resolved queue in errorHandling.
> 4)A jms consumer for resolved queue in errorHandling consumes the message
> and sends it to http provider service in updateprofile.
> 5)Suppose when I send a message from resolved error consumer to http
> provider servicemix restarts.
> 6)The message would be resent during servicemix restart when it starts
> different components
> 7)In my case errorHandler is started first then update profile, it gives
> me
> ServiceName
> ({http://servicemix.in2m.com/operations/updateprofile}DirectorService)
> specified for routing, but can't find it registered
>
> and registers this service later
>
> How to solve this problem?
>

--
View this message in context: http://www.nabble.com/How-can-I-refer-two-SAs--tp20087902p20088598.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

pratibhaG
Is there any work around for this problem? I tried many things but the problem still exists.
-- pratibha
Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

Adrian Trenaman

pratibhaG wrote
Is there any work around for this problem? I tried many things but the problem still exists.
-- pratibha
Just a suggestion, but why not create a named JMS queue to handle the traffic from the error handler SA to the updateProfile SA? You can than have two ways in to your updateProfile service, one through HTTP for existing traffic, and another (through JMS) to handle traffic from the error resolver SA. That way, if the updateProfile SA hasn't been initialised yet, the message will just wait on the queue until it's ready.

/Ade
Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

pratibhaG
Is it something like this?
1)In error Handler I will put the message in resolved error queue.
2)In update profile I will have a jms consumer which consumes message from above queue.

--Pratibha
Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

Adrian Trenaman-2
Yup,

The "resolved error queue" becomes a nice buffer between your two SAs,  
and will hold messages until the updateProfile SA is ready to pull  
them off with a JMS consumer.

/Ade

On 31 Oct 2008, at 06:56, pratibhaG wrote:

>
> Is it something like this?
> 1)In error Handler I will put the message in resolved error queue.
> 2)In update profile I will have a jms consumer which consumes  
> message from
> above queue.
>
> --Pratibha
> --
> View this message in context: http://www.nabble.com/How-can-I-refer-two-SAs--tp20087902p20263666.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

pratibhaG
This will work for one operation, but I see a problem
If I have many operations like update profile, i have to create jms consumer for each operation which will listen to resolved error queue.
Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

Adrian Trenaman-2
True. Or you could just have one queue with one consumer, and then use  
a content-based router to route from the queue to the target  
destinations...

/Ade

On 31 Oct 2008, at 07:09, pratibhaG wrote:

> pdate profile, i have to create jms consumer
> for each operation which will listen to r

Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

pratibhaG
I have a design in which I have different SA for each operation. For example for change password I have one SA, update profile I have another. Error Handler is again a different SA.

How can I put a single jms consumer for all operations? Where to put it?
Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

Adrian Trenaman-2
Ah, I'd thought all of the operations were in the same SA. So, to make  
my idea work, you'll have to equip each SA with it's own JMSConsumer  
that listens on a named queue. Will this scale for you? How many  
operations/SAs do you have?

Alternatively, why not repackage your SUs in a smaller number of SAs  
so that you can have less JMS consumers?

/Ade

On 31 Oct 2008, at 07:31, pratibhaG wrote:

>
> I have a design in which I have different SA for each operation. For  
> example
> for change password I have one SA, update profile I have another.  
> Error
> Handler is again a different SA.
>
> How can I put a single jms consumer for all operations? Where to put  
> it?
> --
> View this message in context: http://www.nabble.com/How-can-I-refer-two-SAs--tp20087902p20264136.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

pratibhaG
Sorry but did not get this:
Alternatively, why not repackage your SUs in a smaller number of SAs  
so that you can have less JMS consumers?
Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

pratibhaG
Earlier when I started project, I had both the resolved error queue as well as jms consumer in every operation. But we changed the design just to separate the responsibilities as error handling seems to be independent part.

As I am doing only first phase of project I have only two operations other than error handling. But I can have many such operations. It would be scalable but cause redundancy


Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

Adrian Trenaman-2
In reply to this post by pratibhaG
I guess what I meant was that if you were to group your operations and  
put more than one operation into an SA, then you could have one  
incoming queue for that group of operations with a CBR to route the  
messages across. So, you'd end up having less consumers and less  
queues, at the expense of having to configure a content-based router  
in each SA.

On 31 Oct 2008, at 07:50, pratibhaG wrote:
>
> Sorry but did not get this:
> Alternatively, why not repackage your SUs in a smaller number of SAs
> so that you can have less JMS consumers?
>

Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

Jean-Baptiste Onofré
In reply to this post by pratibhaG
 Hi guys,

 maybe I don't understand correctly your discussion, but don't forget
that, if a SA contains a set of SUs, there is only one NMR in SMX and
so each SUs component are registered at the same level.
 With this behavior, you can :
 - create one SA containing one SU
 - create another SA containing one SU which use the component of the
first SU

 In the same way, using Camel (and implementing recipient EIP), you
can have one SU using two SUs from different SAs.

 But it's right that the SA has not really knowledge about the SU
orchestration into.

 Regards
 JB
 --
 Jean-Baptiste Onofré
 [hidden email]
 BuildProcess/AutoDeploy Project Leader
 http://buildprocess.sourceforge.net

 On Fri 31/10/08 15:53, Adrian Trenaman [hidden email] wrote:
 I guess what I meant was that if you were to group your operations
and
 put more than one operation into an SA, then you could have one
 incoming queue for that group of operations with a CBR to route the
 messages across. So, you'd end up having less consumers and less
 queues, at the expense of having to configure a content-based router

 in each SA.

 On 31 Oct 2008, at 07:50, pratibhaG wrote:
 >
 > Sorry but did not get this:
 > Alternatively, why not repackage your SUs in a smaller number of
SAs
 > so that you can have less JMS consumers?
 >

Reply | Threaded
Open this post in threaded view
|

Re: How can I refer two SAs?

pratibhaG
Sorry if I have misunderstood the post

I think I have done the same thing:

----create one SA containing one SU
my update profile SA contains http provider SU to which I have to send message.

----create another SA containing one SU which use the component of the first SU
my error handler SA uses the http provider from update profile.

Here I have not set any dependency or anything but I am sending the message to http provider in updateprofile just by reading the header

----In the same way, using Camel (and implementing recipient EIP), you
can have one SU using two SUs from different SAs.
 
I am using camel component in errorhandler to send message to http provider in update profile.


This is what I have done:
 
In update profile:

from("jbi:service:http://servicemix.in2m.com/operations/updateprofile/DirectorConsumerService")
        .setHeader(ErrorConstants.APPLICATION_NAME,
        constant("jbi:service:http://servicemix.in2m.com/operations/updateprofile/DirectorService"))
        .intercept(new CustomDelegateProcessor())        
        .to("jbi:service:http://servicemix.in2m.com/operations/updateprofile/DirectorService?mep=in-out");

In Error handler:

from("jbi:service:http://servicemix.in2m.com/operations/errorhandler/TransformedMessageRoutingService")
                .intercept(new CustomDelegateProcessor())
                .recipientList(header(ErrorConstants.APPLICATION_NAME).append("?mep=in-out"));

Am I right?
Or have I mistaken it?

I know there is a work around for this to create an http provider in errorhandler and then while setting header set it as
"jbi:service:http://servicemix.in2m.com/operations/errorhandler/DirectorService"

But this wont be a good project design and hence I don't want to do that.

Please help!!!!!!!!!!!!!!!