/Hystrix-BaseCommands

Basic Commands for HTTP, REST and SOAP over Hystrix

Primary LanguageJavaApache License 2.0Apache-2.0

Hystrix-BaseCommands

Base Commands to be extended for your use for HTTP, REST and SOAP over Hystrix

Build Status - Project Status: Active – The project has reached a stable, usable state and is being actively developed.

Known Vulnerabilities

Example code

/**
*domainexample
*/
public class CommandGetOauth2ProtectedPing extends BaseHttpGetHystrixCommand<String> {

    public CommandGetOauth2ProtectedPing(String uri) {

        super(URI.create(uri), "oauth-ping-group");
    }


    @Override
    protected HttpRequest dealWithRequestBeforeSend(HttpRequest request) {
        return request.authorization("Bearer " + OAUth2Value.getMyOauth2Token());
    }

    @Override
    protected String getTargetPath() {
        return "/ping";
    }
}

//
//
// Use of the CommandGetOauth2ProtectedPing command above
//
log.trace("Calling {}", testServer.getUrl());
String returned_data = new CommandGetOauth2ProtectedPing(testServer.getUrl()).execute();
log.debug("Returned: " + returned_data);

Binaries

Binaries and dependency information for Maven, Ivy, Gradle and others can be found at http://mvnrepo.cantara.no.

Example for Maven:

<dependency>
      <groupId>no.cantara.base</groupId>
      <artifactId>Hystrix-BaseCommands</artifactId>
      <version>0.1.2</version>
</dependency>