Package javax.jms

Examples of javax.jms.TopicConnection.createTopicSession()


   {
      TopicConnection conn = getTopicConnectionFactory().createTopicConnection();

      try
      {
         TopicSession s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         TopicPublisher publisher = s.createPublisher(HornetQServerTestCase.topic1);
         TopicSubscriber sub = s.createSubscriber(HornetQServerTestCase.topic1);
         conn.start();

         // Create 3 object messages with different bodies
View Full Code Here


      try
      {
         consumerConnection = JMSTestCase.cf.createConnection();
         TopicConnection tc = (TopicConnection)consumerConnection;

         TopicSession consumerSession = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

         TopicSubscriber topicConsumer = consumerSession.createSubscriber(HornetQServerTestCase.topic1);

         topicConsumer.close();
View Full Code Here

   {
      TopicConnectionFactory tcf = JMSTestCase.topicCf;

      TopicConnection tc = tcf.createTopicConnection();

      tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      tc.close();

   }
View Full Code Here

      try
      {
         conn = JMSTestCase.cf.createTopicConnection();

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

         try
         {
            ts.createSubscriber(null);
            ProxyAssertSupport.fail("this should fail");
View Full Code Here

      try
      {
         conn = JMSTestCase.cf.createTopicConnection();
         conn.setClientID("sofiavergara");

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

         try
         {
            ts.unsubscribe("invalid-subscription-name");
            ProxyAssertSupport.fail("this should fail");
View Full Code Here

      try
      {
         c = JMSTestCase.cf.createTopicConnection();
         c.setClientID("something");

         TopicSession s = c.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

         try
         {
            s.createSubscriber(HornetQServerTestCase.topic1, "=TEST 'test'", false);
            ProxyAssertSupport.fail("this should fail");
View Full Code Here

        final InitialContext ctx = new InitialContext();
        final TopicConnectionFactory factory = (TopicConnectionFactory) ctx.lookup("java:/JmsXA");
        final TopicConnection connection = factory.createTopicConnection();
        connection.start();
        try {
            final TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
            final Message message = session.createTextMessage("Test");
            final Destination destination = (Destination) ctx.lookup("topic/test");
            final MessageProducer producer = session.createProducer(destination);
            producer.send(message);
            producer.close();
View Full Code Here

    try {
      final TopicConnection connection = topicFactory.createTopicConnection();

      connection.start();

      final TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      final TopicPublisher publisher = session.createPublisher(topic);

      final MapMessage message = session.createMapMessage();
View Full Code Here

   {
      TopicConnectionFactory tcf = (TopicConnectionFactory)cf;

      TopicConnection tc = tcf.createTopicConnection();

      tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      tc.close();

   }
View Full Code Here

   {
      TopicConnection conn1 = ((TopicConnectionFactory)cf).createTopicConnection();
      TopicConnection conn2 = ((TopicConnectionFactory)cf).createTopicConnection();
     
      TopicSession sess1 = conn1.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
      TopicSession sess2 = conn2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
     
      TopicSubscriber sub1 = sess1.createSubscriber(topic1);
      TopicSubscriber sub2 = sess2.createSubscriber(topic1);
     
      conn1.start();
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.