Package javax.jms

Examples of javax.jms.QueueConnectionFactory.createQueueConnection()


    */
   public void testQueueConnection1() throws Exception
   {
      QueueConnectionFactory qcf = (QueueConnectionFactory)cf;

      QueueConnection qc = qcf.createQueueConnection();

      qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      qc.close();

View Full Code Here


        Queue queue = (Queue) initialContext.lookup(SAMPLE_QUEUE);
        Queue queueContext = (QueueinitialContext.lookup(SAMPLE_QUEUE_CONTEXT);


        // Create connection
        QueueConnection queueConnection = queueConnectionFactory.createQueueConnection();

        // Create session
        QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

        // Create sender
View Full Code Here

        // Lookup the Queues through their JNDI name
        Queue annotationQueue = (Queue) initialContext.lookup(SAMPLE_QUEUE_MDB_ANNOTATION);
        Queue xmlQueue = (Queue) initialContext.lookup(SAMPLE_QUEUE_MDB_XML);

        // Create connection
        queueConnection = queueConnectionFactory.createQueueConnection();

        // Create session
        queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

        // Create senders
View Full Code Here

   public void test_1() throws Exception
   {
      QueueConnectionFactory qcf = (QueueConnectionFactory)ic.lookup("/ConnectionFactory");
      Queue queue = (Queue)ic.lookup("/queue/Queue");

      QueueConnection qc =  qcf.createQueueConnection();
      QueueSession qs = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      QueueReceiver qreceiver = qs.createReceiver(queue, "targetMessage = TRUE");

      qc.start();
View Full Code Here

   public void testQueueConnectionConsumerWrongTemporaryDestination() throws Exception
   {
      InitialContext ctx = getInitialContext();
      QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
      Queue queue = null;
      QueueConnection connection = factory.createQueueConnection();
      try
      {
         QueueSession s = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         queue = s.createTemporaryQueue();
         QueueConnection connection2 = factory.createQueueConnection();
View Full Code Here

      QueueConnection connection = factory.createQueueConnection();
      try
      {
         QueueSession s = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         queue = s.createTemporaryQueue();
         QueueConnection connection2 = factory.createQueueConnection();
         try
         {
            connection2.createConnectionConsumer(queue, "", MockServerSessionPool.getServerSessionPool(), 1);
            fail("Expected an error listening to a temporary destination from a different connection");
         }
View Full Code Here

      // Get the ConnectionFactory from JNDI
      final QueueConnectionFactory factory = (QueueConnectionFactory) naimgContext.lookup(JNDI_NAME_CONNECTION_FACTORY);

      // Make a Connection
      final QueueConnection connection = factory.createQueueConnection();
      final QueueSession sendSession = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

      // Make the message
      final String contents = "Test Message Contents";
      final TextMessage message = sendSession.createTextMessage(contents);
View Full Code Here

   protected void connect() throws Exception
   {
      Context context = getInitialContext();
      queue = (Queue) context.lookup(QUEUE);
      QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);
      queueConnection = queueFactory.createQueueConnection();
      queueConnection.start();

      getLog().debug("Connection established.");
   }
View Full Code Here

      // Send a message
      Queue queue = (Queue) getInitialContext().lookup(jndiName);
      assertNotNull(queue);
      QueueConnectionFactory qCf = (QueueConnectionFactory) getInitialContext().lookup("ConnectionFactory");
      QueueConnection c = qCf.createQueueConnection();
      c.start();
      QueueSession s = c.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
      QueueSender sender = s.createSender(queue);
     
      // Message 1
View Full Code Here

         context = new InitialContext();

      }
      QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);
      queueConnection = queueFactory.createQueueConnection();

      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
      topicConnection = topicFactory.createTopicConnection();

      getLog().debug("Connection to spyderMQ established.");
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.