Package org.springframework.jms.core

Examples of org.springframework.jms.core.JmsTemplate.send()


         * If the message is not oneWay we will expect to receive a reply on the listener.
         *
         */
        if (!exchange.isOneWay()) {
            synchronized (exchange) {
                jmsTemplate.send(jmsConfig.getTargetDestination(), messageCreator);
                if (correlationId == null) {
                    correlationId = messageCreator.getMessageID();
                }
                headers.setJMSMessageID(messageCreator.getMessageID());

View Full Code Here


                        }
                    }
                }
            }
        } else {
            jmsTemplate.send(jmsConfig.getTargetDestination(), messageCreator);
            headers.setJMSMessageID(messageCreator.getMessageID());
        }
    }

    private String createCorrelationId(final Exchange exchange, String userCID) {
View Full Code Here

                    return;
                }
            }

            getLogger().log(Level.FINE, "send out the message!");
            jmsTemplate.send(replyTo, new MessageCreator() {
                public javax.jms.Message createMessage(Session session) throws JMSException {
                    javax.jms.Message reply = JMSUtils.createAndSetPayload(replyObj, session, msgType);

                    reply.setJMSCorrelationID(determineCorrelationID(request));
View Full Code Here

            cf2.setUseAsyncSend(false);

            final JmsTemplate template1 = new JmsTemplate(cf1);
            template1.setReceiveTimeout(10000);

            template1.send("test.q", new MessageCreator() {

                public Message createMessage(Session session) throws JMSException {
                    return session.createTextMessage("test");
                }
View Full Code Here

            final TextMessage tm = (TextMessage)m;

            Assert.assertEquals("test", tm.getText());

            template2.send("test2.q", new MessageCreator() {

                public Message createMessage(Session session) throws JMSException {
                    return session.createTextMessage("test2");
                }
View Full Code Here

        String compositeQueue = "compositeA,compositeB";

        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost");
        JmsTemplate jt = new JmsTemplate(cf);

        jt.send(compositeQueue, new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                TextMessage tm = session.createTextMessage();
                tm.setText("test");
                return tm;
            }
View Full Code Here

                tm.setText("test");
                return tm;
            }
        });

        jt.send("noCompositeA", new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                TextMessage tm = session.createTextMessage();
                tm.setText("test");
                return tm;
            }
View Full Code Here

                tm.setText("test");
                return tm;
            }
        });

        jt.send("noCompositeB", new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                TextMessage tm = session.createTextMessage();
                tm.setText("test");
                return tm;
            }
View Full Code Here

                Thread.sleep(2000);

                final AtomicInteger count = new AtomicInteger();
                for (int i = 0; i < NUM_MESSAGE_TO_SEND; i++) {
                    jmsTemplate.send(queueName, new MessageCreator() {

                        public Message createMessage(Session session) throws JMSException {

                            final BytesMessage message = session.createBytesMessage();
View Full Code Here

                Thread.sleep(2000);

                final AtomicInteger count = new AtomicInteger();
                for (int i = 0; i < NUM_MESSAGE_TO_SEND; i++) {
                    jmsTemplate.send(queueName, new MessageCreator() {

                        public Message createMessage(Session session) throws JMSException {

                            final BytesMessage message = session.createBytesMessage();
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.