This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Making decision between Web Services and Java Message Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Making decision between Web Services and Java Message Service" Watch "Making decision between Web Services and Java Message Service" New topic
Author

Making decision between Web Services and Java Message Service

Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 207
Hi all,

I suddenly have a decision making problem regarding system-to-system scenario.
In the system-to-system scenario, I am thinking I should use web services or JMS to archieve the system-to-system scenario.

Please give me suggestions or recommendations.

Thanks
Benson
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
The idea behind Web services is to solve the closed nature of conventional applications, which typically are unusable to other applications via the internet. These apps are often monolithic systems running on mainframes or client-server applications running on desktops. But if you develop reusable components which can be more easily accessible by any user on the Web by packaging and transporting them using standard Web protocols such as XML and HTTP, then you less closed apps. Features of You Web Services are:
- Web Services are accessed over the Web.
- Web Services describe themselves using an XML-based description language.
- Web Services communicate with clients (both end-user applications or other Web Services) through XML messages that are transmitted by standard Internet protocols, such as HTTP.


So, you could have a C++ client making a Web service call to invoke an EJB method on a remote system.

JMS is an enterprise messaging system, often referred to as Message-Oriented Middleware (MOM), enables applications to communicate with one another through the exchange of messages. Messages are often within apps, sometimes between apps. A message is a request, report and/or event that contains information needed to coordinate communication between different applications. Typically, all the systems run on a LAN (not the internet) and can access the MOM server easily.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 207
Thanks for your reply. However, e.g. if I have some data which will be saved in another system's database. This system can use web services or JMS to wait for the data and save it to the database, right?

So what is the difference?


Benson
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Obviouly it depends on how you implement it... but using some type of messaging such as JMS as your transport protocol tends to lead to a more decoupled system which is a good thing.

Using Web Services will tightly couple the client application to the WSDL of the server application... and since the WSDL is typically auto-generated it makes it very difficult at times to perform significant refactorings.

Personally, I am very cautious about introducing web services... especially for applications within the same organization running the same platform.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Our application recently exposed a number of public APIs and we used both. Web services for synchronous calls when the caller required an answer and messaging for async calls when we wanted assured delivery whether our system was up at the moment or not.

To make things confusing, some of the folks we work with kept talking about "web services over MQ Series" so we had to be very explicit in every conversation whether it was XML/HTTP or XML/JMS. I thought "web" implied "http" but be aware that not everyone makes the same association.

Interesting point about coupling to WSDL. Publishers have to establish very stable public interfaces if they want to avoid breaking clients with every change. As web service clieints we found when we generated client code from WSDL that any variation in the XML sent by partners - tag order or missing or extra tags - broke our clients, so we hand-throw more robust parsing and unmarshalling.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 207
Hi Stan,

Thanks for your suggestions. Can you tell me when we should use Web services and when we should use JMS in the system-to-system scenario?


Thanks
Benson
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
I think the message is pretty clear. There is no fool-proof algorithm to determine what choice is the correct one. Each situation must be evaluated independently and is influenced by an almost limitless number of conditions. These conditions include: technologies in use on client/server, flexibility required for interface, rate of change each application typically supports, hardware available for solution, performance requirements, failover requirements, maturity and skill-level of developers, project timelines, etc.

There is no single correct choice that any of us could give you. You need to do this evaluation yourself and take into consideration the comments that we have provided, that is afterall, your value as a developer to your organization.
Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 207
Hi Chris,

I understand your message is very clear. Thank you for your message. I am just asking Stan's conclusion.

Thanks
Benson
Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 207
Hi Chris,

I understand your message is very clear. Thank you for your message. I am just asking Stan's conclusion.

Thanks
Benson
 
 
subject: Making decision between Web Services and Java Message Service
 
Similar Threads
Is TOMCAT server the best free choice for JSP container?
Axis vs. SJSAS8 + NetBeans 4.1
Is TOMCAT server the best free choice for JSP container?
IBM or Sun ?
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jersey/api/cl ient/config/ClientC