Skip to content

Gateway for Apache Thrift requests processing that is built on Spring Cloud stack

License

Notifications You must be signed in to change notification settings

Guchman/spring-thrift-api-gateway

 
 

Repository files navigation

Thrift API Gateway for Spring

Join the chat at https://gitter.im/aatarasoff/spring-thrift-api-gateway Build Status

What it is about

Gateway for Apache Thrift requests processing that is built on Spring Cloud stack. Project depends on core functionality that is described in https://github.com/aatarasoff/thrift-api-gateway-core

How to connect the project

Its very simple:

repositories {
    jcenter()
}
compile 'info.developerblog.spring.thrift:spring-thrift-api-gateway:1.0.0.RC1'

How to use this

Add annotations @EnableThriftClient and @EnableZuulProxy to your spring boot main application class

@SpringBootApplication
@EnableZuulProxy
@EnableThriftGateway
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Next you need to create AuthTokenExchanger implementation and register it as a bean

@Bean
    AuthTokenExchanger authTokenExchanger() {
        return new AuthTokenExchanger<Token, User>() {
            @Override
            public Token createEmptyAuthToken() {
                return new Token();
            }

            @Override
            public User process(Token authToken) throws TException {
                // you token exchange logic
            }
        };
    }

Last, you need configure Zuul with static routes or with dynamic cloud

Enjoy!

About

Gateway for Apache Thrift requests processing that is built on Spring Cloud stack

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%