1

I want to figure out why some body go for JMS when having REST, so let me know, What JMS can do which REST can not do?

Thanks in advance for your responses.

tech share
  • 37
  • 6

2 Answers2

0

If you use JMS, you can use Message Queue. If you have Message Queue ,you can keep messages and don't worry about lost message (Request in REST). You can scale out your systems to receive message.

  • so basically, you are telling jms is reliable with respect to receiving the message, where as rest is not so. That's good point. And do you have any more points what jms can do but rest can not – tech share Jul 18 '16 at 09:58
  • If use Message Queue easier to scale(Many worker can do in 1 queue), but Rest need a load balancing server. JMS is useful for asynchronous request-reply messaging. You can design a system with many worker example: Worker A on Queue "A" -> cooking, Worker B Queue "B" ->-> marketing , Worker C Queue "C" ->-> deliver to Customer. If cooking very slow, you can create more 2 worker A to receive message in Queue A to cook and push message cake to Queue B for Worker B. – quang nam nguyễn Jul 18 '16 at 11:06
  • Ok, if application A and application B use rest, when application B needs a service to get done from application A (like calling a method in application A), application B can simply call the service or request for that service when ever it needs. Like wise what is the situation if application A and application B use jms instead of rest, Can the application B request for a message from application A when it needs, – tech share Jul 20 '16 at 05:08
0

We manage master data in J2EE for our retail business. We create/modify the master data 24/7, an the modified information must be sent to multiple transaction applications in near-real time (asynchronous). Therefore, we use JMS to push the modification into the Topic in IBM MQ, and have the data formatted in the native format (COBOL/XML/Byte) in IIB and send them to the respective receiving applications.

Where as, before deleting a given piece of master data, we need to confirm if the given master data has any existing inventory left in any store or warehouse, and we use REST-JASON to validate against the inventory system in a real time. This is 1-to-1 synchronous communication and hence we went for REST-JSON.

Siva
  • 197
  • 1
  • 3