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

[Bug] The triple protocol is called through http, and the return value is incorrect #14023

Open
4 tasks done
crazyStar00 opened this issue Apr 2, 2024 · 8 comments
Open
4 tasks done
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@crazyStar00
Copy link
Contributor

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

dubbo version:3.3.0-beta.1 jdk:1.8 platform:windows 10

Steps to reproduce this issue

Start the service using the TriPojoServer class of the dubco-samples-triple-no-IDl module and invoke the service using http
image

What you expected to happen

I understand that you should return “hello star“,but return "hello,{"request":"star"}"

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@crazyStar00 crazyStar00 added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Apr 2, 2024
@cnzakii
Copy link

cnzakii commented Apr 2, 2024

This is a misunderstanding caused by habitual thinking, perhaps because you're accustomed to data being passed in JSON format.
2024-04-02_22 08 27
2024-04-02_22 09 52

The PojoGreeter interface definition explicitly specifies the parameter type as String. Therefore, the method receives a string as data. In the implementation class PojoGreeterImpl, the received parameter is simply concatenated. Hence, the response you obtained is completely correct.

Below is the result obtained by calling the operation using the TriPojoClient from the provided sample, and the response matches yours exactly.

2024-04-02_22 11 06
2024-04-02_22 11 45

@crazyStar00
Copy link
Contributor Author

This is a misunderstanding caused by habitual thinking, perhaps because you're accustomed to data being passed in JSON format. 2024-04-02_22 08 27 2024-04-02_22 09 52

The PojoGreeter interface definition explicitly specifies the parameter type as String. Therefore, the method receives a string as data. In the implementation class PojoGreeterImpl, the received parameter is simply concatenated. Hence, the response you obtained is completely correct.

Below is the result obtained by calling the operation using the TriPojoClient from the provided sample, and the response matches yours exactly.

2024-04-02_22 11 06 2024-04-02_22 11 45

How should a single string parameter be passed in an http request?

@cnzakii
Copy link

cnzakii commented Apr 9, 2024

This is a peculiar issue. If you've configured the Triple protocol, you should be using it for communication instead of using another protocol like HTTP.

@crazyStar00
Copy link
Contributor Author

This is a peculiar issue. If you've configured the Triple protocol, you should be using it for communication instead of using another protocol like HTTP.

http call also uses the triple protocol ;dubbo version : 3.3.0-beta.2

@crazyStar00
Copy link
Contributor Author

This is a misunderstanding caused by habitual thinking, perhaps because you're accustomed to data being passed in JSON format. 2024-04-02_22 08 27 2024-04-02_22 09 52
The PojoGreeter interface definition explicitly specifies the parameter type as String. Therefore, the method receives a string as data. In the implementation class PojoGreeterImpl, the received parameter is simply concatenated. Hence, the response you obtained is completely correct.
Below is the result obtained by calling the operation using the TriPojoClient from the provided sample, and the response matches yours exactly.
2024-04-02_22 11 06 2024-04-02_22 11 45

How should a single string parameter be passed in an http request?

For single-parameter services, the application/json mode cannot be used. You can use text/plain, application/x-www-form-urlencoded, or application/x-www-form-urlencoded

@crazyStar00
Copy link
Contributor Author

This is a misunderstanding caused by habitual thinking, perhaps because you're accustomed to data being passed in JSON format. 2024-04-02_22 08 27 2024-04-02_22 09 52
The PojoGreeter interface definition explicitly specifies the parameter type as String. Therefore, the method receives a string as data. In the implementation class PojoGreeterImpl, the received parameter is simply concatenated. Hence, the response you obtained is completely correct.
Below is the result obtained by calling the operation using the TriPojoClient from the provided sample, and the response matches yours exactly.
2024-04-02_22 11 06 2024-04-02_22 11 45

How should a single string parameter be passed in an http request?

For single-parameter services, the application/json mode cannot be used. You can use text/plain, application/x-www-form-urlencoded, or application/x-www-form-urlencoded

just dubbo version: 3.3.0-beta.2+

@crazyStar00
Copy link
Contributor Author

This is a misunderstanding caused by habitual thinking, perhaps because you're accustomed to data being passed in JSON format. 2024-04-02_22 08 27 2024-04-02_22 09 52
The PojoGreeter interface definition explicitly specifies the parameter type as String. Therefore, the method receives a string as data. In the implementation class PojoGreeterImpl, the received parameter is simply concatenated. Hence, the response you obtained is completely correct.
Below is the result obtained by calling the operation using the TriPojoClient from the provided sample, and the response matches yours exactly.
2024-04-02_22 11 06 2024-04-02_22 11 45

How should a single string parameter be passed in an http request?

For single-parameter services, the application/json mode cannot be used. You can use text/plain, application/x-www-form-urlencoded, or application/x-www-form-urlencoded

just dubbo version: 3.3.0-beta.2+
dubbo version 3.3.0-beta.1 http body head only support :application/json and application/grpc+proto

@AlbumenJ
Copy link
Member

AlbumenJ commented May 6, 2024

@oxsean PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Status: Todo
Development

No branches or pull requests

3 participants