> When I set *protocol.name <http://protocol.name/> = dubbo *and
* protocol.ext-protocol=tri., *the startup logs say *Register dubbo service
org.apache.dubbo.springboot.demo.DemoService
url dubbo://172.22.0.18:20880/org
<http://172.22.0.18:20880/org>.apache.dubbo.springboot.demo.DemoService*
> When I set *protocol.name <http://protocol.name/> = tri*, the startup
logs say *Register dubbo service
org.apache.dubbo.springboot.demo.DemoService
url tri://172.22.0.18:20880/org
<http://172.22.0.18:20880/org>.apache.dubbo.springboot.demo.DemoService .*

Yes, this is right. Because, the **main** protocol is `dubbo.protocol.name`,
not `dubbo.protocol.ext-protocol`

> Can you suggest how I can configure by Dubbo-Consumer to send an HTTP1
request?

I understand what you're aiming for, but unfortunately, Dubbo doesn’t
currently support that functionality.

To clarify, here are a few key points:

   1.

   *Triple Server Compatibility*: The Triple Server, which can operate as
   an ext-protocol, supports both application/grpc and application/json
   style requests. This flexibility means you can use various clients to
   access a Triple Server, including the Dubbo SDK, gRPC’s official client,
   browsers (such as Chrome or Firefox), and even cURL.
   2.

   *Triple Client in Java SDK*: The Triple Client, particularly within the
   Java SDK, is typically used within IDC environments. Its primary role is to
   handle requests to servers within these environments, where we
currently *only
   support RPC-style requests*. This means that application/grpc is the
   default protocol.

The primary reason we don’t support HTTP/1 with application/json for
requests from Dubbo systems to external systems is that such scenarios are
quite uncommon. Additionally, application/grpc offers better performance
and stability when accessing the same service, making it the preferred
choice. Adding application/json support would introduce unnecessary
complexity to Dubbo.


On Sat, Nov 2, 2024 at 3:59 AM tanmay modak <tanmaymoda...@gmail.com> wrote:

