Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using http http protocol in dubbo, how to add custom attachments to URLs consumer side send? #1397

Closed
ducat7 opened this issue Feb 25, 2018 · 5 comments

Comments

@ducat7
Copy link

ducat7 commented Feb 25, 2018

Dubbo选用http协议,consume发送的URL,如何添加自定义参数?

查阅官方文档,发现有个“信息交换扩展(exchanger)”貌似可以实现在发送的URL里添加自定义参数。
但,网上没有相关自定义扩展的案例,不知道如何实现?

我期望的是:
consume端,在发送URL时,携带sessionId一起发送,http请求。(求解)
provider端,配有Spring Session的请求拦截器,通过URL获取到sessionId,以达到session共享的目的。(这部分已经扩展,可以从Cookie和URL里拦截请求获取sessionId)

信息交换扩展
扩展说明
基于传输层之上,实现 Request-Response 信息交换语义。

扩展接口
com.alibaba.dubbo.remoting.exchange.Exchanger
com.alibaba.dubbo.remoting.exchange.ExchangeServer
com.alibaba.dubbo.remoting.exchange.ExchangeClient

扩展配置
<dubbo:protocol exchanger="xxx" />

<dubbo:provider exchanger="xxx" />

已知扩展
com.alibaba.dubbo.remoting.exchange.exchanger.HeaderExchanger

@ralf0131
Copy link
Contributor

Hi, welcome to Dubbo community!

Please consider using English, Dubbo is a global community, and all the issues may be viewed and discussed by people all over the world.

Meanwhile, you can send email to dev@dubbo.apache.org or subscribe it, which is preferred way for discussing questions like this.

@limingwei
Copy link

可以自己另写一个Protocol

@ducat7
Copy link
Author

ducat7 commented Feb 28, 2018

@limingwei 怎么写?有案例吗?

@limingwei
Copy link

我写了,正在用
但没有独立梳理出来,还不便直接开放
http://dubbo.io/books/dubbo-dev-book/impls/protocol.html
http://limw.cn/api

@chickenlj chickenlj changed the title Dubbo选用http协议,consume发送的URL,如何添加自定义参数? Enable Dubbo http protocol, how to add custom attachments to URLs consumer side send? Mar 2, 2018
@chickenlj chickenlj changed the title Enable Dubbo http protocol, how to add custom attachments to URLs consumer side send? When using http http protocol in dubbo, how to add custom attachments to URLs consumer side send? Mar 2, 2018
@chickenlj
Copy link
Contributor

Duplicate of #1367

@chickenlj chickenlj marked this as a duplicate of #1367 Mar 2, 2018
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

No branches or pull requests

4 participants