Jaliya Ekanayake wrote:
Hi Saminda,
We have a use case in Synapse, where multiple SimpleHTTPServer s are
required.
If you start multiple instances of SimpleHTTPServer then they should
run on different ports. This may leads to problems when we operate
inside firewalls.
Please explain the scenario that you need multiple servers. IMHO we
should avoid this kind of dynamic server instantiating scenarios and
use a preconfigured server to handle them.
Simple scenario is as follows, Synapse will receive a message, which
will eventually dispatches to the SynapseEnvironment and a rule would
say Redirect the message. Let say Synapse is on server1. Synapse has a
dispatcher, which always dispatches to the SynapseEnvironment. This
dispatcher will be the first in dispatching order and all other
dispatchers will fault through. Let say above message may be redirected
to a actual service, which i can't host in server1, because once the
redirected message enters axis2 of server1 it will again go through the
same dispatchers. So what i need is to start another server (server2-
different port btw) which contains the actual service. But
SimpleHTTPServer woudn't allow to initiate mutiple instances of itself
in same JVM.
An alternative to overcome this problem is highly appriciated.
Thanks,
Jaliya
----- Original Message ----- From: "Saminda Abeyruwan"
<[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, November 29, 2005 3:59 AM
Subject: [Axis2] Mulitiple instances of SimpleHTTPServer
Hi Devs,
Axis2's SimpleHTTPServer would not work properly if multiple
instances of that class created due to its use of static objects to
provide a thread pool.
We have a use case in Synapse, where multiple SimpleHTTPServer s are
required. We have to test a scenario where Synapse uses "sendOn" to
redirect the incoming message to some other server. Now if i
instantiated another SimpleHTTPServer to simulate this, due static
components in the simple server, i am getting errors.
Right now "SynapseDispatcher" is set as the *first* dispatcher and
every request will call "SynapseMessageReciever" which will
eventually enter into Synapse Environment. If i make
"SynapseDispatcher" as the last in dispatching phase and allow
default dispatchers to run, the above mentioned scenario can be
overcome. But in Synapse we are not going to dispatch actual
services. If i make "SynapseDispatcher" other than the *first*
dispatcher, it would lead to some unexpected behaviors.
So, what are the other alternatives available for me.
Is there any plan to allow multiple SimpleHTTPServer instances in
future releases?
Thank you
Saminda