You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by pratibhaG <pr...@in2m.com> on 2008/10/21 13:02:13 UTC
How can I refer two SAs?
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--tp20087902p20087902.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: How can I refer two SAs?
Posted by "Lukasz L." <Lu...@sabre.com>.
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.
Re: How can I refer two SAs?
Posted by pratibhaG <pr...@in2m.com>.
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?
--
View this message in context: http://www.nabble.com/How-can-I-refer-two-SAs--tp20087902p20297667.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: How can I refer two SAs?
Posted by Adrian Trenaman <tr...@progress.com>.
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?
>
Re: How can I refer two SAs?
Posted by pratibhaG <pr...@in2m.com>.
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
--
View this message in context: http://www.nabble.com/How-can-I-refer-two-SAs--tp20087902p20264461.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: How can I refer two SAs?
Posted by pratibhaG <pr...@in2m.com>.
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?
--
View this message in context: http://www.nabble.com/How-can-I-refer-two-SAs--tp20087902p20264380.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: How can I refer two SAs?
Posted by Adrian Trenaman <tr...@progress.com>.
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.
>
Re: How can I refer two SAs?
Posted by pratibhaG <pr...@in2m.com>.
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.
Re: How can I refer two SAs?
Posted by Adrian Trenaman <tr...@progress.com>.
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
Re: How can I refer two SAs?
Posted by pratibhaG <pr...@in2m.com>.
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.
--
View this message in context: http://www.nabble.com/How-can-I-refer-two-SAs--tp20087902p20263847.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: How can I refer two SAs?
Posted by Adrian Trenaman <tr...@progress.com>.
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.
>
Re: How can I refer two SAs?
Posted by pratibhaG <pr...@in2m.com>.
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.
Re: How can I refer two SAs?
Posted by Adrian Trenaman <ad...@googlemail.com>.
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
--
View this message in context: http://www.nabble.com/How-can-I-refer-two-SAs--tp20087902p20262498.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: How can I refer two SAs?
Posted by pratibhaG <pr...@in2m.com>.
Is there any work around for this problem?
-- pratibha
--
View this message in context: http://www.nabble.com/How-can-I-refer-two-SAs--tp20087902p20262321.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.