pekko/akka-docs/java/code/docs/camel/MyEndpoint.java

31 lines
684 B
Java
Raw Normal View History

2012-07-15 14:12:03 +02:00
package docs.camel;
//#Consumer-mina
import akka.camel.CamelMessage;
import akka.camel.javaapi.UntypedConsumerActor;
public class MyEndpoint extends UntypedConsumerActor{
2012-07-23 01:36:12 +02:00
private String uri;
2012-07-15 14:12:03 +02:00
public String getEndpointUri() {
return uri;
}
public void onReceive(Object message) throws Exception {
if (message instanceof CamelMessage) {
/* ... */
2012-07-23 01:36:12 +02:00
} else
unhandled(message);
2012-07-15 14:12:03 +02:00
}
// Extra constructor to change the default uri,
// for instance to "jetty:http://localhost:8877/example"
public MyEndpoint(String uri) {
this.uri = uri;
}
public MyEndpoint() {
2012-07-23 01:36:12 +02:00
this.uri = "mina:tcp://localhost:6200?textline=true";
2012-07-15 14:12:03 +02:00
}
}
//#Consumer-mina