Package javax.jms

Examples of javax.jms.TopicSession.createTopic()


   
    try
    {
      TopicSession session = connection_.createTopicSession
        (false, Session.CLIENT_ACKNOWLEDGE);
      Topic topic = session.createTopic("OpenJMSDemo-deals");
      TopicPublisher publisher = session.createPublisher(topic);
      int delivery_mode = DeliveryMode.PERSISTENT;
      ObjectMessage message = session.createObjectMessage(this);
      publisher.publish(message, delivery_mode, 1, 0);
      //      session.close();
View Full Code Here


    try
    {
      TopicSession session = connection_.createTopicSession
        (false, Session.CLIENT_ACKNOWLEDGE);
            connection_.start();
      Topic topic = session.createTopic(newTopic);
      TopicPublisher publisher = session.createPublisher(topic);
      int delivery_mode = DeliveryMode.NON_PERSISTENT;
      // need to copy message else destination will change, and ack will
      // fail.
      ObjectMessage message = session.createObjectMessage(data);
View Full Code Here

   
       TopicConnection connection = factory_.createTopicConnection();
       TopicSession session = connection.createTopicSession
         (false, Session.CLIENT_ACKNOWLEDGE);
             connection.start();
       Topic topic = session.createTopic("OpenJMSDemo-deals");
       // if the 'name' option has been specified then assume a
       // durable subscriber otherwise transient
       TopicSubscriber subscriber = null;
       subscriber = session.createDurableSubscriber(topic, "DealMgr");
       subscriber.setMessageListener(new DealManager());
View Full Code Here

            connection.start();
            TopicSession session = null;
            try
            {
                session = connection.createTopicSession(scenario.isTransacted(), scenario.getAcknowledge());
                Topic destination = session.createTopic(scenario.getInputDestinationName());
                TopicPublisher publisher = null;
                try
                {
                    publisher = session.createPublisher(destination);
                    publisher.setDeliveryMode(DeliveryMode.PERSISTENT);
View Full Code Here

            TopicConnection connection = (TopicConnection) getConnection();
            connection.start();
           
            // Send messages which don't match and do match the selector, checking message count
            TopicSession pubSession = connection.createTopicSession(true, org.apache.qpid.jms.Session.SESSION_TRANSACTED);
            Topic topic = pubSession.createTopic(TOPIC_NAME);
            TopicPublisher publisher = pubSession.createPublisher(topic);
           
            BDBStoreUpgradeTestPreparer.publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "false");
            pubSession.commit();
            assertEquals("DurableSubscription backing queue should still have 1 message on it",
View Full Code Here

    Topic expectedDestination = new StubTopic();

    MockControl mockSession = MockControl.createControl(TopicSession.class);
    TopicSession session = (TopicSession) mockSession.getMock();
    session.createTopic(DESTINATION_NAME);
    mockSession.setReturnValue(expectedDestination);
    mockSession.replay();

    testResolveDestination(session, expectedDestination, true);
View Full Code Here

    }

    private void initTopic() throws JMSException {
        topicConnection = (TopicConnection) connectionFactory.createConnection();
        TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        topic = topicSession.createTopic(TOPIC_NAME);
    }
}
View Full Code Here

        connection.close();

        TopicConnection topicConnection = pcf.createTopicConnection();
        TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicPublisher topicPublisher = topicSession.createPublisher(topicSession.createTopic("AA"));
        assertNotNull(topicPublisher.getTopic().getTopicName());

        topicConnection.close();
    }
View Full Code Here

        connection.close();

        TopicConnection topicConnection = pcf.createTopicConnection();
        TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicPublisher topicPublisher = topicSession.createPublisher(topicSession.createTopic("AA"));
        assertNotNull(topicPublisher.getTopic().getTopicName());

        topicConnection.close();
    }
View Full Code Here

            queueSession.close();

            TopicSession topicSession = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

            AMQTopic topic = (AMQTopic) topicSession.createTopic("silly.topic");

            assertEquals(topic.getExchangeName().toString(), "test.topic");

            AMQTopic tempTopic = (AMQTopic) topicSession.createTemporaryTopic();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.