ttl-spring-boot-starter

ttl

Лицензия

Лицензия

MIT
Категории

Категории

Spring Boot Контейнер Микросервисы
Группа

Группа

com.github.dreamroute
Идентификатор

Идентификатор

ttl-spring-boot-starter
Последняя версия

Последняя версия

1.3-RELEASE
Дата

Дата

Тип

Тип

jar
Описание

Описание

ttl-spring-boot-starter
ttl
Ссылка на сайт

Ссылка на сайт

https://github.com/Dreamroute/ttl
Система контроля версий

Система контроля версий

https://github.com/Dreamroute/ttl

Скачать ttl-spring-boot-starter

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.dreamroute/ttl-spring-boot-starter/ -->
<dependency>
    <groupId>com.github.dreamroute</groupId>
    <artifactId>ttl-spring-boot-starter</artifactId>
    <version>1.3-RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.dreamroute/ttl-spring-boot-starter/
implementation 'com.github.dreamroute:ttl-spring-boot-starter:1.3-RELEASE'
// https://jarcasting.com/artifacts/com.github.dreamroute/ttl-spring-boot-starter/
implementation ("com.github.dreamroute:ttl-spring-boot-starter:1.3-RELEASE")
'com.github.dreamroute:ttl-spring-boot-starter:jar:1.3-RELEASE'
<dependency org="com.github.dreamroute" name="ttl-spring-boot-starter" rev="1.3-RELEASE">
  <artifact name="ttl-spring-boot-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.dreamroute', module='ttl-spring-boot-starter', version='1.3-RELEASE')
)
libraryDependencies += "com.github.dreamroute" % "ttl-spring-boot-starter" % "1.3-RELEASE"
[com.github.dreamroute/ttl-spring-boot-starter "1.3-RELEASE"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-web jar 2.4.3
org.springframework.boot : spring-boot-configuration-processor Необязательный jar 2.4.3
org.projectlombok : lombok jar 1.18.18
com.alibaba : transmittable-thread-local jar 2.12.1

Модули Проекта

Данный проект не имеет модулей.

ttl

封装了阿里transmittable-thread-local工具,让SpringBoot应用更为简单的使用TTL

封装了阿里的ttl,封装的理由:使用agent的方式有点繁琐,需要修改启动命令,另外,本地IDE开发的时候总是需要配置jvm启动参数,参考了ttl项目的issue#152和#173,总结出来的。
使用方法

SpringBoot依赖:

<dependency>
    <groupId>com.github.dreamroute</groupId>
    <artifactId>ttl-spring-boot-starter</artifactId>
    <version>最新版本</version>
</dependency>

最新版本,点击查看

效果:
  • 系统中被@Async标记的方法回从Spring线程池中获取线程,获取到的线程已经被ttl处理过,对用来说是透明的
  • 如果系统中其他地方需要使用线程池,并且希望带着ThreadLocal信息,那么直接注入ExecutorService即可,starter已经将ExecutorService用ttl代理, 只要引入starter包,系统中任何地方注入ExecutorService,都可以享受到ThreadLocal的传递

Версии библиотеки

Версия
1.3-RELEASE
1.2-RELEASE
1.1-RELEASE
1.0-RELEASE