• Post Reply Bookmark Topic Watch Topic
  • New Topic

Which is better - JMS or Webservice?

 
Sriram Sharma
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am fairly good in SOAP Webservices. I am have book based basic knowledge/understanding on JMS.
That said, here below is my question...

My project has one upstream and may downstream systems.
The upstream system can send an xml of maximum size 500 MB, which need to be fetched through a JMS or webservice.
After that, this xml has to be parsed, and sent to the downstream systems through JMS or Webservice.
In either case (getting from upstream or sending to the downstream), which one if preferable and why?
I would like to get an understanding of the above case in both synchronous and asynchronous scenarios.
Though I understand that JMS is used with the purpose of Asynchronous mechanism, could that also be used for synchronous mechanisms???

Please suggest!

Regards,
Sriram
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Though I understand that JMS is used with the purpose of Asynchronous mechanism, could that also be used for synchronous mechanisms???

You can! But that's not what JMS is designed for. But i would want to ask what do you mean by synchronous first.

Note: synchronous is a word which people have different interpretations. Go a couple of levels down from software and people's understanding of synchronous and asynchronous becomes blurry.

Now that have you considered other options like, AMQP, File(??) for sending the data. Given that it is of size 500MB?
Some JMS vendors impose restrictions on the size of the payload.

When it comes to data moving between systems, you need to not only think about protocols, but also the patterns with which the data is transferred.
Why do ask the question about synchronous and asynchronous? How do you think this will affect your case?
...which need to be fetched through a JMS or webservice.

- Terminologies are important. You need to understand the terms "PUT", "SEND", "RECEIVE", "GET", "PUSH" and "PULL", Trigger origination, etc.,
by "fetched" i understand that a user or a system will go and read the data. But you had also mentioned "system can send ...", which is ambiguous.
 
Sriram Sharma
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. When I say sync and async applications, I mean request-response oriented applications.
Sync - System awaits for the response from the system which has received the request
Async - System doesn't wait for a response from the system which has received the request.

2. I am not sure about the case where the sync/async may affect the affect my application
That is also one of the reasons for the question.

3. I don't understand what is really ambiguous about the statement "upstream system can send an xml"
Let me try to clarify here whatever I think may be confusing you...
The upstream system just does a push mechanism to push the xml into a queue or webservice (whatever be our choice)
Once the xml falls in the queue/webservice, my system starts processing that XML and then pushes this the downstream through another JMS/Webservice (this is also to be decided)

Regards,
Sriram
 
Henry Wong
author
Sheriff
Posts: 22519
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sriram Sharma wrote:1. When I say sync and async applications, I mean request-response oriented applications.
Sync - System awaits for the response from the system which has received the request
Async - System doesn't wait for a response from the system which has received the request.


JMS does request response via the use of a response channel. Basically ... you need to (1) create the request queue or topic, (2) create a temporary queue or topic for the responses, (3) create a message with the temporary queue or topic, as the "reply to" property, (4) also, have a correlation ID on the message... and then (5) send the message, and (6) wait for the reply on the response channel (with the corresponding correlation ID).

Sriram Sharma wrote:
2. I am not sure about the case where the sync/async may affect the affect my application
That is also one of the reasons for the question.


Obviously, how JMS does request response is asynchronously, but you can always make it synchronous by using threads, and have the threads coordinate / wait for each other.

Henry
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry has just hinted about synchronous and asynchronous and if you go down that path, I'm sure you will have more clarity and understanding on JMS and Webservices and message exchange patterns.
That being a separate thread, coming to your original question.
Which is better - JMS or WebService?


To compare two things, you need to have a common comparison denominator or questions which is common to both?
In this case;
1. Reliability of the network.
2. Bandwidth available to you for the operation.
3. The network and bandwidth which is available for you, are you using it for other operations? Or is it only for this file transfer operation.
4. Scalability - Is it just one file transfer request or are you looking at many such requests coming in the future? Then there is this question about horizontal scalability and vertical scalability - meaning in case of many requests, if one of your participating systems (either sending or receiving), is a single system, then that the overall end to end use case is now stuck on the horizontal scalability of that one system which cannot be clustered or scaled out. As much as you can scale up that system, is your ability to handle many requests.
5. Availability - what if one of your systems go down? Do you want to have a stand-in mechanism to take the file and then keep it until other systems are up and running.
6. Persistence - do you want to store the message inside your system once it has been sent or keep it in RAM until someone consumes it and be done with it.

of course there are also other questions like;
1. What is the current knowledge of whoever is implementing this is having?
2. What existing systems you have. If by FTP, you need budget to buy new systems, if time to provide a solution is a critical factor, then that matters too.
3. Above all immaterial of all constraints, "simplicity" matters.
4. Maintainability matters.

You still haven't answered the question, if you have considered file transfer protocol, Simple HTTP file streaming, AMQP or anything else?
If yes, can you see why those are used?

This question is very generic like, I'm hungry and I can eat up to 500 gm of fruits. What should I eat - apples or oranges?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!