ActiveMQQueue queue = new ActiveMQQueue("TEST");
// Send the messages to the Queue.
ActiveMQConnection producerConnection = (ActiveMQConnection) factory.createConnection();
producerConnection.setUseAsyncSend(true);
producerConnection.start();
Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = producerSession.createProducer(queue);
producer.setDeliveryMode(DeliveryMode.PERSISTENT);
for (int i = 1; i <= messageToSend; i++) {