All Projects → aatarasoff → Spring Thrift Starter

aatarasoff / Spring Thrift Starter

Licence: mit
Set of cool annotations that helps you building Thrift applications with Spring Boot

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Spring Thrift Starter

Spring Thrift Api Gateway
Gateway for Apache Thrift requests processing that is built on Spring Cloud stack
Stars: ✭ 38 (-74.83%)
Mutual labels:  thrift, spring-boot, spring, spring-cloud
Spring Cloud Microservices Development
Spring Cloud Microservices Development.《Spring Cloud 微服务架构开发实战》
Stars: ✭ 106 (-29.8%)
Mutual labels:  spring-boot, spring, spring-cloud
Springbootdemo
springBoot demo
Stars: ✭ 97 (-35.76%)
Mutual labels:  spring-boot, spring, spring-cloud
Spring Cloud Sleuth
Distributed tracing for spring cloud
Stars: ✭ 1,531 (+913.91%)
Mutual labels:  spring-boot, spring, spring-cloud
Spring Cloud Cli
Spring Cloud CLI features
Stars: ✭ 139 (-7.95%)
Mutual labels:  spring-boot, spring, spring-cloud
Eureka Consul Adapter
This project contains a Spring Boot Starter that registers HTTP endpoints on a Spring Cloud Eureka server to support Prometheus's service discovery mechanism for Consul (<consul_sd_config>)
Stars: ✭ 93 (-38.41%)
Mutual labels:  spring-boot, spring, spring-cloud
Spring Cloud Study
spring-cloud学习
Stars: ✭ 108 (-28.48%)
Mutual labels:  spring-boot, spring, spring-cloud
Okta Blog Archive
Okta Developer Blog
Stars: ✭ 74 (-50.99%)
Mutual labels:  spring-boot, spring, spring-cloud
Spring Cloud Example
Stars: ✭ 111 (-26.49%)
Mutual labels:  spring-boot, spring, spring-cloud
Spring Cloud Flycloud
🔥🔥🔥FlyClould 微服务实战项目框架,在该框架中,包括了用 Spring Cloud 构建微服务的一系列基本组件和框架,对于后台服务框架的搭建有很大的参考价值,大家可以参考甚至稍加修改可以直接应用于自己的实际的项目开发中,该项目没有采用Maven进行项目构建,Maven通过xml进行依赖管理,导致整个配置文件太过臃肿,另外灵活性也不是很强,所以我采用Gradle进行项目构建和依赖管理,在FlyTour项目中我们见证了Gradle的强大,通过简单的一些配置就可以轻松的实现组件化的功能。该项目共有11个Module工程。其中10个位微服务工程,这10个微服务工程构成了一个完整的微服务系统,微服务系统包含了8个基础服务,提供了一整套微服务治理功能,他们分别是配置中心module_c…
Stars: ✭ 1,514 (+902.65%)
Mutual labels:  spring-boot, spring, spring-cloud
Spring Cloud Build
Common build concerns, shared plugin configuration, etc. for Spring Cloud modules
Stars: ✭ 114 (-24.5%)
Mutual labels:  spring-boot, spring, spring-cloud
Spring Cloud Yes
基于Spring Cloud的快速开发脚手架&最佳实践总结
Stars: ✭ 138 (-8.61%)
Mutual labels:  spring-boot, spring, spring-cloud
Java Spring Web
OpenTracing Spring Web instrumentation
Stars: ✭ 89 (-41.06%)
Mutual labels:  spring-boot, spring, spring-cloud
Limiter
一个注解使你的SpringBoot项目获得分布式锁和限流器能力
Stars: ✭ 93 (-38.41%)
Mutual labels:  spring-boot, spring, spring-cloud
Spring Cloud Cloudfoundry
Integration between Cloudfoundry and the Spring Cloud APIs
Stars: ✭ 83 (-45.03%)
Mutual labels:  spring-boot, spring, spring-cloud
Mall
mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。
Stars: ✭ 54,797 (+36189.4%)
Mutual labels:  spring-boot, spring, spring-cloud
Grpc Spring Boot Starter
Spring Boot starter module for gRPC framework.
Stars: ✭ 1,829 (+1111.26%)
Mutual labels:  spring-boot, spring, spring-cloud
Spring Cloud Study
开源书《跟我学Spring Cloud》的配套代码。讨论QQ群:731548893
Stars: ✭ 1,036 (+586.09%)
Mutual labels:  spring-boot, spring, spring-cloud
Web Development Interview With Java
Java 开发相关技术栈(大中厂)高频面试问题收录。
Stars: ✭ 69 (-54.3%)
Mutual labels:  spring-boot, spring, spring-cloud
Spring Boot Examples
🥗​ Spring/SpringBoot/SpringCloud 实践学习案例,从入门到精通,持续更新中,欢迎交流学习🍺 !
Stars: ✭ 110 (-27.15%)
Mutual labels:  spring-boot, spring, spring-cloud

Apache Thrift Starter for Spring Boot

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

Set of cool annotations that helps you building Thrift applications with Spring Boot.

How to connect the project

Its very simple:

repositories {
    jcenter()
}
compile 'info.developerblog.spring.thrift:spring-thrift-starter:+'

How to use this

Server-side

Annotation @ThriftController("servlet_path") helps you building server controller for request processing

@ThriftController("/api")
public class TGreetingServiceController implements TGreetingService.Iface {

    @Override
    public String greet(TName name) throws TException {
        // your logic
    }
}

Client-side

@ThriftClient

@ThriftClient(serviceId = "registered_service", (path) = "server_handler_path") helps you with multithreaded client with full Spring Cloud support.

@ThriftClient(serviceId = "greeting-service", path = "/api")
TGreetingService.Client client;

Beans

Thrift clients can also be used as regular beans

(which can be configured through app properties)

class Service {
    @Autowired
    private TGreetingService.Client client;
}
class Service {
    private final TGreetingService.Client client;
    @Autowired
    public Service(TGreetingService.Client client) {
        this.client = client;
    }
}

@ThriftClientsMap

@ThriftClientsMap(mapperClass) annotation helps to create a string-keyed map of clients for a set of services having the same interface, allowing to define the concrete callee instance at runtime:

@ThriftClientsMap(mapperClass = SampleMapper.class)
Map<String, TGreetingService.Client> clientsMap;

Mapper class requirements:

  • must extend AbstractThriftClientKeyMapper
  • must be registered as a bean in the application context

Thrift Client configuration

greeting-service:                     #service name
  endpoint: http://localhost:8080/api #direct endpoint
  ribbon:                             #manually ribbon
      listOfServers: localhost:8080
  path: /service                      #general path
  connectTimeout: 1000                #default=1000
  readTimeout: 10000                  #default=30000

thrift.client.max.threads: 10         #default=8

If you use service discovery backend (as Eureka or Consul) only path maybe needed.

See tests for better understanding.

Sleuth support

Since 1.0.0 starter have supported Spring Cloud Sleuth for tracing.

Special thanks to

Enjoy!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].