brokerService.start();
final String brokerUri = brokerService.getTransportConnectors().get(0).getPublishableConnectString();
ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory(brokerUri);
connection = activeMQConnectionFactory.createQueueConnection();
session = connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE/*SESSION_TRANSACTED*/);
queue = session.createQueue("myqueue");
producer = session.createProducer(queue);
producer.setDeliveryMode(DeliveryMode.PERSISTENT);