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 (messageIdPattern) {
                    correlationId = messageCreator.getMessageID();
                }
                headers.setJMSMessageID(messageCreator.getMessageID());

View Full Code Here


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

    static class JMSBusLifeCycleListener implements BusLifeCycleListener {
View Full Code Here

    cfControl.replay();

    JmsTransactionManager tm = new JmsTransactionManager(cf);
    TransactionStatus ts = tm.getTransaction(new DefaultTransactionDefinition());
    JmsTemplate jt = new JmsTemplate(cf);
    jt.send(dest, new MessageCreator() {
      public Message createMessage(Session session) throws JMSException {
        return message;
      }
    });
    tm.commit(ts);
View Full Code Here

                        return resolv.resolveDestinationName(session,
                                                             jmsConfig.getReplyDestination(),
                                                             false);
                    }
                });
                jmsTemplate.send(destination2, messageCreator);
            }
        };

        t.start();
       
View Full Code Here

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

                                public Message createMessage(
                                        final Session session)
                                        throws JMSException {
                                    final TextMessage message = session
View Full Code Here

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

                        public Message createMessage(final Session session)
                                throws JMSException {
                            final TextMessage message = session
                                    .createTextMessage();
View Full Code Here

                });

        JmsTemplate template = (JmsTemplate) ctx.getBean("jmsTemplate");
        Destination destination = (Destination) ctx.getBean("destination");

        template.send(destination, new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                return session.createTextMessage("Hello World");
            }
        });
       
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
View Full Code Here

                // there should be a JMSReplyTo so we know where to send the reply
                final Destination replyTo = msg.getJMSReplyTo();

                // send reply
                jms.send(replyTo, new MessageCreator() {
                    public Message createMessage(Session session) throws JMSException {
                        TextMessage replyMsg = session.createTextMessage();
                        replyMsg.setText("My name is Arnio");
                        replyMsg.setJMSCorrelationID(msg.getJMSCorrelationID());
                        return replyMsg;
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.