Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

How to setup set JMS factory and queue in glassfish

This tutorial assumes that you already have glassfish installed and running on your local machine.

1.) To check the default setting of your JMS broker navigate to Configurations->server-config->Java Message Service->JMS Hosts->default_JMS_host.


2.) Create JMS Connection Factory by navigating to Resources->JMS Resources->Connection Factories. For example if we want to add a jms queue factory click New and fill the ff details:
Pool Name: ipielPool
Resource Type: javax.jms.QueueConnectionFactory
Leave everything as default
Click Ok

3.) Then create a JMS queue by navigating to Resources->JMS Resources->Destination Resources, select New and fill the ff details:
JNDI Name: jms/IpielQueue
Physical destination name: jmsIpielQueue
Resource Type: javax.jms.Queue
Leave everything as default
Click Ok

Now you have successfully setup a JMS Queue broker which you can use to send and receive jms message (both synchronous and asynchronous).

Synchronous - need to manually call the QueueReceiver.receive method
Asynchronous - requires message listener
How to setup set JMS factory and queue in glassfish How to setup set JMS factory and queue in glassfish Reviewed by Edward Legaspi on Monday, June 25, 2012 Rating: 5

No comments:

Powered by Blogger.