Hello.. im actually about to design a distributed service provider across a LAN..users register at a service provider server and then receive messages through their pc., namely an alert service and chat system. I would be using JMS with the publish subscribe model in the J2EE environment..i have downloaded the SunOne application server bundle which includes Sun Message Queue as JMS provider.
The basic technology decisions for the implementation of this application are as follows: �A Java-based client side application for users to interact with. The SWING (JFC) toolkit will be used. �A J2EE-compliant application server to handle the middleware chores. (SUN ONE Application Server) �A JMS-complaint messaging product to tie all the subsystems together. (SUN ONE Message Queue, which is bundled within SUN ONE application server.) �A database server Ive read about EJBs(Session beans, entity beans) and the new Message Driven Bean. My design problem is that I don�t know how many beans are needed to implement the system. Users will have to login into the system, and their credentials shall be checked to those in the remote database located on the server. Upon successful login, if there are any messages pending for them, they could be sent to their pc (alert service). Also, I�d like to know what is the functionality of each bean. Can you plz provide some light on this design issue? Thanks a lot.. Hoping a reply from you soon, Aboo
From your description, it doesn't sound like Message Driven Beans are a fit for your problem. Yes, MDBs listen on JMS destinations for messages... however they are a server-side components. It appears to me that you need to create a listener directly from the client machine to the server. This takes MDBs out of the equation. If you are going to continue with a JMS based solution then you will need to register individual MessageListeners for each client. BTW, there is actually an entire book devoted to this subject titled Instant Messaging in Java. The big question is why are you trying to recreate the Chat/IM wheel when there are already so many good solutions?