GeeCON Prague 2014*
The moose likes EJB and other Java EE Technologies and the fly likes JMS? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JMS?" Watch "JMS?" New topic
Author

JMS?

kriti sharma
Ranch Hand

Joined: Feb 16, 2001
Posts: 160
i have to write a small java application which is constantly connected to the application server.this application runs on the client machine all day. as soon as the EJB code in the app-server makes a particular entry in the RDBMS, a message needs to be sent to the client machine, a ticker kind of a thing, just like when we are logged in on the yahoo messenger and we recieve a new mail a message is popped up that we have a new message. can i do this with JMS?or is there any other way?please guide!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

If your application is constantly connected to a server you wouldn't need JMS, just use this constant connection (how are you doing that, by the way?). The problem usually with two way communication in J2EE apps, is that usually the front end is a web app (or something simmilar), and web apps mean HTTP, which isn't a good route for two way communication. What you could do is use RMI - create an RMI application in your server app, and have your client poll this for updates.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Originally posted by kriti sharma:
i have to write a small java application which is constantly connected to the application server.this application runs on the client machine all day. as soon as the EJB code in the app-server makes a particular entry in the RDBMS, a message needs to be sent to the client machine, a ticker kind of a thing, just like when we are logged in on the yahoo messenger and we recieve a new mail a message is popped up that we have a new message. can i do this with JMS?or is there any other way?please guide!


Hi,

JMS is mainly for asynchronous message communication. But for your application I think you can use normal RMI calls as your client is always attached with the Application server.

Regards,
M.S.Raman
kriti sharma
Ranch Hand

Joined: Feb 16, 2001
Posts: 160
Originally posted by Paul Sturrock:
If your application is constantly connected to a server you wouldn't need JMS, just use this constant connection (how are you doing that, by the way?). The problem usually with two way communication in J2EE apps, is that usually the front end is a web app (or something simmilar), and web apps mean HTTP, which isn't a good route for two way communication. What you could do is use RMI - create an RMI application in your server app, and have your client poll this for updates.


what should be the time intervel for polling?5 mins or even less?
xixi wang
Greenhorn

Joined: May 19, 2004
Posts: 10
When using RMI (Your client is actually a RMI server, then), you can actually make your server (EJB) to call back the client (RMI).
 
GeeCON Prague 2014
 
subject: JMS?