March 2002
Beginner to intermediate
528 pages
10h 12m
English
The SimpleMessageClient sends messages to the queue that the SimpleMessageBean listens to. The client starts out by locating the connection factory and queue:
queueConnectionFactory = (QueueConnectionFactory)
jndiContext.lookup
("java:comp/env/jms/MyQueueConnectionFactory");
queue = (Queue)
jndiContext.lookup("java:comp/env/jms/QueueName"); Next, the client creates the queue connection, session, and sender:
queueConnection =
queueConnectionFactory.createQueueConnection();
queueSession =
queueConnection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
queueSender = queueSession.createSender(queue); Finally, the client sends several messages to the queue:
message = queueSession.createTextMessage(); for (int ...
Read now
Unlock full access