Skip to content

Instantly share code, notes, and snippets.

@searler
Created February 9, 2014 19:49
Show Gist options
  • Save searler/8904954 to your computer and use it in GitHub Desktop.
Save searler/8904954 to your computer and use it in GitHub Desktop.
RxJava I/O using camel stream
public class CamelBlocking {
public static void main(String[] args) throws InterruptedException {
CamelContext camelContext = new DefaultCamelContext();
ReactiveCamel rx = new ReactiveCamel(camelContext);
Observable<String> observable = rx.toObservable(
"stream:in?scanStream=true", String.class);
observable.toBlockingObservable().forEach(new Action1<String>() {
@Override
public void call(String m) {
System.err.println(m);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment