You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Song Thuy Nguyen <pr...@biaqua.de> on 2010/02/24 15:20:48 UTC

Failover endpoints

Hello, 

 

I am reviewing the failoverendpoint of synapse. I have looked into the samples and the javadoc, but I am still unsure about the descriptions, I guess there is some confusion here.

The description about failoverendpoints on http://synapse.apache.org/Synapse_Configuration_Language.html is:

 

"Failover endpoints send messages to the listed endpoints with the following failover behavior. At the start, the first listed endpoint is selected as the primary and all other endpoints are treated as backups. Incoming messages are always sent only to the primary endpoint. If the primary endpoint fails, next active endpoint is selected as the primary and failed endpoint is marked as inactive. Thus it sends messages successfully as long as there is at least one active endpoint among the listed endpoints. "

 

So it is about one primary endpoint and the following are the alternative endpoints that will become the primary endpoint if the former primary endpoint fails. Whenever the current primary endpoint fails, synapse will iterate the list of endpoints from the top to the bottom to find an active endpoint.

 

But in the javadoc of the FailoverEndpoint http://synapse.apache.org/apidocs/org/apache/synapse/endpoints/FailoverEndpoint.html says:

 

"FailoverEndpoint can have multiple child endpoints. It will always try to send messages to current endpoint. If the current endpoint is failing, it gets another active endpoint from the list and make it the current endpoint. Then the message is sent to the current endpoint and if it fails, above procedure repeats until there are no active endpoints. If all endpoints are failing and parent endpoint is available, this will delegate the problem to the parent endpoint. If parent endpoint is not available it will pop the next FaultHandler and delegate the problem to that."

 

Here it is about current endpoint, child endpoints and parent endpoint. While the child endpoints probably match to the alternative endpoints in the first description, I'm not sure about the the parent and the current endpoint term. My guess is that with the term "parent endpoint" the first child (<endpoint>) of the failover element and the "current endpoint" is the currently active one which make it match the "assigned  primary" endpoint in the first description.

Can anyone approve my guess?

I have to be picky about this as I am trying to reuse the Failoverendpoint class to write a custom mediator. 

 

Greetings,

 

 

Song Thuy Nguyen

 

 


Re: Failover endpoints

Posted by Rajika Kumarasiri <ra...@wso2.com>.
On Wed, Feb 24, 2010 at 7:50 PM, Song Thuy Nguyen <pr...@biaqua.de>wrote:

> Hello,
>

hi,
I think the first description is correct (which is in the configuration
language), if you look at the sample #53, you'll see this behaviour.

Rajika

>
>
>
> I am reviewing the failoverendpoint of synapse. I have looked into the
> samples and the javadoc, but I am still unsure about the descriptions, I
> guess there is some confusion here.
>
> The description about failoverendpoints on
> http://synapse.apache.org/Synapse_Configuration_Language.html is:
>
>
>
> "Failover endpoints send messages to the listed endpoints with the
> following failover behavior. At the start, the first listed endpoint is
> selected as the primary and all other endpoints are treated as backups.
> Incoming messages are always sent only to the primary endpoint. If the
> primary endpoint fails, next active endpoint is selected as the primary and
> failed endpoint is marked as inactive. Thus it sends messages successfully
> as long as there is at least one active endpoint among the listed endpoints.
> "
>
>
>
> So it is about one primary endpoint and the following are the alternative
> endpoints that will become the primary endpoint if the former primary
> endpoint fails. Whenever the current primary endpoint fails, synapse will
> iterate the list of endpoints from the top to the bottom to find an active
> endpoint.
>
>
>
> But in the javadoc of the FailoverEndpoint
> http://synapse.apache.org/apidocs/org/apache/synapse/endpoints/FailoverEndpoint.htmlsays:
>
>
>
> "FailoverEndpoint can have multiple child endpoints. It will always try to
> send messages to current endpoint. If the current endpoint is failing, it
> gets another active endpoint from the list and make it the current endpoint.
> Then the message is sent to the current endpoint and if it fails, above
> procedure repeats until there are no active endpoints. If all endpoints are
> failing and parent endpoint is available, this will delegate the problem to
> the parent endpoint. If parent endpoint is not available it will pop the
> next FaultHandler and delegate the problem to that."
>
>
>
> Here it is about current endpoint, child endpoints and parent endpoint.
> While the child endpoints probably match to the alternative endpoints in the
> first description, I'm not sure about the the parent and the current
> endpoint term. My guess is that with the term "parent endpoint" the first
> child (<endpoint>) of the failover element and the "current endpoint" is the
> currently active one which make it match the "assigned  primary" endpoint in
> the first description.
>
> Can anyone approve my guess?
>
> I have to be picky about this as I am trying to reuse the Failoverendpoint
> class to write a custom mediator.
>
>
>
> Greetings,
>
>
>
>
>
> Song Thuy Nguyen
>
>
>
>
>
>


