queueConnection.start();
drainQueue();
QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue queue = (Queue) context.lookup(TEST_QUEUE);
QueueSender sender = session.createSender(queue);
TextMessage message = session.createTextMessage();
message.setText("Normal message");
sender.send(message, DeliveryMode.NON_PERSISTENT, 4, 0);
//sender.send(queue, message, DeliveryMode.NON_PERSISTENT, 4, 0);
message.setText("Persistent message");
sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
//sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
message.setText("High Priority Persistent message");
sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
//sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
//message.setText("Expiring Persistent message");
//sender.send(queue, message, DeliveryMode.NON_PERSISTENT, 4, 1);
QueueBrowser browser = session.createBrowser(queue);
Enumeration i = browser.getEnumeration();
//message = (TextMessage)enum.nextElement();
//if( !message.getText().equals("High Priority Persistent message") )
// throw new Exception("Queue is not prioritizing messages correctly. Unexpected Message:"+message);
getLog().debug(message.getText());