You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Roberto Cappa <ca...@gmail.com> on 2010/01/14 15:25:20 UTC

Using failover when an endpoint is inactive

Hi all, I'd like to make the failover endpoint configuration working not
only when one of the servers is shut down but even if one of the endpoints
is inactive. As far as I know in these case the failover configuration does
not work and a SOAP fault is returned from the server with the inactive or
undeployed endpoint. I understood that failover works correctly only if the
endpoint goes to suspended state. I'm trying to configure the
suspendOnFailure error codes, but I cannot find the code for the case of
inactive service. How can I manage this error and after suspend the
endpoint?

Another possibile solution, is to manage the response in out sequence and
send the request to another endpoint. But in this case I need to store the
request message. This solution seems to be very complex and not clean, also
in this way I completely loose the possibility to use the load balancing
feature togheter with the failover and moreover I have to hardcode the
endpoint list and to write logic in order to manage load-balancing.
It would be much better if I could use the built-in synapse configuration
capability in order to suspend an endpoint that replies with that error
(inactive service) and keep on using the built-in failover endpoint
configuration. Is it possible to suspend an endpoint from synapse.xml when
such a response is received? Thanks.







Thanks in advance

Re: Using failover when an endpoint is inactive

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Roberto
> I agree with your consideration, in general a SOAP fault could be a valid
> response for the client. The problem is that a SOAP fault *can *be also an
> invalid response from the service, and in current situation there is no way
> to manage this information in order to mark an endpoint suspended.
>
> Using current configuration language, the only solution I have in mind is
> this:
>
> 1) Alter the IN sequence to store somewhere the request message
> 2) Alter the OUT sequence to analyze the body of the fault, to verify if the
> endpoint is unavailable
> 3) Reload the request from 1)
> 4) Send the request to the next endpoint (chosen by an hard-coded logic,
> storing somewhere the endpoints already used)
> 5) Repeat from 2 until success or no other endpoint is available.
>
> This solution is very very dirty, it makes useless all
> failover/loadbalancing/endpoint-groups framework because I have to hardcode
> all the logic and all the endpoints.
>
> I think a way to put a condition (for example a xpath-expression on the
> response body) in addition to standard error codes, could be a clean
> solution. Otherwise, do you have a suggestion to obtain this goal with a
> smarter solution?
>   
Can you give me some time to look at the options.. I will try to give
you a solution around early next week..

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: Using failover when an endpoint is inactive

Posted by Roberto Cappa <ca...@gmail.com>.
I agree with your consideration, in general a SOAP fault could be a valid
response for the client. The problem is that a SOAP fault *can *be also an
invalid response from the service, and in current situation there is no way
to manage this information in order to mark an endpoint suspended.

Using current configuration language, the only solution I have in mind is
this:

1) Alter the IN sequence to store somewhere the request message
2) Alter the OUT sequence to analyze the body of the fault, to verify if the
endpoint is unavailable
3) Reload the request from 1)
4) Send the request to the next endpoint (chosen by an hard-coded logic,
storing somewhere the endpoints already used)
5) Repeat from 2 until success or no other endpoint is available.

This solution is very very dirty, it makes useless all
failover/loadbalancing/endpoint-groups framework because I have to hardcode
all the logic and all the endpoints.

I think a way to put a condition (for example a xpath-expression on the
response body) in addition to standard error codes, could be a clean
solution. Otherwise, do you have a suggestion to obtain this goal with a
smarter solution?

Thanks


2010/1/14 Asankha C. Perera <as...@apache.org>

> Hi Roberto
> >> The problem is that when I'm trying to access to an inactive
> >> endpoint I don't obtain an error code in the 101XXX error codes list. I
> >> obtain a SOAP fault...
> >>
> > Ah.. I get your point now! No, Synapse doesn't look at the message and
> > mark the endpoint as failed.. this is a good suggestion for improvement
> > though.. Let me see what can be done
> >
> I do not think your requirement is valid in general.. a SOAP fault can
> be returned if your request data is invalid as an example - this does
> not mean that the service is failing and its down - so marking it as
> such is not generally applicable.
>
> In your case, unless you look at the response message received, you
> cannot determine if its a service level fault, or something else.. at
> least if we had a HTTP status code of 404 etc, it could be hard proof
> the service is not available
>
> cheers
> asankha
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>

Re: Using failover when an endpoint is inactive

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Roberto
>> The problem is that when I'm trying to access to an inactive
>> endpoint I don't obtain an error code in the 101XXX error codes list. I
>> obtain a SOAP fault...
>>     
> Ah.. I get your point now! No, Synapse doesn't look at the message and
> mark the endpoint as failed.. this is a good suggestion for improvement
> though.. Let me see what can be done
>   
I do not think your requirement is valid in general.. a SOAP fault can
be returned if your request data is invalid as an example - this does
not mean that the service is failing and its down - so marking it as
such is not generally applicable.

