|
Hi,
I was
trying to make a failover mediator up and running, here is a description of the
stuff:
* Failover
Scenario
-----------------------------
Say a
service, http://stockquotes.com has http://stockquotesbackup1.com and
http://stockquotesbackup2.com as
backups in case it goes down or fails.
So if a
request comes in for stockquotes, then the service http://stockquotes.com is called, if the
reply is a fault then http://stockquotesbackup1.com is
invoked. If it also returns a problem then http://stockquotesbackup2.com is
called. In case the last service also returns a fault, the response sent to the
consumer is a fault.
*The
need
---------------
For
failover to be performed by a mediator(assuming it has all the related data,
like the locations of the failover/backup services) it would need the
original request that came to it.
*The
difficulty
--------------------
The
message receiver [the default one in Axis2, used to send requests to the native
services/Endpoints], takes the request SynapseMessage, invokes the native
service, gets the reply message (assuming its a In-Out case). It then goes on to
replace the request message's content with that of the reply message, hence
the original request is lost. If the first service fails then the service
invoked after it never gets the request message but only the fault
message.
*The
way-out
--------------------
* Writing
custom MessageReceiver for failover - This is highly AXIS2 based. In case we
want to hide our axis2 environment and give users a complete Synapse Experience,
this would be the least bit appreciative. Moreover, a mediator writer having to
work with MessageReceivers sounds no good.
This would be the safest option, to use a receiver which will
fit the need. But is it feasible and fits into the
architecture, i.e. having different message receivers for
different end points.
*
Providing a clone option for the SynapseMessageContext - We can override the
clone method, and provide a SynapseMessage
getCopy( ) method in the SynapseMessage's implementations.
This will be problematic as it could be misused
also.
Am I
walking the wrong path or missing
something obvious??
Comments
please..
~Vikas
|
- Failover scenario in Synapse - FailoverMediator Vikas
- Re: Failover scenario in Synapse - FailoverMediator Saminda Abeyruwan
- Re: Failover scenario in Synapse - FailoverMedi... Paul Fremantle
- Re: Failover scenario in Synapse - Failover... Vikas
- Re: Failover scenario in Synapse - Fail... Saminda Abeyruwan
