dubbo/dubbo-spring-boot/dubbo-spring-boot-interceptor
carlvine500 27e6838c3b
add spring boot interceptor to copy header(dubbo-tag)/cookie(dubbo.tag) (#12514)
* add spring boot interceptor to copy header(dubbo-tag)/cookie(dubbo.tag)

* copy dubbo.tag in urlParameter

* copy dubbo.tag in urlParameter

* remove dubbo.tag in interceptor

* add dubbo-spring-boot-interceptor to dubbo-dependencies-all/.artifacts/dubbo-bom

---------

Co-authored-by: liutingfeng <tingfeng.liu@successchannel.com>
Co-authored-by: songxiaosheng <songxiaosheng@elastic.link>
Co-authored-by: Albumen Kevin <jhq0812@gmail.com>
2023-06-28 20:30:45 +08:00
..
src/main/java/org/apache/dubbo/spring/boot/interceptor add spring boot interceptor to copy header(dubbo-tag)/cookie(dubbo.tag) (#12514) 2023-06-28 20:30:45 +08:00
README.md add spring boot interceptor to copy header(dubbo-tag)/cookie(dubbo.tag) (#12514) 2023-06-28 20:30:45 +08:00
pom.xml add spring boot interceptor to copy header(dubbo-tag)/cookie(dubbo.tag) (#12514) 2023-06-28 20:30:45 +08:00

README.md

Dubbo Spring Boot interceptor

dubbo-spring-boot-interceptor copy the header(dubbo-tag)/cookie(dubbo.tag)/urlParameter(dubbo.tag) to dubbo .

Integrate with spring boot

copy the header(dubbo-tag=tagx)/urlParameter(dubbo.tag=tagx) to dubbo

if there is no header(dubbo-tag) , downgrade use urlParameter(dubbo.tag)

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new DubboTagHeaderOrParameterInterceptor()).addPathPatterns("/*").excludePathPatterns("/admin");
    }
}

copy the cookie(dubbo.tag=tagx) to dubbo

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new DubboTagCookieInterceptor()).addPathPatterns("/*").excludePathPatterns("/admin");
    }
}