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 Francesco Leone <le...@gmail.com> on 2007/06/01 11:59:20 UTC

[Axis2] service with application scope And multithreading

Hi,
I have a problem with axis2 and its request management. The scenario is the
sequent: there is a service deployed in application scope.
This service make a blocking call to a synchronized queue. If I well
understand Axis2 and its application scope,
it creates a thread for every request for this service and every
thread communicate with the same service object. So it is possible that many

thread are blocked for the synchronized queue . The problem is that i want
to service the request basing on its arrival time, It's important for my
application semantic, so when the
queue is free i want to notify the first thread arrived to axis2.
Any suggestion about resolving this problem?
Thanks,
Regards
Francesco Leone

Re: [Axis2] service with application scope And multithreading

Posted by Paul Fremantle <pz...@gmail.com>.
Francesco

Since this is a one-way operation, you should instead do something different.
You should have Axis2 hand off the results to a service implementation
that is properly multi-threaded and also deployed with request scope.
The service implementation should queue up the messages in a singleton
queue that is synchronized. Then a separate thread will pull the
messages off one-by-one from the queue and execute the logic. This is
exactly what Sandesha2 will do for ordered delivery, but you can do
this in your own logic as well if you don't want to change the
clients. This relies on you only having a single instance of Axis2
(i.e. no cluster).

Paul

On 6/1/07, Francesco Leone <le...@gmail.com> wrote:
>
> Hi Paul,
>
>
> >
> >
> > Two questions!
> >
> > 1) Is this a one-way or a request reply operation.
>
>       Is a one way request (i.e. a notification compliant with
> WS-Notification 1.3 ).
>
> > 2) Have you considered using WSRM which provides inOrder delivery (in
> > other words, it gives each message a number and ensures they get
> > delivered in the order of the message numbers)
>
>
>    Do you mean WS-ReliableMessage? I know that is implemented by
>   Sandesha project  but i don't know it very well. So i try to take a look!
>
>   Thanks a lot for your interest,
>   Regards
>   Francesco
>
> > Paul
> >
> > On 6/1/07, Francesco Leone < leonissimo@gmail.com> wrote:
> > > Hi,
> > > I have a problem with axis2 and its request management. The scenario is
> the
> > > sequent: there is a service deployed in application scope.
> > > This service make a blocking call to a synchronized queue. If I well
> > > understand Axis2 and its application scope,
> > > it creates a thread for every request for this service and every
> > > thread communicate with the same service object. So it is possible that
> many
> > > thread are blocked for the synchronized queue . The problem is that i
> want
> > > to service the request basing on its arrival time, It's important for my
> > > application semantic, so when the
> > > queue is free i want to notify the first thread arrived to axis2.
> > > Any suggestion about resolving this problem?
> > > Thanks,
> > > Regards
> > > Francesco Leone
> > >
> >
> >
> > --
> > 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-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-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-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] service with application scope And multithreading

Posted by Francesco Leone <le...@gmail.com>.
Hi Paul,


>
> Two questions!
>
> 1) Is this a one-way or a request reply operation.


      Is a one way request (i.e. a notification compliant with
WS-Notification 1.3 ).

2) Have you considered using WSRM which provides inOrder delivery (in
> other words, it gives each message a number and ensures they get
> delivered in the order of the message numbers)



  Do you mean WS-ReliableMessage? I know that is implemented by
  Sandesha project  but i don't know it very well. So i try to take a look!

  Thanks a lot for your interest,
  Regards
  Francesco


> Paul
>
> On 6/1/07, Francesco Leone <le...@gmail.com> wrote:
> > Hi,
> > I have a problem with axis2 and its request management. The scenario is
> the
> > sequent: there is a service deployed in application scope.
> > This service make a blocking call to a synchronized queue. If I well
> > understand Axis2 and its application scope,
> > it creates a thread for every request for this service and every
> > thread communicate with the same service object. So it is possible that
> many
> > thread are blocked for the synchronized queue . The problem is that i
> want
> > to service the request basing on its arrival time, It's important for my
> > application semantic, so when the
> > queue is free i want to notify the first thread arrived to axis2.
> > Any suggestion about resolving this problem?
> > Thanks,
> > Regards
> > Francesco Leone
> >
>
>
> --
> 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-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: [Axis2] service with application scope And multithreading

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
On Fri, 2007-06-01 at 12:55 +0200, Francesco Leone wrote:
> Hi Michele,
> 
> In my case, there are different services running on axis2 . So if I
> set
> the thread pool size to 1 , i have a single thread serving every
> request (of anyone of my services) , doesn't it?

Yes.