In your case, unless you look at the response message received, you
cannot determine if its a service level fault, or something else.. at
least if we had a HTTP status code of 404 etc, it could be hard proof
the service is not available

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: Using failover when an endpoint is inactive

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Roberto
> Thanks. The problem is that when I'm trying to access to an inactive
> endpoint I don't obtain an error code in the 101XXX error codes list. I
> obtain a SOAP fault like this from Axis2 on the remote machine:
>
> <soapenv:Body>
>      <soapenv:Fault>
>         <faultcode>soapenv:Server</faultcode>
>         <faultstring>The system is attempting to access an inactive service:
> ....</faultstring>
>         <detail/>
>      </soapenv:Fault>
>   </soapenv:Body>
>
> that isn't interpreted like an error from Synapse. For this reason, the
> suspension never happens.I think the problem is that in Syanpse failover
> configuration there is no possibility to recognize a soap fault in order to
> manage endpoint suspension.
>   
Ah.. I get your point now! No, Synapse doesn't look at the message and
mark the endpoint as failed.. this is a good suggestion for improvement
though.. Let me see what can be done

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: Using failover when an endpoint is inactive

Posted by Roberto Cappa <ca...@gmail.com>.
Thanks. The problem is that when I'm trying to access to an inactive
endpoint I don't obtain an error code in the 101XXX error codes list. I
obtain a SOAP fault like this from Axis2 on the remote machine:

<soapenv:Body>
     <soapenv:Fault>
        <faultcode>soapenv:Server</faultcode>
        <faultstring>The system is attempting to access an inactive service:
....</faultstring>
        <detail/>
     </soapenv:Fault>
  </soapenv:Body>

that isn't interpreted like an error from Synapse. For this reason, the
suspension never happens.I think the problem is that in Syanpse failover
configuration there is no possibility to recognize a soap fault in order to
manage endpoint suspension.

Thanks in advance.

2010/1/14 Asankha C. Perera <as...@apache.org>

> Hi Roberto
> > Hi all, I'd like to make the failover endpoint configuration working not
> > only when one of the servers is shut down but even if one of the
> endpoints
> > is inactive
> First of all, it seems like you've not yet subscribed to the user list
> to post messages.. So copying this to you directly
>
> An endpoint becomes suspended when its known to be down. A timeout or
> intermittent error marks it for suspension, and on exceeding the retry
> count in this state, it makes the endpoint suspended. You can configure
> the error codes on which an endpoint is marked for timeout and
> suspension, so if you change the default and make a timeout a suspension
> error you will get exactly what you want - although that may not be the
> correct solution
>
> cheers
> asankha
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>

Re: Using failover when an endpoint is inactive

Posted by "Asankha C. Perera" <as...@apache.org>.
Roberto

Here are the error codes for the HTTP Sender

101500    101999    HTTP/S Sender   
        101500    IO Error sending
        101501    IO Error receiving
           
        101503    Connection failed
        101504    Connection timeout
        101505    Connection closed
        101506    Protocol violation
        101507    Connect cancel
        101508    Connect timeout

cheers
asankha

Asankha C. Perera wrote:
> Hi Roberto
>   
>> Hi all, I'd like to make the failover endpoint configuration working not
>> only when one of the servers is shut down but even if one of the endpoints
>> is inactive
>>     
> First of all, it seems like you've not yet subscribed to the user list
> to post messages.. So copying this to you directly
>
> An endpoint becomes suspended when its known to be down. A timeout or
> intermittent error marks it for suspension, and on exceeding the retry
> count in this state, it makes the endpoint suspended. You can configure
> the error codes on which an endpoint is marked for timeout and
> suspension, so if you change the default and make a timeout a suspension
> error you will get exactly what you want - although that may not be the
> correct solution
>
> cheers
> asankha
>
>   


-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





Re: Using failover when an endpoint is inactive

Posted by "Asankha C. Perera" <as...@apache.org>.
Hi Roberto
> Hi all, I'd like to make the failover endpoint configuration working not
> only when one of the servers is shut down but even if one of the endpoints
> is inactive
First of all, it seems like you've not yet subscribed to the user list
to post messages.. So copying this to you directly

An endpoint becomes suspended when its known to be down. A timeout or
intermittent error marks it for suspension, and on exceeding the retry
count in this state, it makes the endpoint suspended. You can configure
the error codes on which an endpoint is marked for timeout and
suspension, so if you change the default and make a timeout a suspension
error you will get exactly what you want - although that may not be the
correct solution

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com