/** * @return * @throws JMSException */ public Message createMessage() throws JMSException { return next.createMessage(); }
/** * @return * @throws JMSException */ public Message createMessage() throws JMSException { return next.createMessage(); }
/** * @return * @throws JMSException */ public Message createMessage() throws JMSException { return next.createMessage(); }
/** * @return * @throws JMSException */ public Message createMessage() throws JMSException { return next.createMessage(); }
/** * @return * @throws JMSException */ public Message createMessage() throws JMSException { return next.createMessage(); }
@Test public void testTempTopicDelete() throws Exception { connection.start(); TopicSession topicSession = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); TemporaryTopic tempTopic = topicSession.createTemporaryTopic(); ActiveMQConnection newConn = (ActiveMQConnection) factory.createConnection(); try { TopicSession newTopicSession = newConn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); TopicPublisher publisher = newTopicSession.createPublisher(tempTopic); // need to wait here because the ActiveMQ client's temp destination map is updated asynchronously, not waiting can introduce a race assertTrue(Wait.waitFor(() -> newConn.activeTempDestinations.size() == 1, 2000, 100)); TextMessage msg = newTopicSession.createTextMessage("Test Message"); publisher.publish(msg); try { TopicSubscriber consumer = newTopicSession.createSubscriber(tempTopic); fail("should have gotten exception but got consumer: " + consumer); } catch (JMSException ex) { //correct } connection.close(); try { Message newMsg = newTopicSession.createMessage(); publisher.publish(newMsg); } catch (JMSException e) { //ok } } finally { newConn.close(); } }