Package org.springframework.jms.core

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


                    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


         * fill to Message and notify this thread
         */
        if (!exchange.isOneWay()) {
            synchronized (exchange) {
                correlationMap.put(correlationId, exchange);
                jmsTemplate.send(jmsConfig.getTargetDestination(), messageCreator);
               
                if (exchange.isSynchronous()) {
                    try {
                        exchange.wait(jmsTemplate.getReceiveTimeout());
                    } catch (InterruptedException e) {
View Full Code Here

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

    /**
     * When a message is received on the reply destination the correlation map is searched for the
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

   
    public void receiveAndRespondWithMessageIdAsCorrelationId() throws JmsException, JMSException {
        JmsTemplate template = new JmsTemplate(connectionFactory);       
        final javax.jms.Message message = template.receive("queue:test");
        requestMessageId = message.getJMSMessageID();
        template.send(message.getJMSReplyTo(), new MessageCreator() {

            public javax.jms.Message createMessage(Session session) throws JMSException {
                TextMessage replyMessage =  session.createTextMessage("Result");
                replyMessage.setJMSCorrelationID(message.getJMSMessageID());
                return replyMessage;
View Full Code Here

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

        t.start();
       
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

         * 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 resolv.resolveDestinationName(session,
                                                             jmsConfig.getReplyDestination(),
                                                             false);
                        }
                    });
                jmsTemplate.send(destination2, messageCreator);
            }
        };

        t.start();
       
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.