First JMS application
In the following sections, we are going to show how to send a text message from a servlet (acting as a producer) to a consumer (an MDB) using a topic destination.
Creating administered objects
As mention earlier, two administered objects are needed by JMS clients to start exchanging messages—destinations and connection factories. In this section, we are going to create those two administered objects to be used in our basic JMS example, from the GlassFish administration console. However, in a later section, we are going to show how can you define those administered objects from inside your application itself, using simple annotations.
Creating a destination
Log in to your GlassFish administration console by browsing to http://localhost:9322
(change the port to the one bound to your GlassFish administration HTTP listener if necessary):
- From the
Common Tasks
pane, navigate toÂResources
|ÂJMSÂ
Resources
|ÂDestinationÂ
Resources
- Click
New
- In
JNDI Name
, writejms/ticketsReservationTopic...