mirror of https://github.com/apache/activemq.git
fix for https://issues.apache.org/activemq/browse/AMQ-2182;apache-camel test failures
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@758789 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9a0de1ccaf
commit
d2e9236f30
|
@ -30,6 +30,7 @@ import org.apache.camel.Converter;
|
|||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.Processor;
|
||||
import org.apache.camel.component.jms.JmsBinding;
|
||||
import org.apache.camel.component.jms.JmsEndpoint;
|
||||
|
||||
/**
|
||||
* @version $Revision$
|
||||
|
|
|
@ -16,24 +16,26 @@
|
|||
*/
|
||||
package org.apache.activemq.camel.component;
|
||||
|
||||
import static org.apache.activemq.camel.component.ActiveMQComponent.activeMQComponent;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.Message;
|
||||
|
||||
import org.apache.activemq.command.ActiveMQQueue;
|
||||
import org.apache.camel.CamelContext;
|
||||
import org.apache.camel.ContextTestSupport;
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.Processor;
|
||||
import org.apache.camel.builder.RouteBuilder;
|
||||
import static org.apache.activemq.camel.component.ActiveMQComponent.activeMQComponent;
|
||||
import org.apache.camel.component.jms.JmsExchange;
|
||||
import org.apache.camel.component.mock.MockEndpoint;
|
||||
import org.apache.camel.component.mock.AssertionClause;
|
||||
import org.apache.camel.component.mock.MockEndpoint;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Destination;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
@ -84,12 +86,13 @@ public class ActiveMQJmsHeaderRouteTest extends ContextTestSupport {
|
|||
public void process(Exchange exchange) throws Exception {
|
||||
// lets set the custom JMS headers using the JMS API
|
||||
JmsExchange jmsExchange = assertIsInstanceOf(JmsExchange.class, exchange);
|
||||
|
||||
Message inMessage = jmsExchange.getInMessage();
|
||||
inMessage.setJMSReplyTo(replyQueue);
|
||||
inMessage.setJMSCorrelationID(correlationID);
|
||||
inMessage.setJMSType(messageType);
|
||||
}
|
||||
}).to("activemq:test.b");
|
||||
}).to("activemq:test.b?preserveMessageQos=true");
|
||||
|
||||
from("activemq:test.b").to("mock:result");
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ public class ActiveMQReplyToHeaderUsingConverterTest extends ContextTestSupport
|
|||
protected RouteBuilder createRouteBuilder() throws Exception {
|
||||
return new RouteBuilder() {
|
||||
public void configure() throws Exception {
|
||||
from("activemq:test.a").to("activemq:test.b");
|
||||
from("activemq:test.a").to("activemq:test.b?preserveMessageQos=true");
|
||||
|
||||
from("activemq:test.b").to("mock:result");
|
||||
}
|
||||
|
|
|
@ -16,25 +16,31 @@
|
|||
*/
|
||||
package org.apache.activemq.camel.component;
|
||||
|
||||
import static org.apache.activemq.camel.component.ActiveMQComponent.activeMQComponent;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.hasEntry;
|
||||
import static org.hamcrest.Matchers.hasKey;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jms.Destination;
|
||||
|
||||
import static org.apache.activemq.camel.component.ActiveMQComponent.activeMQComponent;
|
||||
import org.apache.activemq.command.ActiveMQDestination;
|
||||
import org.apache.activemq.command.ActiveMQQueue;
|
||||
import org.apache.camel.CamelContext;
|
||||
import org.apache.camel.ContextTestSupport;
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.Headers;
|
||||
import org.apache.camel.Message;
|
||||
import org.apache.camel.Processor;
|
||||
import org.apache.camel.builder.RouteBuilder;
|
||||
import org.apache.camel.component.jms.JmsConstants;
|
||||
import org.apache.camel.component.mock.AssertionClause;
|
||||
import org.apache.camel.component.mock.MockEndpoint;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
/**
|
||||
* @version $Revision$
|
||||
|
@ -59,13 +65,26 @@ public class InvokeRequestReplyUsingJmsReplyToHeaderTest extends ContextTestSupp
|
|||
firstMessage.header("JMSXGroupID").isEqualTo(groupID);
|
||||
firstMessage.header("JMSReplyTo").isEqualTo(ActiveMQConverter.toDestination(replyQueueName));
|
||||
*/
|
||||
|
||||
|
||||
Map<String, Object> headers = new HashMap<String, Object>();
|
||||
headers.put("cheese", 123);
|
||||
headers.put("JMSReplyTo", replyQueueName);
|
||||
headers.put("JMSCorrelationID", correlationID);
|
||||
headers.put("JMSXGroupID", groupID);
|
||||
template.sendBodyAndHeaders("activemq:test.server", "James", headers);
|
||||
|
||||
|
||||
// Camel 2.0 ignores JMSReplyTo, so we're using replyTo MEP property
|
||||
template.request("activemq:test.server?replyTo=queue:test.reply", new Processor() {
|
||||
public void process(Exchange exchange) {
|
||||
exchange.getIn().setBody("James");
|
||||
Map<String, Object> headers = new HashMap<String, Object>();
|
||||
headers.put("cheese", 123);
|
||||
headers.put("JMSReplyTo", replyQueueName);
|
||||
headers.put("JMSCorrelationID", correlationID);
|
||||
headers.put("JMSXGroupID", groupID);
|
||||
exchange.getIn().setHeaders(headers);
|
||||
}
|
||||
});
|
||||
|
||||
resultEndpoint.assertIsSatisfied();
|
||||
|
||||
|
|
Loading…
Reference in New Issue