Search in sources :

Example 36 with Topic

use of javax.jms.Topic in project tomee by apache.

the class AnnotatedFieldInjectionStatefulBean method testJmsConnection.

private void testJmsConnection(final javax.jms.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();
}
Also used : MessageProducer(javax.jms.MessageProducer) Topic(javax.jms.Topic) Session(javax.jms.Session)

Example 37 with Topic

use of javax.jms.Topic in project tomee by apache.

the class ContextLookupStatefulBean 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();
}
Also used : MessageProducer(javax.jms.MessageProducer) Topic(javax.jms.Topic) Session(javax.jms.Session)

Example 38 with Topic

use of javax.jms.Topic in project tomee by apache.

the class ContextLookupStatefulPojoBean 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();
}
Also used : MessageProducer(javax.jms.MessageProducer) Topic(javax.jms.Topic) Session(javax.jms.Session)

Example 39 with Topic

use of javax.jms.Topic in project tomee by apache.

the class FieldInjectionStatefulBean method testJmsConnection.

private void testJmsConnection(final javax.jms.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();
}
Also used : MessageProducer(javax.jms.MessageProducer) Topic(javax.jms.Topic) Session(javax.jms.Session)

Example 40 with Topic

use of javax.jms.Topic in project tomee by apache.

the class SetterInjectionStatefulBean method testJmsConnection.

private void testJmsConnection(final javax.jms.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();
}
Also used : MessageProducer(javax.jms.MessageProducer) Topic(javax.jms.Topic) Session(javax.jms.Session)

Aggregations

Topic (javax.jms.Topic)69 Session (javax.jms.Session)40 MessageProducer (javax.jms.MessageProducer)34 JMSException (javax.jms.JMSException)22 NamingException (javax.naming.NamingException)14 TextMessage (javax.jms.TextMessage)13 Message (javax.jms.Message)9 LaserCreateException (cern.laser.business.LaserCreateException)6 LaserRuntimeException (cern.laser.business.LaserRuntimeException)6 TopicSession (javax.jms.TopicSession)6 Test (org.junit.Test)6 ConnectionFactory (javax.jms.ConnectionFactory)5 MessageListener (javax.jms.MessageListener)5 Connection (javax.jms.Connection)4 Queue (javax.jms.Queue)3 TopicConnection (javax.jms.TopicConnection)3 ActiveMQConnection (org.apache.activemq.ActiveMQConnection)3 AlarmImpl (cern.laser.business.data.AlarmImpl)2 JmsMessageException (com.axway.ats.action.exceptions.JmsMessageException)2 ManagedSession (com.axway.ats.action.jms.model.sessions.ManagedSession)2