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 ga...@cox.net on 2006/03/09 05:29:00 UTC
Suggestions for how a web service should request data from a Data Access Object (DAO) on another JVM.........
Hi,
We're running Axis2 and various Web Services on a dedicated Tomcat
and some of the services would like to take advantage of data access
functions running on another instance of Tomcat on a different JVM.
The purpose in doing this is so that we don't have to deploy the same
set of data access code in more than one place. The services are
basically exposing some of the data already provided to Servlets on
another app. We don't want to have to upgrade the app to J2EE just to
provide the services. Some thought was given to embedding Axis into
the web app but we would like to keep web services on a separate server.
The thoughts are that RMI or JMS might be good solutions for both
async and sync messages between the two apps. It would seem that
this sort of scenario might have occurred before and possibly best
practices have been defined somewhere. Maybe some examples? Any
suggestions as to the pros and cons and possibly other ways of
getting the data to/from the existing app to the new service would
be appreciated.
Thanks
Al
Re: Suggestions for how a web service should request data from a Data Access Object (DAO) on another JVM.........
Posted by robert <ro...@gmail.com>.
Tomcat isn't an app server and doesn't support JMS out of the box - you'd have
to add activemq or openjms.
RMI AFAIK doesn't do async operations. You could, however, I suppose wrap the
RMI call in thread via ExecutorService and if you need a result back use a
Future.
The pro RMI argument is that its faster than web services - although my semi-
scientific tests with JMeter showed axis2 completing requests on a typical
lan in about 40ms. RMI Can beat that though - I've seen docs from IBM showing
1400 calls in one minute where axis 1.x was only doing 400.
The pro JMS argument is that its robust, messages are typically persisted in a
db, its async, and supports many-to-many or many-to-one messaging. Its also
better accepted for db transaction.
I'd have to think about it more but you might be able to but your data access
code in jar higher up in classloader chain and then it would be available
across web apps. This is how you could do it in JBoss - just have an ear with
several wars.
HTH,
Robert
http://www.braziloutsource.com/
Em Quinta 09 Março 2006 01:29, o gaffer@cox.net escreveu:
> Hi,
>
> We're running Axis2 and various Web Services on a dedicated Tomcat
> and some of the services would like to take advantage of data access
> functions running on another instance of Tomcat on a different JVM.
> The purpose in doing this is so that we don't have to deploy the same
> set of data access code in more than one place. The services are
> basically exposing some of the data already provided to Servlets on
> another app. We don't want to have to upgrade the app to J2EE just to
> provide the services. Some thought was given to embedding Axis into
> the web app but we would like to keep web services on a separate server.
>
> The thoughts are that RMI or JMS might be good solutions for both
> async and sync messages between the two apps. It would seem that
> this sort of scenario might have occurred before and possibly best
> practices have been defined somewhere. Maybe some examples? Any
> suggestions as to the pros and cons and possibly other ways of
> getting the data to/from the existing app to the new service would
> be appreciated.
>
> Thanks
> Al
--