Skip to content

Cantara/Hystrix-BaseCommands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

Basic Commands for HTTP, REST and SOAP over Hystrix

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages