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 Paul Fremantle <pz...@gmail.com> on 2007/07/05 22:27:15 UTC

Question about NIO HTTP sender and thread behaviour

Asankha, Dims,

I'm wondering what happens if I have the following scenario:
* Anonymous HTTP Req/Resp
* NIO Sender
* Callback in the client.

How many threads are used? Which pools do they come out of? Are there
any blocking threads?

Here is what I think should happen:

The application thread should hand off control to one of the NIO
sender threads. Once the message is sent, no threads should remain
processing anything to do with that request. Once the response comes
back the NIO reciever thread should launch a worker thread to execute
the callback.

Paul

-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: Question about NIO HTTP sender and thread behaviour

Posted by Davanum Srinivas <da...@gmail.com>.
Ah. i see it now.

-- dims

On 7/6/07, Paul Fremantle <pz...@gmail.com> wrote:
> What I was trying to get at was whether we are really scalable with
> threads. It seems to me that with the ordinary HTTP transport we are
> *worse*.
>
> If the client uses a callback and setUseSeparateListener(false); then
> we spawn a thread that sits around blocking until the response comes
> back. That isn't really very good, and I was hoping that using the NIO
> transport we could fix this.
>
> Paul
>
> On 7/6/07, Davanum Srinivas <da...@gmail.com> wrote:
> > I agree that "normal" should be the non-NIO sender and NIO sender is
> > for advanced use cases.
> >
> > thanks,
> > dims
> >
> > On 7/6/07, Asankha C. Perera <as...@wso2.com> wrote:
> > > Paul
> > >
> > > This is what happens in Synapse.. but I do not promote the NIOSender to
> > > simple clients as it is designed to send out many requests and not a
> > > single message etc. So for a typical client scenario the NIO sender is
> > > not suitable from how I see it.
> > >
> > > asankha
> > >
> > > Paul Fremantle wrote:
> > > > Asankha, Dims,
> > > >
> > > > I'm wondering what happens if I have the following scenario:
> > > > * Anonymous HTTP Req/Resp
> > > > * NIO Sender
> > > > * Callback in the client.
> > > >
> > > > How many threads are used? Which pools do they come out of? Are there
> > > > any blocking threads?
> > > >
> > > > Here is what I think should happen:
> > > >
> > > > The application thread should hand off control to one of the NIO
> > > > sender threads. Once the message is sent, no threads should remain
> > > > processing anything to do with that request. Once the response comes
> > > > back the NIO reciever thread should launch a worker thread to execute
> > > > the callback.
> > > >
> > > > Paul
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-dev-help@ws.apache.org
> > >
> > >
> >
> >
> > --
> > Davanum Srinivas :: http://davanum.wordpress.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-dev-help@ws.apache.org
> >
> >
>
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: Question about NIO HTTP sender and thread behaviour

Posted by Paul Fremantle <pz...@gmail.com>.
What I was trying to get at was whether we are really scalable with
threads. It seems to me that with the ordinary HTTP transport we are
*worse*.

If the client uses a callback and setUseSeparateListener(false); then
we spawn a thread that sits around blocking until the response comes
back. That isn't really very good, and I was hoping that using the NIO
transport we could fix this.

Paul

On 7/6/07, Davanum Srinivas <da...@gmail.com> wrote:
> I agree that "normal" should be the non-NIO sender and NIO sender is
> for advanced use cases.
>
> thanks,
> dims
>
> On 7/6/07, Asankha C. Perera <as...@wso2.com> wrote:
> > Paul
> >
> > This is what happens in Synapse.. but I do not promote the NIOSender to
> > simple clients as it is designed to send out many requests and not a
> > single message etc. So for a typical client scenario the NIO sender is
> > not suitable from how I see it.
> >
> > asankha
> >
> > Paul Fremantle wrote:
> > > Asankha, Dims,
> > >
> > > I'm wondering what happens if I have the following scenario:
> > > * Anonymous HTTP Req/Resp
> > > * NIO Sender
> > > * Callback in the client.
> > >
> > > How many threads are used? Which pools do they come out of? Are there
> > > any blocking threads?
> > >
> > > Here is what I think should happen:
> > >
> > > The application thread should hand off control to one of the NIO
> > > sender threads. Once the message is sent, no threads should remain
> > > processing anything to do with that request. Once the response comes
> > > back the NIO reciever thread should launch a worker thread to execute
> > > the callback.
> > >
> > > Paul
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-dev-help@ws.apache.org
> >
> >
>
>
> --
> Davanum Srinivas :: http://davanum.wordpress.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: Question about NIO HTTP sender and thread behaviour

Posted by Davanum Srinivas <da...@gmail.com>.
I agree that "normal" should be the non-NIO sender and NIO sender is
for advanced use cases.

thanks,
dims

On 7/6/07, Asankha C. Perera <as...@wso2.com> wrote:
> Paul
>
> This is what happens in Synapse.. but I do not promote the NIOSender to
> simple clients as it is designed to send out many requests and not a
> single message etc. So for a typical client scenario the NIO sender is
> not suitable from how I see it.
>
> asankha
>
> Paul Fremantle wrote:
> > Asankha, Dims,
> >
> > I'm wondering what happens if I have the following scenario:
> > * Anonymous HTTP Req/Resp
> > * NIO Sender
> > * Callback in the client.
> >
> > How many threads are used? Which pools do they come out of? Are there
> > any blocking threads?
> >
> > Here is what I think should happen:
> >
> > The application thread should hand off control to one of the NIO
> > sender threads. Once the message is sent, no threads should remain
> > processing anything to do with that request. Once the response comes
> > back the NIO reciever thread should launch a worker thread to execute
> > the callback.
> >
> > Paul
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: Question about NIO HTTP sender and thread behaviour

Posted by "Asankha C. Perera" <as...@wso2.com>.
Paul

This is what happens in Synapse.. but I do not promote the NIOSender to 
simple clients as it is designed to send out many requests and not a 
single message etc. So for a typical client scenario the NIO sender is 
not suitable from how I see it.

asankha

Paul Fremantle wrote:
> Asankha, Dims,
>
> I'm wondering what happens if I have the following scenario:
> * Anonymous HTTP Req/Resp
> * NIO Sender
> * Callback in the client.
>
> How many threads are used? Which pools do they come out of? Are there
> any blocking threads?
>
> Here is what I think should happen:
>
> The application thread should hand off control to one of the NIO
> sender threads. Once the message is sent, no threads should remain
> processing anything to do with that request. Once the response comes
> back the NIO reciever thread should launch a worker thread to execute
> the callback.
>
> Paul
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org