Package org.springframework.jms.listener

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


            }

        });
        messageListenerContainer.afterPropertiesSet();

        messageListenerContainer.start();

        countDownLatch.await();
        messageListenerContainer.stop();
        messageListenerContainer.destroy();
View Full Code Here


                    latch.countDown();
                }
            });
            container.setMaxMessagesPerTask(1);
            container.afterPropertiesSet();
            container.start();

            final String finalBroker2Uri = broker2Uri;

            pool.submit(new Callable<Object>() {
                @Override
View Full Code Here

                public void onMessage(final Message message) {
                    broker1Count.incrementAndGet();
                }
            });
            container1.afterPropertiesSet();
            container1.start();
            consumer1Started.countDown();
            pool.submit(new Callable<Object>() {

                @Override
                public Object call() throws Exception {
View Full Code Here

                            public void onMessage(final Message message) {
                                broker2Count.incrementAndGet();
                            }
                        });
                        container2.afterPropertiesSet();
                        container2.start();
                        consumer2Started.countDown();

                        assertTrue("wait for start signal", startProducer.await(20, TimeUnit.SECONDS));

                        final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(
View Full Code Here

            public void onMessage(final Message message) {
                broker1Count.incrementAndGet();
            }
        });
        container1.afterPropertiesSet();
        container1.start();
        pool.submit(new Callable<Object>() {

            @Override
            public Object call() throws Exception {
                System.setProperty("lbt.brokerName", "two");
View Full Code Here

                    public void onMessage(final Message message) {
                        broker2Count.incrementAndGet();
                    }
                });
                container2.afterPropertiesSet();
                container2.start();


                assertTrue("wait for start signal", startProducer.await(20, TimeUnit.SECONDS));

                final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(
View Full Code Here

        this.handler = handler;
    }
       
    public void activateObject(Object obj) throws Exception {
        DefaultMessageListenerContainer listener = (DefaultMessageListenerContainer)obj;
        listener.start();
    }

    public void destroyObject(Object obj) throws Exception {
        DefaultMessageListenerContainer listener = (DefaultMessageListenerContainer)obj;
        listener.destroy();
View Full Code Here

    container.setConnectionFactory(cf);
    container.setMessageListener(messageDispatcher);
    container.setDestinationName(topicName);
    container.setPubSubDomain(true);
    container.afterPropertiesSet();
    container.start();

    Random random = new Random();
    byte[] randomBytes = new byte[1024];
    random.nextBytes(randomBytes);
   
View Full Code Here

    container.setConnectionFactory(cf);
    container.setMessageListener(requestDispatcher);
    container.setDestinationName(topicName);
    container.setPubSubDomain(true);
    container.afterPropertiesSet();
    container.start();

    byte[] randomBytes = new byte[1024];
    random.nextBytes(randomBytes);
   
    while(!container.isRunning()) {
View Full Code Here

          throw new RuntimeException(e);
        }
      }
    });
    container.afterPropertiesSet();
    container.start();
    // send Message
    JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory);
    jmsTemplate.setDefaultDestination(queue);
    jmsTemplate.convertAndSend("Hello World");
  }
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.