protected <T> Observable<T> createEndpointObservable(final Endpoint endpoint,
final Func1<Exchange, T> converter) {
Func1<Observer<Message>, Subscription> func = new Func1<Observer<Message>, Subscription>() {
@Override
public Subscription call(Observer<Message> observer) {
return new EndpointSubscription(endpoint, observer, converter);
}
};
return new EndpointObservable(endpoint, func);
}