Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
runHystrixCommand(
COMMAND_GROUP,
COMMAND_KEY,
TIMEOUT_IN_MILLIS,
new Callable<Observable<HttpResponse>>() {
@Override
public Observable<HttpResponse> call() throws Exception {
return Observable.just(request.execute().returnResponse());
}
}
).subscribe(new Action1<HttpResponse>() {
@Override
public void call(final HttpResponse httpResponse) {
statusCode.set(httpResponse.getStatusLine().getStatusCode());
}
}, new Action1<Throwable>() {
@Override
public void call(final Throwable throwable) {
logger.error(String.format("Error calling webhook %s", webHook), throwable);
statusCode.set(HttpStatus.INTERNAL_SERVER_ERROR.value());
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.