Skip Navigation Links | |
Exit Print View | |
Oracle GlassFish Server Message Queue 4.5 Developer's Guide for Java Clients |
3. Message Queue Clients: Design and Features
4. Using the Metrics Monitoring API
6. Embedding a Message Queue Broker in a Java Client
Creating, Initializing and Starting an Embedded Broker
Creating a Broker Event Listener
Arguments to Specify When Initializing an Embedded Broker
Creating a TCP Connection to an Embedded Broker
Stopping and Shutting Down an Embedded Broker
Once an embedded broker has been started, you can create direct connections to it from the client in which it is embedded. To do so, you create a connection as you would with an ordinary broker, but you specify mq://localhost/direct as broker address in the connection factory. For example:
com.sun.messaging.ConnectionFactory cf = new com.sun.messaging.ConnectionFactory(); cf.setProperty(ConnectionConfiguration.imqAddressList, "mq://localhost/direct"); Connection connection = cf.createConnection();