-- 
http://rajikak.blogspot.com/

Re: Failover endpoints

Posted by Ruwan Linton <ru...@gmail.com>.
Hi Song,

Nice to hear you got it to work.

Thanks,
Ruwan

On Wed, Feb 24, 2010 at 8:44 PM, Song Thuy Nguyen <pr...@biaqua.de>wrote:

> Thank you Rajika and Ruwan for the quick reply. I saw the sample #53 and
> also sucessfulyl implement my own failover. It's just the term "parent
> endpoint" in the javadoc that confused me, I had thought I missed out
> something..
>
> Song Thuy Nguyen
>
> > -----Original Message-----
> > From: Ruwan Linton [mailto:ruwan.linton@gmail.com]
> > Sent: Wednesday, February 24, 2010 3:42 PM
> > To: user@synapse.apache.org
> > Subject: Re: Failover endpoints
> >
> > Hi Song,
> >
> > Yes, you are correct.
> >
> > Thanks,
> > Ruwan
> >
> > On Wed, Feb 24, 2010 at 7:50 PM, Song Thuy Nguyen
> > <pr...@biaqua.de>wrote:
> >
> > > Hello,
> > >
> > >
> > >
> > > I am reviewing the failoverendpoint of synapse. I have looked into
> > the
> > > samples and the javadoc, but I am still unsure about the
> > descriptions, I
> > > guess there is some confusion here.
> > >
> > > The description about failoverendpoints on
> > > http://synapse.apache.org/Synapse_Configuration_Language.html is:
> > >
> > >
> > >
> > > "Failover endpoints send messages to the listed endpoints with the
> > > following failover behavior. At the start, the first listed endpoint
> > is
> > > selected as the primary and all other endpoints are treated as
> > backups.
> > > Incoming messages are always sent only to the primary endpoint. If
> > the
> > > primary endpoint fails, next active endpoint is selected as the
> > primary and
> > > failed endpoint is marked as inactive. Thus it sends messages
> > successfully
> > > as long as there is at least one active endpoint among the listed
> > endpoints.
> > > "
> > >
> > >
> > >
> > > So it is about one primary endpoint and the following are the
> > alternative
> > > endpoints that will become the primary endpoint if the former primary
> > > endpoint fails. Whenever the current primary endpoint fails, synapse
> > will
> > > iterate the list of endpoints from the top to the bottom to find an
> > active
> > > endpoint.
> > >
> > >
> > >
> > > But in the javadoc of the FailoverEndpoint
> > >
> > http://synapse.apache.org/apidocs/org/apache/synapse/endpoints/Failover
> > Endpoint.htmlsays:
> > >
> > >
> > >
> > > "FailoverEndpoint can have multiple child endpoints. It will always
> > try to
> > > send messages to current endpoint. If the current endpoint is
> > failing, it
> > > gets another active endpoint from the list and make it the current
> > endpoint.
> > > Then the message is sent to the current endpoint and if it fails,
> > above
> > > procedure repeats until there are no active endpoints. If all
> > endpoints are
> > > failing and parent endpoint is available, this will delegate the
> > problem to
> > > the parent endpoint. If parent endpoint is not available it will pop
> > the
> > > next FaultHandler and delegate the problem to that."
> > >
> > >
> > >
> > > Here it is about current endpoint, child endpoints and parent
> > endpoint.
> > > While the child endpoints probably match to the alternative endpoints
> > in the
> > > first description, I'm not sure about the the parent and the current
> > > endpoint term. My guess is that with the term "parent endpoint" the
> > first
> > > child (<endpoint>) of the failover element and the "current endpoint"
> > is the
> > > currently active one which make it match the "assigned  primary"
> > endpoint in
> > > the first description.
> > >
> > > Can anyone approve my guess?
> > >
> > > I have to be picky about this as I am trying to reuse the
> > Failoverendpoint
> > > class to write a custom mediator.
> > >
> > >
> > >
> > > Greetings,
> > >
> > >
> > >
> > >
> > >
> > > Song Thuy Nguyen
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Ruwan Linton
> > Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
> > WSO2 Inc.; http://wso2.org
> > email: ruwan@wso2.com; cell: +94 77 341 3097
> > blog: http://ruwansblog.blogspot.com
>
>


