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.
Note
Deploying the project at this point might generate a java.util.zip.ZipException
for the EJB module in the GlassFish output window. The reason for this is that we haven't yet added any EJBs to the module. This error can be safely ignored.
After we have deployed our project...