camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From idioma <>
Subject How to get hold of the content of log:message
Date Fri, 11 Nov 2016 17:17:20 GMT
I have a route like this: 

       <camelContext xmlns="">
			<from uri="activemq:topic:inbox" />
			<log message="From: ${in.header.EmailAddress}" />
			<to uri="mock:result" />

My initial test looks like this:

@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)

public class MySpringXMLEmbeddedActiveMQTest{

	private Logger LOG =

	protected LogRecipientsProcessor processor = new LogRecipientsProcessor();
	protected Exchange exchange;

	protected ProducerTemplate template;
	protected MockEndpoint resultEndpoint;

	public void testMockEndpoint() throws Exception {
		EmailAddress recipients = new EmailAddress("");
		String header = "This is my header";
		template.sendBodyAndHeader("activemq:topic:inbox", recipients.toString(),

I am using a mock as endpoint and sending the body and the header. (The body
is my email address). I fail to see how I can test the logged message in
<log message="From: ${in.header.EmailAddress}" />. Do I have to read the
header from the exchange? Do I need to set the content of the log message
beforehand? Any available example would be most welcomed. 

Thank you,


View this message in context:
Sent from the Camel Development mailing list archive at

View raw message