8.4. Student Message-Driven Bean

Now let's move to an example that uses both publish/subscribe and point-to-point messaging. The example is a Student message-driven bean responding to topic messages broadcast from a School client. The idea is that the School publishes a list of new course topics to students who wish to be notified. Each new course has a name, course code, and price. Suppose a student who is interested in a new course uses a JSP program to “sign up” by recording his or her name and e-mail address in a database. When the School publishes a list of new courses, the Student bean checks the price of each course. If it's affordable, the Student bean reads the database and sends e-mail to each student with the new course information. ...

Get Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.