-- 
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

RE: Failover endpoints

Posted by Song Thuy Nguyen <pr...@biaqua.de>.
Thank you Rajika and Ruwan for the quick reply. I saw the sample #53 and also sucessfulyl implement my own failover. It's just the term "parent endpoint" in the javadoc that confused me, I had thought I missed out something..

Song Thuy Nguyen

> -----Original Message-----
> From: Ruwan Linton [mailto:ruwan.linton@gmail.com]
> Sent: Wednesday, February 24, 2010 3:42 PM
> To: user@synapse.apache.org
> Subject: Re: Failover endpoints
> 
> Hi Song,
> 
> Yes, you are correct.
> 
> Thanks,
> Ruwan
> 
> On Wed, Feb 24, 2010 at 7:50 PM, Song Thuy Nguyen
> <pr...@biaqua.de>wrote:
> 
> > Hello,
> >
> >
> >
> > I am reviewing the failoverendpoint of synapse. I have looked into
> the
> > samples and the javadoc, but I am still unsure about the
> descriptions, I
> > guess there is some confusion here.
> >
> > The description about failoverendpoints on
> > http://synapse.apache.org/Synapse_Configuration_Language.html is:
> >
> >
> >
> > "Failover endpoints send messages to the listed endpoints with the
> > following failover behavior. At the start, the first listed endpoint
> is
> > selected as the primary and all other endpoints are treated as
> backups.
> > Incoming messages are always sent only to the primary endpoint. If
> the
> > primary endpoint fails, next active endpoint is selected as the
> primary and
> > failed endpoint is marked as inactive. Thus it sends messages
> successfully
> > as long as there is at least one active endpoint among the listed
> endpoints.
> > "
> >
> >
> >
> > So it is about one primary endpoint and the following are the
> alternative
> > endpoints that will become the primary endpoint if the former primary
> > endpoint fails. Whenever the current primary endpoint fails, synapse
> will
> > iterate the list of endpoints from the top to the bottom to find an
> active
> > endpoint.
> >
> >
> >
> > But in the javadoc of the FailoverEndpoint
> >
> http://synapse.apache.org/apidocs/org/apache/synapse/endpoints/Failover
> Endpoint.htmlsays:
> >
> >
> >
> > "FailoverEndpoint can have multiple child endpoints. It will always
> try to
> > send messages to current endpoint. If the current endpoint is
> failing, it
> > gets another active endpoint from the list and make it the current
> endpoint.
> > Then the message is sent to the current endpoint and if it fails,
> above
> > procedure repeats until there are no active endpoints. If all
> endpoints are
> > failing and parent endpoint is available, this will delegate the
> problem to
> > the parent endpoint. If parent endpoint is not available it will pop
> the
> > next FaultHandler and delegate the problem to that."
> >
> >
> >
> > Here it is about current endpoint, child endpoints and parent
> endpoint.
> > While the child endpoints probably match to the alternative endpoints
> in the
> > first description, I'm not sure about the the parent and the current
> > endpoint term. My guess is that with the term "parent endpoint" the
> first
> > child (<endpoint>) of the failover element and the "current endpoint"
> is the
> > currently active one which make it match the "assigned  primary"
> endpoint in
> > the first description.
> >
> > Can anyone approve my guess?
> >
> > I have to be picky about this as I am trying to reuse the
> Failoverendpoint
> > class to write a custom mediator.
> >
> >
> >
> > Greetings,
> >
> >
> >
> >
> >
> > Song Thuy Nguyen
> >
> >
> >
> >
> >
> >
> 
> 
> --
> Ruwan Linton
> Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
> WSO2 Inc.; http://wso2.org
> email: ruwan@wso2.com; cell: +94 77 341 3097
> blog: http://ruwansblog.blogspot.com


