* Receive class that wraps PartialFunction, to avoid
scary scala types
* move AbstractActorContext to AbstractActor.ActorContext
* converting docs, many, many UntypedActor
* removing UntypedActor docs
* add unit test for ReceiveBuilder
* MiMa filters
* consistent use of getContext(), self(), sender()
* rename cross references
* migration guide
* skip samples for now
* improve match type safetyi, add matchUnchecked
* the `? extends P` caused code like this to compile:
`match(String.class, (Integer i) -> {})`
* added matchUnchecked, since it can still be useful (um, convenient)
to be able to do:
`matchUnchecked(List.class, (List<String> list) -> {})`
* eleminate some scala.Option
* preRestart
* findChild
* ActorIdentity.getActorRef
20 lines
613 B
Java
20 lines
613 B
Java
package docs.camel;
|
|
//#Consumer2
|
|
import akka.camel.CamelMessage;
|
|
import akka.camel.javaapi.UntypedConsumerActor;
|
|
|
|
public class Consumer2 extends UntypedConsumerActor {
|
|
public String getEndpointUri() {
|
|
return "jetty:http://localhost:8877/camel/default";
|
|
}
|
|
|
|
public void onReceive(Object message) {
|
|
if (message instanceof CamelMessage) {
|
|
CamelMessage camelMessage = (CamelMessage) message;
|
|
String body = camelMessage.getBodyAs(String.class, getCamelContext());
|
|
sender().tell(String.format("Received message: %s",body), self());
|
|
} else
|
|
unhandled(message);
|
|
}
|
|
}
|
|
//#Consumer2
|