Java Reference
In-Depth Information
NetBeans adds the GlassFish resources we created to a file called glassfish-
resources.xml . When we deploy our project to GlassFish, it reads this file and
creates the resources defined in it. We can see the content of this file by expanding
the Server Resources node in the Projects view and double-clicking on its name.
Sending messages to a message destination
Once we have created our connection factory and destination (queue or topic),
we need to write some code to send messages to it.
In our example, we will use the application client to send messages to the queue.
NetBeans can generate a lot of the necessary boilerplate code automatically. In order
to generate this code, the connection factory and destination to be used need to be
created in the server, recall we mentioned in the previous section that GlassFish JMS
resources created with NetBeans aren't actually created until we deploy our project.
In order for these resources to be available to our application client, we need to
deploy the project to have these resources created.
After we have deployed our project, we can generate the JMS code opening the main
class ( ) for the application client project, right-clicking on its source, and
selecting Insert Code, then selecting Send JMS Message from the resulting pop up
Search WWH ::

Custom Search