Re: Failover endpoints

Posted by Ruwan Linton <ru...@gmail.com>.
Hi Song,

Yes, you are correct.

Thanks,
Ruwan

On Wed, Feb 24, 2010 at 7:50 PM, Song Thuy Nguyen <pr...@biaqua.de>wrote:

> Hello,
>
>
>
> I am reviewing the failoverendpoint of synapse. I have looked into the
> samples and the javadoc, but I am still unsure about the descriptions, I
> guess there is some confusion here.
>
> The description about failoverendpoints on
> http://synapse.apache.org/Synapse_Configuration_Language.html is:
>
>
>
> "Failover endpoints send messages to the listed endpoints with the
> following failover behavior. At the start, the first listed endpoint is
> selected as the primary and all other endpoints are treated as backups.
> Incoming messages are always sent only to the primary endpoint. If the
> primary endpoint fails, next active endpoint is selected as the primary and
> failed endpoint is marked as inactive. Thus it sends messages successfully
> as long as there is at least one active endpoint among the listed endpoints.
> "
>
>
>
> So it is about one primary endpoint and the following are the alternative
> endpoints that will become the primary endpoint if the former primary
> endpoint fails. Whenever the current primary endpoint fails, synapse will
> iterate the list of endpoints from the top to the bottom to find an active
> endpoint.
>
>
>
> But in the javadoc of the FailoverEndpoint
> http://synapse.apache.org/apidocs/org/apache/synapse/endpoints/FailoverEndpoint.htmlsays:
>
>
>
> "FailoverEndpoint can have multiple child endpoints. It will always try to
> send messages to current endpoint. If the current endpoint is failing, it
> gets another active endpoint from the list and make it the current endpoint.
> Then the message is sent to the current endpoint and if it fails, above
> procedure repeats until there are no active endpoints. If all endpoints are
> failing and parent endpoint is available, this will delegate the problem to
> the parent endpoint. If parent endpoint is not available it will pop the
> next FaultHandler and delegate the problem to that."
>
>
>
> Here it is about current endpoint, child endpoints and parent endpoint.
> While the child endpoints probably match to the alternative endpoints in the
> first description, I'm not sure about the the parent and the current
> endpoint term. My guess is that with the term "parent endpoint" the first
> child (<endpoint>) of the failover element and the "current endpoint" is the
> currently active one which make it match the "assigned  primary" endpoint in
> the first description.
>
> Can anyone approve my guess?
>
> I have to be picky about this as I am trying to reuse the Failoverendpoint
> class to write a custom mediator.
>
>
>
> Greetings,
>
>
>
>
>
> Song Thuy Nguyen
>
>
>
>
>
>


-- 
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com