File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes JMS alternative Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "JMS alternative" Watch "JMS alternative" New topic
Author

JMS alternative

Pavel Kazlou
Ranch Hand

Joined: Sep 07, 2009
Posts: 33
Hi everyone.
I have web application under Tomcat that allows its users to perform activity which involves sending and receiving messages over high-latency channel. The latency can be really high and I don't want my users' HTTP requests to wait for messages to be delivered and responded. That is why I need to split my application in two parts: the first part handling users requests and the second part (standalone application with multiple threads, I need multiple threads because sending messages is actually session-based communication) performing message-sending activities. I want to connect these parts with some asynchronous message service. I don't want to use JMS as it is too complex for my simple task. I need only one point-to-point connection on the same computer. Just sending data between two applications asynchronously.
My search brought me to the following solutions (which are not suitable):
-using time scheduling - is not suitable because messages should be sent as quickly as possible. It's not emailing, it's real-time communication.
-using persistence (files or database) - I can't say that it is totally unacceptable solution, but it brings the dilemma of either checking the storage with some reasonable period of time (which is almost the same as scheduling) or checking the storage with small period thus producing a lot of useless load on both applications and computer in general.

Do you have any ready for use alternatives to JMS? Or maybe some advise on how to implement such communication myself? I don't have any experience with asynchronous communication and I don't even know where should I start from if I am to implement communication myself.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26192
    
  66

Pavel,
I'd use JMS.

If I were writing my own solution - which goes against JEE - maybe put the message in a static data structure and have a thread that polls it - then have that thread make a remote call to app 2 which does the processing.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Pavel Kazlou
Ranch Hand

Joined: Sep 07, 2009
Posts: 33
Thank you, Jeanne.
In order to use JMS, which is the best implementation ? (best in my case is most reliable and having as less configuration as possible) I'll use it with spring 2.0. In "Spring in Action" book the authors use ActiveMQ 4.1. On ActiveMQ site I've found that the whole range of versions is available. Googling on the latest version (5.2) brought some doubts whether I should use it =\
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JMS alternative
 
Similar Threads
JVM to JVM Communication
Difference between JMS & Java Mail API
Why there is so hype of JMS in just to send a message? Please give some explanations..
Cleared Part I today with 79%
Synchronous or Asynchronous Method?