Skip to content

Instantly share code, notes, and snippets.

@hinunbi
Created July 5, 2013 12:32
Show Gist options
  • Save hinunbi/5934232 to your computer and use it in GitHub Desktop.
Save hinunbi/5934232 to your computer and use it in GitHub Desktop.
ToMapTranslator.java
package camel.example.mailer;
import java.util.HashMap;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
public class ToMapTranslator implements Processor {
private final String MAIL_ID = "MailID";
public void process(Exchange exchange) throws Exception {
Message in = exchange.getIn();
String mailID = exchange.getProperty(MAIL_ID, String.class);
HashMap<String, String> requestResult = new HashMap<String, String>();
requestResult.put(MAIL_ID, mailID);
in.setBody(requestResult);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment