You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Xinjun Chen <xj...@gmail.com> on 2006/07/23 04:39:24 UTC

web services multithreading

I am wondering how web services are scalable.

Let's assume there is one webservice ServiceA with an operation
OperationA deployed in Axis1.2.1.

1. At the runtime, if there are multiple clients invoke the OperationA
concurrently, how it will be done internally?

2. I think there will be only one instance of ServiceA, right?

3. Will there be one extra thread created when one invocation happens?

4. If the same client invokes the OperationA in two consecutive call,
it is ensured that the first call will always be served before the
second call?

5. Is there any difference about this multiple invocations in Axis2?


Regards,
Xinjun

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


Re: web services multithreading

Posted by xu cai <je...@gmail.com>.
I am not sure about your question. but I think, there should be mutiple
objects/threads serving mutiple clients. and client need to manage/handle
the sequence of invocation.


On 7/23/06, Xinjun Chen <xj...@gmail.com> wrote:
>
> I am wondering how web services are scalable.
>
> Let's assume there is one webservice ServiceA with an operation
> OperationA deployed in Axis1.2.1.
>
> 1. At the runtime, if there are multiple clients invoke the OperationA
> concurrently, how it will be done internally?
>
> 2. I think there will be only one instance of ServiceA, right?
>
> 3. Will there be one extra thread created when one invocation happens?
>
> 4. If the same client invokes the OperationA in two consecutive call,
> it is ensured that the first call will always be served before the
> second call?
>
> 5. Is there any difference about this multiple invocations in Axis2?
>
>
> Regards,
> Xinjun
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
- xucai

Re: web services multithreading

Posted by Xinjun Chen <xj...@gmail.com>.
Hi Christopher,

Thank you very much for the detailed answers! :-)

I have one more follow on question: Assume the service scope is set as
"application", if there are multiple clients invoke the same
operation. How will this be done?

According to the meaning of "application" scope, then no
multithreading is support. This really confused me.

How to make web services scalable?



Regards,
Xinjun

On 7/23/06, Christopher Sahnwaldt <ch...@gmx.net> wrote:
> The answers all depend on the 'scope' that you set in your
> services configuration. See http://ws.apache.org/axis/java/user-guide.html
>
>  > 1. At the runtime, if there are multiple clients invoke the OperationA
>
> > concurrently, how it will be done internally?
>
> Your application server (Tomcat etc.) will use one thread for each request.
> If scope is 'request', each request will be executed on a different service
> object. If scope is 'application', all requests will be executed on the same
> service object.
>
> > 2. I think there will be only one instance of ServiceA, right?
>
> If scope is 'request', a new object is created for each request.
> If scope is 'application', the same object is re-used for all requests.
>
> > 3. Will there be one extra thread created when one invocation happens?
>
> The thread probably won't be created (it will come from a pool), but that
> depends on your application server, not on Axis. The app server will
> handle concurrent requests in concurrent threads.
>
> > 4. If the same client invokes the OperationA in two consecutive call,
> > it is ensured that the first call will always be served before the
> > second call?
>
> Short answer: Yes. Long answer: Yes, as long as the client uses HTTP
> (or another synchronous protocol) and does not make the calls in
> different threads.
>
> > 5. Is there any difference about this multiple invocations in Axis2?
> I don't understand the question...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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


Re: web services multithreading

Posted by Christopher Sahnwaldt <ch...@gmx.net>.
The answers all depend on the 'scope' that you set in your
services configuration. See http://ws.apache.org/axis/java/user-guide.html

 > 1. At the runtime, if there are multiple clients invoke the OperationA

> concurrently, how it will be done internally?

Your application server (Tomcat etc.) will use one thread for each request.
If scope is 'request', each request will be executed on a different service
object. If scope is 'application', all requests will be executed on the same
service object.

> 2. I think there will be only one instance of ServiceA, right?

If scope is 'request', a new object is created for each request.
If scope is 'application', the same object is re-used for all requests.

> 3. Will there be one extra thread created when one invocation happens?

The thread probably won't be created (it will come from a pool), but that
depends on your application server, not on Axis. The app server will
handle concurrent requests in concurrent threads.

> 4. If the same client invokes the OperationA in two consecutive call,
> it is ensured that the first call will always be served before the
> second call?

Short answer: Yes. Long answer: Yes, as long as the client uses HTTP
(or another synchronous protocol) and does not make the calls in
different threads.

> 5. Is there any difference about this multiple invocations in Axis2?
I don't understand the question...

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