> If it is the case, this thread becames a bottleneck for the system and
> it is not a feasible solution. 
>  
> Thanks a lot,
> Regards 
> Francesco
> 
> 
> 
> 2007/6/1, Michele Mazzucco <Mi...@ncl.ac.uk>:
>         Paul,
>         
>         what about setting the axis2 thread pool size to 1?, this
>         would
>         automatically serialize all requests (I'm assuming that only
>         that
>         service is deployed).
>         
>         Michele
>         
>         On Fri, 2007-06-01 at 11:08 +0100, Paul Fremantle wrote: 
>         > Francesco
>         >
>         > Two questions!
>         >
>         > 1) Is this a one-way or a request reply operation.
>         > 2) Have you considered using WSRM which provides inOrder
>         delivery (in
>         > other words, it gives each message a number and ensures they
>         get 
>         > delivered in the order of the message numbers)
>         >
>         > Paul
>         >
>         > On 6/1/07, Francesco Leone <le...@gmail.com> wrote:
>         > > Hi,
>         > > I have a problem with axis2 and its request management.
>         The scenario is the 
>         > > sequent: there is a service deployed in application scope.
>         > > This service make a blocking call to a synchronized queue.
>         If I well
>         > > understand Axis2 and its application scope,
>         > > it creates a thread for every request for this service and
>         every 
>         > > thread communicate with the same service object. So it is
>         possible that many
>         > > thread are blocked for the synchronized queue . The
>         problem is that i want
>         > > to service the request basing on its arrival time, It's
>         important for my 
>         > > application semantic, so when the
>         > > queue is free i want to notify the first thread arrived to
>         axis2.
>         > > Any suggestion about resolving this problem?
>         > > Thanks,
>         > > Regards 
>         > > Francesco Leone
>         > >
>         >
>         >
>         
>         
>         ---------------------------------------------------------------------
>         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: [Axis2] service with application scope And multithreading

Posted by Francesco Leone <le...@gmail.com>.
Hi Michele,

In my case, there are different services running on axis2 . So if I set
the thread pool size to 1 , i have a single thread serving every request (of
anyone of my services) , doesn't it?
If it is the case, this thread becames a bottleneck for the system and it is
not a feasible solution.

Thanks a lot,
Regards
Francesco



2007/6/1, Michele Mazzucco <Mi...@ncl.ac.uk>:
>
> Paul,
>
> what about setting the axis2 thread pool size to 1?, this would
> automatically serialize all requests (I'm assuming that only that
> service is deployed).
>
> Michele
>
> On Fri, 2007-06-01 at 11:08 +0100, Paul Fremantle wrote:
> > Francesco
> >
> > Two questions!
> >
> > 1) Is this a one-way or a request reply operation.
> > 2) Have you considered using WSRM which provides inOrder delivery (in
> > other words, it gives each message a number and ensures they get
> > delivered in the order of the message numbers)
> >
> > Paul
> >
> > On 6/1/07, Francesco Leone <le...@gmail.com> wrote:
> > > Hi,
> > > I have a problem with axis2 and its request management. The scenario
> is the
> > > sequent: there is a service deployed in application scope.
> > > This service make a blocking call to a synchronized queue. If I well
> > > understand Axis2 and its application scope,
> > > it creates a thread for every request for this service and every
> > > thread communicate with the same service object. So it is possible
> that many
> > > thread are blocked for the synchronized queue . The problem is that i
> want
> > > to service the request basing on its arrival time, It's important for
> my
> > > application semantic, so when the
> > > queue is free i want to notify the first thread arrived to axis2.
> > > Any suggestion about resolving this problem?
> > > Thanks,
> > > Regards
> > > Francesco Leone
> > >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: [Axis2] service with application scope And multithreading

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Paul,

what about setting the axis2 thread pool size to 1?, this would
automatically serialize all requests (I'm assuming that only that
service is deployed).

Michele

On Fri, 2007-06-01 at 11:08 +0100, Paul Fremantle wrote:
> Francesco
> 
> Two questions!
> 
> 1) Is this a one-way or a request reply operation.
> 2) Have you considered using WSRM which provides inOrder delivery (in
> other words, it gives each message a number and ensures they get
> delivered in the order of the message numbers)
> 
> Paul
> 
> On 6/1/07, Francesco Leone <le...@gmail.com> wrote:
> > Hi,
> > I have a problem with axis2 and its request management. The scenario is the
> > sequent: there is a service deployed in application scope.
> > This service make a blocking call to a synchronized queue. If I well
> > understand Axis2 and its application scope,
> > it creates a thread for every request for this service and every
> > thread communicate with the same service object. So it is possible that many
> > thread are blocked for the synchronized queue . The problem is that i want
> > to service the request basing on its arrival time, It's important for my
> > application semantic, so when the
> > queue is free i want to notify the first thread arrived to axis2.
> > Any suggestion about resolving this problem?
> > Thanks,
> > Regards
> > Francesco Leone
> >
> 
> 


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


Re: [Axis2] service with application scope And multithreading

Posted by Paul Fremantle <pz...@gmail.com>.
Francesco

Two questions!

1) Is this a one-way or a request reply operation.
2) Have you considered using WSRM which provides inOrder delivery (in
other words, it gives each message a number and ensures they get
delivered in the order of the message numbers)

Paul

On 6/1/07, Francesco Leone <le...@gmail.com> wrote:
> Hi,
> I have a problem with axis2 and its request management. The scenario is the
> sequent: there is a service deployed in application scope.
> This service make a blocking call to a synchronized queue. If I well
> understand Axis2 and its application scope,
> it creates a thread for every request for this service and every
> thread communicate with the same service object. So it is possible that many
> thread are blocked for the synchronized queue . The problem is that i want
> to service the request basing on its arrival time, It's important for my
> application semantic, so when the
> queue is free i want to notify the first thread arrived to axis2.
> Any suggestion about resolving this problem?
> Thanks,
> Regards
> Francesco Leone
>


-- 
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-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org