> Thanks for the info. I had 2 follow up questions
>
> 1.* Dubbo-Provider startup logs do not have the http:// prefix*
>
> In the test you conducted, did the startup logs of the provider say  *Register
> dubbo service org.apache.dubbo.springboot.demo.DemoService
> url dubbo://172.22.0.18:20880/org
> <http://172.22.0.18:20880/org>.apache.dubbo.springboot.demo.DemoService* ?
>
> When I set *protocol.name <http://protocol.name> = dubbo *and*
> protocol.ext-protocol=tri., *the startup logs say *Register dubbo service
> org.apache.dubbo.springboot.demo.DemoService
> url dubbo://172.22.0.18:20880/org
> <http://172.22.0.18:20880/org>.apache.dubbo.springboot.demo.DemoService*
> When I set *protocol.name <http://protocol.name> = tri*, the startup logs
> say *Register dubbo service org.apache.dubbo.springboot.demo.DemoService
> url tri://172.22.0.18:20880/org
> <http://172.22.0.18:20880/org>.apache.dubbo.springboot.demo.DemoService .*
>
> 2. *Configuring the Dubbo-Consumer to send HTTP1 requests*
>
> I followed the steps in this link
> <https://dubbo.apache.org/en/blog/2018/08/14/dubbo-basic-usage-dubbo-consumer-configuration/>
>  to
> configure the dubbo-consumer to send requests using the http1 protocol. I
> did this by adding the *@RestController* and *@RequestMapping* to the
> interface of the DemoService (below in *italics*) and then built the jar
> file. However after doing so the resulting errors indicated that the
> request sent was NOT an http1 request.
>
>
>
>
>
>
>
>
>
>
> *import org.springframework.web.bind.annotation.RestController;import
> org.springframework.web.bind.annotation.RequestMapping;@RestController@RequestMapping("/triple")public
> interface DemoService {    @GetMapping(value = "/demo")    String
> sayHello(String name);}*
>
> Can you suggest how I can configure by Dubbo-Consumer to send an HTTP1
> request?
>
> On Thu, Oct 31, 2024 at 2:28 AM Albumen Kevin <jhq0...@gmail.com> wrote:
>
>> I have tested with `1-basic/dubbo-samples-springboot` and you may need to
>> add `maven-compiler-plugin` to add `-parameters` option.
>>
>> ```
>> application.yml
>>
>> dubbo:
>>   application:
>>       name: dubbo-springboot-demo-provider
>>       logger: slf4j
>>   protocol:
>>     name: dubbo
>>     port: 50052
>>     ext-protocol: tri
>>   registry:
>>     address: N/A
>> ```
>>
>>
>> ```
>>
>> 1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-provider/pom.xml
>>
>> 1-basic/dubbo-samples-spring-boot/dubbo-samples-spring-boot-interface/pom.xml
>>
>> <plugin>
>>   <groupId>org.apache.maven.plugins</groupId>
>>   <artifactId>maven-compiler-plugin</artifactId>
>>   <version>3.8.1</version>
>>   <configuration>
>>     <source>17</source>
>>     <target>17</target>
>>     <compilerArgs>
>>       <arg>-parameters</arg>
>>     </compilerArgs>
>>   </configuration>
>> </plugin>
>> ```
>>
>> ```
>>
>> *➜  **~* curl "
>> 127.0.0.1:50052/org.apache.dubbo.springboot.demo.DemoService/sayHello?name=hello
>> " -v
>>
>> *   Trying 127.0.0.1:50052...
>>
>> * Connected to 127.0.0.1 (127.0.0.1) port 50052
>>
>> > GET /org.apache.dubbo.springboot.demo.DemoService/sayHello?name=hello
>> HTTP/1.1
>>
>> > Host: 127.0.0.1:50052
>>
>> > User-Agent: curl/8.7.1
>>
>> > Accept: */*
>>
>> >
>>
>> * Request completely sent off
>>
>> < HTTP/1.1 200 OK
>>
>> < content-type: application/json
>>
>> < alt-svc: h2=":50052"
>>
>> < content-length: 13
>>
>> <
>>
>> * Connection #0 to host 127.0.0.1 left intact
>>
>> "Hello hello"
>> ```
>>
>> On Thu, Oct 31, 2024 at 2:05 PM Albumen Kevin <jhq0...@gmail.com> wrote:
>>
>>> `dubbo.protocol.name=tri` is enough
>>>
>>> On Thu, Oct 31, 2024 at 10:37 AM tanmay modak <tanmaymoda...@gmail.com>
>>> wrote:
>>>
>>>> In my current config, I am using *dubbo.protocol.name
>>>> <http://dubbo.protocol.name>=dubbo* and
>>>> *dubbo.protocol.ext-protocol=tri*. My detailed config is below (in
>>>> italics).
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *dubbo:  application:      name: dubbo-springboot-demo-provider
>>>> qos-enable: false  protocol:    name: dubbo    port: 20880    ext-protocol:
>>>> tri  registry:    address:
>>>> nacos://<nacos-uuid>.nacos.<nacos-domain>:8848?username=nacos&password=nacos*
>>>>
>>>> Should I be setting both *dubbo.protocol.name
>>>> <http://dubbo.protocol.name>=tri* and *dubbo.protocol.ext-protocol=tri*
>>>> ? Are both fields (dubbo.protocol.name and
>>>> dubbo.protocol.extr-protocol) needed, or is one of them enough if we set it
>>>> to tri ?
>>>>
>>>> On Wed, Oct 30, 2024 at 9:41 PM Albumen Kevin <jhq0...@gmail.com>
>>>> wrote:
>>>>
>>>>> Have you tried with `dubbo.protocol.name=tri` already? I will try
>>>>> with `ext-protocol=tri` later.
>>>>>
>>>>> On Thu, Oct 31, 2024 at 6:57 AM tanmay modak <tanmaymoda...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hello
>>>>>>
>>>>>> I am currently trying to start a dubbo-provider springboot service on
>>>>>> *http*
>>>>>> protocol on port 20880. However, the startup logs indicate that
>>>>>> this service is not actually being started on the http protocol, but
>>>>>> instead on the dubbo protocol.
>>>>>>
>>>>>> For reference, I am following the instructions provided by this guide
>>>>>> by
>>>>>> Alibaba
>>>>>> <
>>>>>> https://www.alibabacloud.com/blog/high-performance-and-user-friendly-http-access-with-dubbo3_601460
>>>>>> >
>>>>>> under
>>>>>> the section *Access Methods for Different RPC Protocols -> Dubbo
>>>>>> Protocol
>>>>>> Access Method -> Support for Both HTTP and Dubbo Protocols*
>>>>>>
>>>>>> Listed below are the steps that I am following:
>>>>>>
>>>>>> 1. *Clone the dubbo samples <https://github.com/apache/dubbo-samples>
>>>>>> repo
>>>>>> and use the project 1-basic/dubbo-samples-springboot
>>>>>> <
>>>>>> https://github.com/apache/dubbo-samples/tree/master/1-basic/dubbo-samples-spring-boot
>>>>>> >.
>>>>>> *Add the below section to the *application.yml* file.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> *dubbo:  application:      name: dubbo-springboot-demo-provider
>>>>>> qos-enable: false  protocol:    name: dubbo    port: 20880
>>>>>> ext-protocol:
>>>>>> tri  registry:    address:
>>>>>>
>>>>>> nacos://<nacos-uuid>.nacos.<nacos-domain>:8848?username=nacos&password=nacos*
>>>>>>
>>>>>> *2. Build the jar and then the docker image, and deploy to the
>>>>>> kubernetes
>>>>>> cluster.*
>>>>>>
>>>>>> *Observations in **Startup Logs*
>>>>>> In the startup logs (i*n italics below) *the url *dubbo://
>>>>>> 172.22.0.18:20880/org
>>>>>> <http://172.22.0.18:20880/org>* indicates that the service has still
>>>>>> started on the dubbo protocol and NOT the http protocol.
>>>>>>
>>>>>> *[DUBBO] Register dubbo service
>>>>>> org.apache.dubbo.springboot.demo.DemoService url
>>>>>> dubbo://172.22.0.18:20880/org
>>>>>> <http://172.22.0.18:20880/org
>>>>>> >.apache.dubbo.springboot.demo.DemoService?anyhost=true&application=dubbo-springboot-demo-provider&background=false&bind.ip=172.22.0.18&bind.port=20880&deprecated=false&dubbo=2.0.2&dynamic=true&executor-management-mode=isolation&ext.protocol=tri&file-cache=true&generic=false&interface=org.apache.dubbo.springboot.demo.DemoService&ispuserver=true&methods=sayHello&pid=1&prefer.serialization=hessian2,fastjson2&qos.enable=false&release=3.3.1&revision=1.0-SNAPSHOT&service-name-mapping=true&side=provider&timestamp=1730177244898
>>>>>> to registry <nacos-registry-uid>.nacos.<rest-of-domain>:8848, dubbo
>>>>>> version: 3.3.1, current host: 172.22.0.18*
>>>>>>
>>>>>> Per my understanding, setting *ext-protocol *and *qos-enable *should
>>>>>> be
>>>>>> enough to start the service on http. Is there any additional
>>>>>> configuration
>>>>>> or code change that is needed ?
>>>>>> --
>>>>>> Best
>>>>>> Tanmay
>>>>>>
>>>>>
>>>>
>>>> --
>>>> Best
>>>> Tanmay
>>>>
>>>
>
> --
> Best
> Tanmay
>

Reply via email to