ticket #2322 updated camel to 2.10.0

ticket #1928  added camel samples to a proper sample project
This commit is contained in:
RayRoestenburg 2012-08-09 19:30:32 +02:00
parent 234ffa62e6
commit 7071ac2b8d
17 changed files with 144 additions and 193 deletions

View file

@ -26,7 +26,7 @@ public class HttpProducer extends UntypedProducerActor{
CamelMessage camelMessage = (CamelMessage) message;
Set<String> httpPath = new HashSet<String>();
httpPath.add(Exchange.HTTP_PATH);
return camelMessage.addHeaders(camelMessage.getHeaders(httpPath));
return camelMessage.withHeaders(camelMessage.getHeaders(httpPath));
} else return super.onTransformOutgoingMessage(message);
}

View file

@ -10,9 +10,10 @@ public class HttpTransformer extends UntypedActor{
public void onReceive(Object message) {
if (message instanceof CamelMessage) {
CamelMessage camelMessage = (CamelMessage) message;
CamelMessage replacedMessage = camelMessage.mapBody(new Function<String, String>(){
public String apply(String body) {
return body.replaceAll("Akka ", "AKKA ");
CamelMessage replacedMessage = camelMessage.mapBody(new Function<Object, String>(){
public String apply(Object body) {
String text = new String((byte[])body);
return text.replaceAll("Akka ", "AKKA ");
}
});
getSender().tell(replacedMessage);