/** * Convert a foreign JMS Message to a native ActiveMQ Message - Inbound or * visa-versa outbound. If the replyTo Destination instance is not null * then the Message is configured with the given replyTo value. * * @param message * The target message to convert to a native ActiveMQ message * @param replyTo * The replyTo Destination to set on the converted Message. * * @return the converted message * @throws JMSException */ public Message convert(Message message, Destination replyTo) throws JMSException { Message msg = convert(message); if (replyTo != null) { msg.setJMSReplyTo(replyTo); } else { msg.setJMSReplyTo(null); } return msg; }
producer = session.createProducer(queue); consumer = session.createConsumer(responseQueue); requestMessage.setJMSReplyTo(responseQueue); producer.send(requestMessage); long timeout = getReceiveTimeout();
if (jmsReplyTo != null) { try { jmsMessage.setJMSReplyTo(jmsReplyTo);
producer = session.createProducer(destination); consumer = session.createConsumer(responseQueue); requestMessage.setJMSReplyTo(responseQueue); if (logger.isDebugEnabled()) { logger.debug("Sending created message: " + requestMessage);
/** Sends a request and waits for a reply. The temporary queue is used for * the {@code JMSReplyTo} destination, and only one reply per request * is expected. * * @param message the message to send * * @return the reply message * * @exception JMSException if the JMS provider fails to complete the * request due to some internal error. */ public Message request(Message message) throws JMSException { message.setJMSReplyTo(tempQueue); sender.send(message); return (receiver.receive()); }
/** Sends a request and waits for a reply. The temporary topic is used for * the {@code JMSReplyTo} destination; the first reply is returned, * and any following replies are discarded. * * @param message the message to send * * @return the reply message * * @exception JMSException if the JMS provider fails to complete the * request due to some internal error. */ public Message request(Message message) throws JMSException { message.setJMSReplyTo(tempTopic); publisher.publish(message); return(subscriber.receive()); }
Destination destination = buildDestination(entry.getValue()); if (destination != null) { message.setJMSReplyTo(destination); } else { logUnbuildableDestination(entry.getKey(), JmsHeaders.REPLY_TO);
@Test public void jmsReplyToMappedToHeader() throws JMSException { Destination replyTo = new Destination() {}; javax.jms.Message jmsMessage = new StubTextMessage(); jmsMessage.setJMSReplyTo(replyTo); assertInboundHeader(jmsMessage, JmsHeaders.REPLY_TO, replyTo); }
message.setJMSReplyTo(jmsHeaderReplyTo);
message.setJMSReplyTo(replyToQueue);
message.setJMSReplyTo(null); converted = jmsMessageConvertor.convert(message);
/** * Copies the standard JMS and user defined properties from the givem * message to the specified message * * @param fromMessage the message to take the properties from * @param toMessage the message to add the properties to * @throws JMSException */ public static void copyProperties(Message fromMessage, Message toMessage) throws JMSException { toMessage.setJMSMessageID(fromMessage.getJMSMessageID()); toMessage.setJMSCorrelationID(fromMessage.getJMSCorrelationID()); toMessage.setJMSReplyTo(transformDestination(fromMessage.getJMSReplyTo())); toMessage.setJMSDestination(transformDestination(fromMessage.getJMSDestination())); toMessage.setJMSDeliveryMode(fromMessage.getJMSDeliveryMode()); toMessage.setJMSRedelivered(fromMessage.getJMSRedelivered()); toMessage.setJMSType(fromMessage.getJMSType()); toMessage.setJMSExpiration(fromMessage.getJMSExpiration()); toMessage.setJMSPriority(fromMessage.getJMSPriority()); toMessage.setJMSTimestamp(fromMessage.getJMSTimestamp()); Enumeration propertyNames = fromMessage.getPropertyNames(); while (propertyNames.hasMoreElements()) { String name = propertyNames.nextElement().toString(); Object obj = fromMessage.getObjectProperty(name); toMessage.setObjectProperty(name, obj); } } }
if (jmsReplyTo instanceof Destination) { try { jmsMessage.setJMSReplyTo((Destination) jmsReplyTo);
public Message request(Message message) throws JMSException { message.setJMSReplyTo(getTemporaryQueue()); getSender().send(message); return getReceiver().receive(); }
public Message request(Message message) throws JMSException { message.setJMSReplyTo(getTemporaryTopic()); getPublisher().publish(message); return (getSubscriber().receive()); }
jmsRequest.setJMSReplyTo(replyTo); connection.start(); if (logger.isDebugEnabled()) {
jmsRequest.setJMSReplyTo(replyTo); connection.start(); if (logger.isDebugEnabled()) {
@Test public void testJmsReplyToMappedToHeader() throws JMSException { Destination replyTo = new Destination() { }; javax.jms.Message jmsMessage = new StubTextMessage(); jmsMessage.setJMSReplyTo(replyTo); DefaultJmsHeaderMapper mapper = new DefaultJmsHeaderMapper(); Map<String, Object> headers = mapper.toHeaders(jmsMessage); Object attrib = headers.get(JmsHeaders.REPLY_TO); assertNotNull(attrib); assertSame(replyTo, attrib); }
public Message request(Message message) throws JMSException { message.setJMSReplyTo(getTemporaryTopic()); getPublisher().publish(message); return (getSubscriber().receive()); }
private void postGetMessage(Session session, Destination destination, Destination replyTo) throws Exception { MessageProducer producer = session.createProducer(destination); Message message = session.createBytesMessage(); message.setJMSReplyTo(replyTo); message.setStringProperty("Accept", "application/xml"); message.setStringProperty(org.apache.cxf.message.Message.REQUEST_URI, "/bookstore/books/123"); message.setStringProperty(org.apache.cxf.message.Message.HTTP_REQUEST_METHOD, "GET"); producer.send(message); producer.close(); }