You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Saminda Abeyruwan <sa...@opensource.lk> on 2005/11/29 09:59:36 UTC

[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



Re: [Axis2] Mulitiple instances of SimpleHTTPServer

Posted by Davanum Srinivas <da...@gmail.com>.
Let's start by JIRA-IT? :)

On 11/29/05, Srinath Perera <he...@gmail.com> wrote:
> think we can put thread pool inside the AxisConfigurationContext .. I
> think when I wrote it to first time it was there.
>
> But in the client side AxisConfigurationContext is  a static varibale
> too, that is another TODO
>
> Thanks
> Srinath
>
> On 11/29/05, Davanum Srinivas <da...@gmail.com> wrote:
> > Saminda,
> >
> > Can you please submit a patch? we need to fix SimpleHTTPServer.
> >
> > -- dims
> >
> > On 11/29/05, Saminda Abeyruwan <sa...@opensource.lk> wrote:
> > > 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
> > >
> > >
> > >
> >
> >
> > --
> > Davanum Srinivas : http://wso2.com/blogs/
> >
>


--
Davanum Srinivas : http://wso2.com/blogs/

Re: [Axis2] Mulitiple instances of SimpleHTTPServer

Posted by Srinath Perera <he...@gmail.com>.
think we can put thread pool inside the AxisConfigurationContext .. I
think when I wrote it to first time it was there.

But in the client side AxisConfigurationContext is  a static varibale
too, that is another TODO

Thanks
Srinath

On 11/29/05, Davanum Srinivas <da...@gmail.com> wrote:
> Saminda,
>
> Can you please submit a patch? we need to fix SimpleHTTPServer.
>
> -- dims
>
> On 11/29/05, Saminda Abeyruwan <sa...@opensource.lk> wrote:
> > 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
> >
> >
> >
>
>
> --
> Davanum Srinivas : http://wso2.com/blogs/
>

Re: [Axis2] Mulitiple instances of SimpleHTTPServer

Posted by Davanum Srinivas <da...@gmail.com>.
Saminda,

Can you please submit a patch? we need to fix SimpleHTTPServer.

-- dims

On 11/29/05, Saminda Abeyruwan <sa...@opensource.lk> wrote:
> 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
>
>
>


--
Davanum Srinivas : http://wso2.com/blogs/

Re: [Axis2] Mulitiple instances of SimpleHTTPServer

Posted by Saminda Abeyruwan <sa...@opensource.lk>.
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" 
> <sa...@opensource.lk>
> To: <ax...@ws.apache.org>
> 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
>>
>>
>>
>
>
>


Re: [Axis2] Mulitiple instances of SimpleHTTPServer

Posted by Jaliya Ekanayake <ja...@opensource.lk>.
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.

Thanks,

Jaliya

----- Original Message ----- 
From: "Saminda Abeyruwan" <sa...@opensource.lk>
To: <ax...@ws.apache.org>
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
>
>
>