@Override public void tearDown() throws Exception { try { queueConnection.close(); topicConnection.close(); } catch (Exception ignored) { } finally { queueConnection = null; queueSession = null; topicConnection = null; topicSession = null; super.tearDown(); } }
@Override public void setUp() throws Exception { super.setUp(); try { queueConnection = queueConnectionFactory.createQueueConnection(); queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); topicConnection = topicConnectionFactory.createTopicConnection(); topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); queueConnection.start(); topicConnection.start(); } catch (Exception e) { throw new RuntimeException(e); } }