The Java Message Service (JMS) is a Java API that provide a common way for JAVA applications to create, send, receive and read messages in a distributed environment.
![]() |
The term Broker refers to the software component that routes and delivers messages. The Sun ONE Message Queue (MQ) message service is bundled with the Sun ONE Application Server, and it consists of one or more Sun ONE MQ brokers. The JMS resources that you can manage are connection factories and destinations. |
A connection factory is an object that a JMS client uses to create a connection with a provider. At the beginning of a JMS client program, you usually perform a JNDI API lookup of the connection factory For example, the following code fragment obtains an InitialContext object and uses it to look up the QueueConnectionFactory and the TopicConnectionFactory by name:
Context ctx = new InitialContext(); QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) ctx.lookup("QueueConnectionFactory"); TopicConnectionFactory topicConnectionFactory = (TopicConnectionFactory) ctx.lookup("TopicConnectionFactory");
A destination is an object that a JMS client uses to specify the target of messages it produces and the source of messages it consumes. In addition to looking up a connection factory, you usually look up a destination. For example, the following line of code performs a JNDI API lookup of the MyTopic and the MyQueue by name:
Topic myTopic = (Topic) ctx.lookup("MyTopic"); Queue myQueue = (Queue) ctx.lookup("MyQueue");
To create a JMS connection factory definition:
In the Explorer's Runtime tab,
expand the Server Registry
Installed Servers
Sun ONE Application Server 7 node.
![]() |
If you do not see any Administration Server nodes, the Administration Server of the Sun ONE Application Server must be added under the Installed Servers subnode of the Server Registry node. See here for more information. |
To create a JMS destination definition:
To register a JMS resource definition to an application server instance:
To delete a JMS resource from an application server instance:
See also | |
JMS Resources Property Sheet Registering a Resource Server Instance |