Package org.springframework.jms.connection

Examples of org.springframework.jms.connection.CachingConnectionFactory$ConsumerCacheKey


                        container2.start();
                        consumer2Started.countDown();

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

                        final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(
                                singleConnectionFactory2);
                        final JmsTemplate template = new JmsTemplate(
                                cachingConnectionFactory);
                        final ActiveMQQueue queue = new ActiveMQQueue(
                                "testingqueue");
                        for (int i = 0; i < total; i++) {
                            template.send(queue, new MessageCreator() {

                                @Override
                                public Message createMessage(
                                        final Session session)
                                        throws JMSException {
                                    final TextMessage message = session
                                            .createTextMessage();
                                    message.setText("Hello World!");
                                    return message;
                                }
                            });
                        }
                        // give spring time to scale back again
                        while (container2.getActiveConsumerCount() > 1) {
                            System.out.println("active consumer count: "
                                    + container2.getActiveConsumerCount());
                            System.out.println("concurrent consumer count: "
                                    + container2.getConcurrentConsumers());
                            Thread.sleep(1000);
                        }
                        cachingConnectionFactory.destroy();
                        container2.destroy();
                    } catch (final Throwable t) {
                        t.printStackTrace();
                    }
                    return null;
View Full Code Here


                container2.start();


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

                final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(
                        singleConnectionFactory2);
                final JmsTemplate template = new JmsTemplate(
                        cachingConnectionFactory);
                final ActiveMQQueue queue = new ActiveMQQueue(TESTING_QUEUE);
                for (int i = 0; i < total; i++) {
View Full Code Here

                            mqQueueConnectionFactory.setHostName(environment.get(HOST_NAME_PARAMETER).toString());
                            mqQueueConnectionFactory.setPort(Integer.parseInt(environment.get(PORT_PARAMETER).toString()));
                            mqQueueConnectionFactory.setQueueManager(environment.get(QUEUE_MANAGER_PARAMETER).toString());
                            mqQueueConnectionFactory.setTransportType(Integer.parseInt(environment.get(TRANSPORT_TYPE_PARAMETER).toString()));

                            queueConnectionFactory = new CachingConnectionFactory(mqQueueConnectionFactory);

                            queueConnection = queueConnectionFactory.createQueueConnection();
                        }
                        return queueConnectionFactory;
                    } else if(name.startsWith(QUEUE_NAME_PREFIX)) {
View Full Code Here

TOP

Related Classes of org.springframework.jms.connection.CachingConnectionFactory$ConsumerCacheKey

Copyright © 2018 www.massapicom. 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.