try
{
ic = new InitialContext();
cf = (ConnectionFactory)ic.lookup("/HttpConnectionFactory");
Queue queue = (Queue)ic.lookup(destinationName);
log("Queue " + destinationName + " exists");
connection = cf.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer sender = session.createProducer(queue);
TextMessage message = session.createTextMessage("Hello!");
sender.send(message);
log("The message was successfully sent to the " + queue.getQueueName() + " queue");
connection2 = cf.createConnection();
Session session2 = connection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = session2.createConsumer(queue);