use of javax.jms.QueueConnection in project brave by openzipkin.
the class TracingConnection method createQueueSession.
// QueueConnection
@Override
public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException {
checkQueueConnection();
QueueSession qs = ((QueueConnection) delegate).createQueueSession(transacted, acknowledgeMode);
return TracingSession.create(qs, jmsTracing);
}
use of javax.jms.QueueConnection in project qpid-broker-j by apache.
the class QueueSessionTest method testQueueSessionCannotCreateDurableSubscriber.
@Test
public void testQueueSessionCannotCreateDurableSubscriber() throws Exception {
Topic topic = createTopic(getTestName());
QueueConnection queueConnection = getQueueConnection();
try {
QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
try {
queueSession.createDurableSubscriber(topic, "abc");
fail("expected exception did not occur");
} catch (javax.jms.IllegalStateException s) {
// PASS
}
} finally {
queueConnection.close();
}
}
use of javax.jms.QueueConnection in project qpid-broker-j by apache.
the class QueueSessionTest method testQueueSessionCannotCreateTopics.
@Test
public void testQueueSessionCannotCreateTopics() throws Exception {
QueueConnection queueConnection = getQueueConnection();
try {
QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
try {
queueSession.createTopic("abc");
fail("expected exception did not occur");
} catch (javax.jms.IllegalStateException s) {
// PASS
}
} finally {
queueConnection.close();
}
}
use of javax.jms.QueueConnection in project qpid-broker-j by apache.
the class QueueSenderTest method sendToUnknownQueue.
@Test
public void sendToUnknownQueue() throws Exception {
QueueConnection connection = ((QueueConnection) getConnectionBuilder().build());
try {
QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue invalidDestination = session.createQueue("unknown");
try {
QueueSender sender = session.createSender(invalidDestination);
sender.send(session.createMessage());
fail("Exception not thrown");
} catch (InvalidDestinationException e) {
// PASS
}
} finally {
connection.close();
}
}
use of javax.jms.QueueConnection in project qpid-broker-j by apache.
the class QueueSenderTest method anonymousSenderSendToUnknownQueue.
@Test
public void anonymousSenderSendToUnknownQueue() throws Exception {
QueueConnection connection = ((QueueConnection) getConnectionBuilder().setSyncPublish(true).build());
try {
QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue invalidDestination = session.createQueue("unknown");
try {
QueueSender sender = session.createSender(null);
sender.send(invalidDestination, session.createMessage());
fail("Exception not thrown");
} catch (InvalidDestinationException e) {
// PASS
}
} finally {
connection.close();
}
}
Aggregations