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() {
|
2013-02-18 13:43:09 +01:00
|
|
|
this.uri = "mina2:tcp://localhost:6200?textline=true";
|
2012-07-15 14:12:03 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//#Consumer-mina
|