johnchan2000
asked on
Java Application & Application Servers
Experts,
I am in the process of developing/setting up an application server(Apache Tomcat and an RDBMS) and add the necessary functionalities to provide some kind of a publish-subscribe mechanism.
I would like to be able to develop a Java-based GUI that allows the user to use to connect to the app server to subscribe for a certain type of data. When that requested data is available it will be pushed to the subscriber.
One way I can think of is as part of subscription, the subscriber will provide enough info (hostname, port number, etc...) so that the server will know who and where to 'push' the data to. But that requires the subscriber (java app) to go into a continuous loop to listen for incoming data. Is there a better and more graceful way of accomplishing this without using the polling mechism?
Any pointer is greatly appreciated.
Regards,
john
I am in the process of developing/setting up an application server(Apache Tomcat and an RDBMS) and add the necessary functionalities to provide some kind of a publish-subscribe mechanism.
I would like to be able to develop a Java-based GUI that allows the user to use to connect to the app server to subscribe for a certain type of data. When that requested data is available it will be pushed to the subscriber.
One way I can think of is as part of subscription, the subscriber will provide enough info (hostname, port number, etc...) so that the server will know who and where to 'push' the data to. But that requires the subscriber (java app) to go into a continuous loop to listen for incoming data. Is there a better and more graceful way of accomplishing this without using the polling mechism?
Any pointer is greatly appreciated.
Regards,
john
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You have to use Java Messaging Service for these requirements (JMS)
Take a look at the tutorial:
http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/jms_tutorialTOC.html
http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/jms_tutorialTOC.html
Go through Publish/Subscribe Messaging Domain descriptions in the above tutorial.
Hi Naeemg ,
I also personally prefer EJB's as suggested by Naeemg ..
- Thanks
Anindya
I also personally prefer EJB's as suggested by Naeemg ..
- Thanks
Anindya
so , whats the problem then, just prize me . ........... ;););)
i think this is another suggestion for u. ;););)
i think this is another suggestion for u. ;););)
ASKER
JMS was considered early on, being asynchronous an all that. However, I decided to go with an app server (servlets and such) due to the firewall issues.
Naeemq - thanks for the links, I will certainly look it up.
BTW., I was told that that Sun's JAXM package does provide some libraries that provide some kind of event listener that can be used with a java app (basically, instead of writing the code to continuously polling for incoming data, this package would take care of that). Have anyone ever heard of such thing?
Regards,
john
Naeemq - thanks for the links, I will certainly look it up.
BTW., I was told that that Sun's JAXM package does provide some libraries that provide some kind of event listener that can be used with a java app (basically, instead of writing the code to continuously polling for incoming data, this package would take care of that). Have anyone ever heard of such thing?
Regards,
john