You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dubbo.apache.org by Tien Dat PHAN <tp...@gmail.com> on 2020/10/07 16:59:53 UTC
Consuming a specific protocol type
Dear experts,
We just wonder if it is possible to configure a Dubbo consumer to consume only a specific protocol type.
For instance, we have an interface exported with two type of protocols: dubbo:// and http://
But for a specific consumer, we want this consumer to consume only the dubbo:// protocol, what is the way to configure it, if it is possible? Could you please enlighten us?
FYI, we are using Dubbo 2.7.6 with Java 8 and on CentOS 7.5.
Best regards
Tien Dat PHAN
Re: Consuming a specific protocol type
Posted by Tien Dat PHAN <tp...@gmail.com>.
Sorry for bothering, we just simply missed this method.
For those who are interested, here is what we use to configure a specific type of protocol to consume for a consumer:
final ReferenceConfig<T> reference = new ReferenceConfig<>();
reference.setInterface(myinterface);
reference.setProtocol("dubbo");
This will make sure this consumer reference target only provider via dubbo protocol (provider urls start with dubbo://)
Best
Dat
On 2020/10/07 16:59:53, Tien Dat PHAN <tp...@gmail.com> wrote:
> Dear experts,
>
> We just wonder if it is possible to configure a Dubbo consumer to consume only a specific protocol type.
> For instance, we have an interface exported with two type of protocols: dubbo:// and http://
> But for a specific consumer, we want this consumer to consume only the dubbo:// protocol, what is the way to configure it, if it is possible? Could you please enlighten us?
>
> FYI, we are using Dubbo 2.7.6 with Java 8 and on CentOS 7.5.
>
> Best regards
> Tien Dat PHAN
>