Package org.springframework.jms.listener

Examples of org.springframework.jms.listener.DefaultMessageListenerContainer.afterPropertiesSet()


            doneLatch = new CountDownLatch(NUM_MESSAGE_TO_SEND * MAX_PRODUCERS);

            container1 = createDefaultMessageListenerContainer(acf2, new TestMessageListener1(500), QUEUE1_NAME);
            container1.afterPropertiesSet();
            container2 = createDefaultMessageListenerContainer(acf2, new TestMessageListener1(30000), QUEUE2_NAME);
            container2.afterPropertiesSet();

            final ExecutorService executor = Executors.newCachedThreadPool();
            for (int i = 0; i < MAX_PRODUCERS; i++) {
                executor.submit(new NonPooledProducerTask(acf1, QUEUE2_NAME));
                Thread.sleep(1000);
View Full Code Here


            pcf2 = new PooledConnectionFactory(acf2);
            pcf3 = new PooledConnectionFactory(acf3);
            pcf4 = new PooledConnectionFactory(acf4);

            container1 = createDefaultMessageListenerContainer(acf2, new TestMessageListener1(0), QUEUE1_NAME);
            container1.afterPropertiesSet();

            final PooledProducerTask[] task = new PooledProducerTask[4];
            task[0] = new PooledProducerTask(pcf1, QUEUE1_NAME, "producer1");
            task[1] = new PooledProducerTask(pcf2, QUEUE1_NAME, "producer2");
            task[2] = new PooledProducerTask(pcf3, QUEUE1_NAME, "producer3");
View Full Code Here

            acf = createConnectionFactory(URL1, USE_FAILOVER);
            pcf = new PooledConnectionFactory(acf);
            // Only listen on the first queue.. let the 2nd queue fill up.
            doneLatch = new CountDownLatch(TOTAL_MESSAGES);
            container1 = createDefaultMessageListenerContainer(acf, new TestMessageListener1(0), QUEUE1_NAME);
            container1.afterPropertiesSet();
            Thread.sleep(5000);
            final ExecutorService executor = Executors.newCachedThreadPool();
            for (int i = 0; i < MAX_PRODUCERS; i++) {
                executor.submit(new PooledProducerTask(pcf, QUEUE1_NAME));
            }
View Full Code Here

      pcf = new PooledConnectionFactory(acf);

      // Only listen on the first queue.. let the 2nd queue fill up.
      doneLatch = new CountDownLatch(NUM_MESSAGE_TO_SEND);
      container1 = createDefaultMessageListenerContainer(acf,  new TestMessageListener1(500), QUEUE1_NAME);
      container1.afterPropertiesSet();

      Thread.sleep(2000);

      final ExecutorService executor = Executors.newCachedThreadPool();
      for (int i = 0; i < MAX_PRODUCERS; i++) {
View Full Code Here

      Thread.sleep(1000);

      doneLatch = new CountDownLatch(MAX_PRODUCERS * NUM_MESSAGE_TO_SEND);
      container1 = createDefaultMessageListenerContainer(acf2, new TestMessageListener1(500), QUEUE1_NAME);
      container1.afterPropertiesSet();

      final ExecutorService executor = Executors.newCachedThreadPool();
      for (int i = 0; i < MAX_PRODUCERS; i++) {
        executor.submit(new PooledProducerTask(pcf, QUEUE2_NAME));
        Thread.sleep(1000);
View Full Code Here

      doneLatch = new CountDownLatch(NUM_MESSAGE_TO_SEND*MAX_PRODUCERS);

      container1 = createDefaultMessageListenerContainer(acf2, new TestMessageListener1(500), QUEUE1_NAME);
      container1.afterPropertiesSet();
      container2 = createDefaultMessageListenerContainer(acf2, new TestMessageListener1(30000), QUEUE2_NAME);
      container2.afterPropertiesSet();

      final ExecutorService executor = Executors.newCachedThreadPool();
      for (int i = 0; i < MAX_PRODUCERS; i++) {
        executor.submit(new NonPooledProducerTask(acf1, QUEUE2_NAME));
        Thread.sleep(1000);
View Full Code Here

            // defaultMessageListenerContainer.afterPropertiesSet();
            // defaultMessageListenerContainer.start();
        }

        for (DefaultMessageListenerContainer defaultMessageListenerContainer : defaultMessageListenerContainers) {
            defaultMessageListenerContainer.afterPropertiesSet();
            defaultMessageListenerContainer.start();
        }
    }

    @PreDestroy
View Full Code Here

            pcf2 = new PooledConnectionFactory(acf2);
            pcf3 = new PooledConnectionFactory(acf3);
            pcf4 = new PooledConnectionFactory(acf4);

            container1 = createDefaultMessageListenerContainer(acf2, new TestMessageListener1(0), QUEUE1_NAME);
            container1.afterPropertiesSet();

            final PooledProducerTask[] task = new PooledProducerTask[4];
            task[0] = new PooledProducerTask(pcf1, QUEUE1_NAME, "producer1");
            task[1] = new PooledProducerTask(pcf2, QUEUE1_NAME, "producer2");
            task[2] = new PooledProducerTask(pcf3, QUEUE1_NAME, "producer3");
View Full Code Here

            acf = createConnectionFactory(URL1, USE_FAILOVER);
            pcf = new PooledConnectionFactory(acf);
            // Only listen on the first queue.. let the 2nd queue fill up.
            doneLatch = new CountDownLatch(TOTAL_MESSAGES);
            container1 = createDefaultMessageListenerContainer(acf, new TestMessageListener1(0), QUEUE1_NAME);
            container1.afterPropertiesSet();
            Thread.sleep(5000);
            final ExecutorService executor = Executors.newCachedThreadPool();
            for (int i = 0; i < MAX_PRODUCERS; i++) {
                executor.submit(new PooledProducerTask(pcf, QUEUE1_NAME));
            }
View Full Code Here

            pcf = new PooledConnectionFactory(acf);

            // Only listen on the first queue.. let the 2nd queue fill up.
            doneLatch = new CountDownLatch(NUM_MESSAGE_TO_SEND);
            container1 = createDefaultMessageListenerContainer(acf, new TestMessageListener1(500), QUEUE1_NAME);
            container1.afterPropertiesSet();

            Thread.sleep(2000);

            final ExecutorService executor = Executors.newCachedThreadPool();
            for (int i = 0; i < MAX_PRODUCERS; i++) {
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.