Skip to content

feat:seata for webflux support - #3395

Open
yang1320 wants to merge 1 commit into
alibaba:2022.xfrom
yang1320:master
Open

feat:seata for webflux support#3395
yang1320 wants to merge 1 commit into
alibaba:2022.xfrom
yang1320:master

Conversation

@yang1320

@yang1320 yang1320 commented Jul 18, 2023

Copy link
Copy Markdown

Describe what this PR does / why we need it

why we need it:
webflux应用中使得seata能正常生效

Describe what this PR does:
使得全局事务id能正常传播在 webflux应用的Seata的RootContext中

Does this pull request fix one issue?

none;其它人提的:#792

Describe how you did it

添加一个全局过滤器:将该项目的请求头中的全局事务id,设置到seata上下文RootContext中(复用已有类:com.alibaba.cloud.seata.web.SeataHandlerInterceptor的逻辑)
添加一个自动配置:根据web类型,当为REACTIVE时,启用配置类、全局过滤器
装配文件中:新增自动配置类名

Describe how to verify it

https://blog.csdn.net/m0_37128943/article/details/131798195?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22131798195%22%2C%22source%22%3A%22m0_37128943%22%7D#%E7%BB%93%E6%9E%9C%EF%BC%9A
见 :结果、场景用例

Special notes for reviews

@CLAassistant

CLAassistant commented Jul 18, 2023

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@oss-sentinel-ai oss-sentinel-ai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

LGTM — adds WebFlux support for Seata distributed transaction context propagation. The ReactiveSeataHandlerFilter correctly binds/unbinds XID from request headers to RootContext, mirroring the servlet-based handler pattern for reactive applications.

Review Notes

  • Clean implementation following the existing servlet filter pattern
  • Proper use of Mono.defer() for cleanup in the reactive chain
  • @ConditionalOnWebApplication(type = REACTIVE) ensures this only activates for WebFlux apps

Automated review by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants