use of javax.jms.MessageProducer in project tomee by apache.
the class ActivationContainerOverwriteSystemTest method testConnection.
private void testConnection(final Connection connection) throws JMSException, InterruptedException {
try {
final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
final MessageProducer producer = session.createProducer(destination);
producer.send(session.createTextMessage(TEXT));
assertTrue(Listener.sync());
} finally {
try {
connection.close();
} catch (final JMSException e) {
// no-op
}
}
}
use of javax.jms.MessageProducer in project tomee by apache.
the class ApiLog method get.
@GET
@Path("/{txt}")
public Response get(@PathParam("txt") String txt) throws JMSException {
try (final Connection connection = connectionFactory.createConnection()) {
connection.start();
try (final Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE)) {
try (final MessageProducer producer = session.createProducer(vector)) {
final Message msg = session.createMessage();
msg.setStringProperty("txt", txt);
producer.send(msg);
}
}
}
return Response.ok().build();
}
use of javax.jms.MessageProducer in project tomee by apache.
the class ContextLookupBmpBean method testJmsConnection.
private void testJmsConnection(final Connection connection) throws JMSException {
final Session session = connection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
final Topic topic = session.createTopic("test");
final MessageProducer producer = session.createProducer(topic);
producer.send(session.createMessage());
producer.close();
session.close();
connection.close();
}
use of javax.jms.MessageProducer in project tomee by apache.
the class EncBmpBean method testJmsConnection.
private void testJmsConnection(final Connection connection) throws JMSException {
final Session session = connection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
final Topic topic = session.createTopic("test");
final MessageProducer producer = session.createProducer(topic);
producer.send(session.createMessage());
producer.close();
session.close();
connection.close();
}
use of javax.jms.MessageProducer in project tomee by apache.
the class ContextLookupCmpBean method testJmsConnection.
private void testJmsConnection(final Connection connection) throws JMSException {
final Session session = connection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
final Topic topic = session.createTopic("test");
final MessageProducer producer = session.createProducer(topic);
producer.send(session.createMessage());
producer.close();
session.close();
connection.close();
}
Aggregations