Search in sources :

Example 21 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 22 with Topic

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

the class EncSingletonBean 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 23 with Topic

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

the class ContextLookupSingletonBean 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 24 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 25 with Topic

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

the class AnnotatedFieldInjectionMdbBean 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)59 Session (javax.jms.Session)36 MessageProducer (javax.jms.MessageProducer)31 JMSException (javax.jms.JMSException)14 NamingException (javax.naming.NamingException)14 TextMessage (javax.jms.TextMessage)9 LaserCreateException (cern.laser.business.LaserCreateException)6 LaserRuntimeException (cern.laser.business.LaserRuntimeException)6 Message (javax.jms.Message)6 Test (org.junit.Test)6 TopicSession (javax.jms.TopicSession)5 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 PublicAtsApi (com.axway.ats.common.PublicAtsApi)2 ACSJMSTextMessage (com.cosylab.acs.jms.ACSJMSTextMessage)2 ArrayList (java.util.ArrayList)2 Iterator (java.util.Iterator)2 MessageConsumer (javax.jms.MessageConsumer)2 MessageListener (javax.jms.MessageListener)2