Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Services vs Messaging

What kind of arguments one should use when choosing between integration using web service vs JMS? I'm familiar with basics of both approaches however in some cases it is unclear as to which one would be the best for a given situation. I guess I'm looking for a high overview comparison with use cases.

thanks

like image 898
user567068 Avatar asked Feb 17 '11 14:02

user567068


2 Answers

JMS is a messaging service. It is asynchronous and 2 directional, i.e. you can write application that both sends and receives messages. But this must be application implemented typically in java. I mean it cannot be thin client. And standard protocol of JMS is TCP based, so it may be blocked by firewall.

Web service is designed as a transport over HTTP, so it typically passes firewalls. But it is one directional: client calls server; server cannot call client. It just can response client's calls. Client of web service (especially RestFull web service) is very simple, so it can be easily implemented as a thin client (e.g. AJAX client).

like image 91
AlexR Avatar answered Nov 12 '22 11:11

AlexR


Good question.

I will use Web Service when:
1. Dealing with cross domains, typically services environment when I am not sure about the client technology.
2. Need Synchronous response.

And pickup Messaging when (Hope you mean Messaging not just Java version):
1. Need Asynchronous request/response.
2. High Availability.
3. Confirmed Delivery.

like image 26
JSS Avatar answered Nov 12 '22 09:11

JSS