You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "AlbumenJ (via GitHub)" <gi...@apache.org> on 2024/03/20 03:16:40 UTC

[I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

AlbumenJ opened a new issue, #13962:
URL: https://github.com/apache/dubbo/issues/13962

   ### Pre-check
   
   - [X] I am sure that all the content I provide is in English.
   
   
   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar feature requirement.
   
   
   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Descriptions
   
   Triple protocol support multi arguments in none-annotation mode
   
   Interface:
   ```java
   public interface GreetingsService {
       String sayHi(String name, String message);
   }
   ```
   
   Example requests:
   1. using array
   ```shell
   curl \
       --header "Content-Type: application/json" \
       --data '["Dubbo","hello"]' \
       http://localhost:50052/org.apache.dubbo.samples.tri.unary.GreetingsService/sayHi/
   ```
   
   2. using map
   ```shell
   curl \
       --header "Content-Type: application/json" \
       --data '{"name":"Dubbo","message":"hello"}' \
       http://localhost:50052/org.apache.dubbo.samples.tri.unary.GreetingsService/sayHi/
   ```
   
   ### Related issues
   
   _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
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "oxsean (via GitHub)" <gi...@apache.org>.
oxsean commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2008657356

   @finefuture I'm currently working on this, and I'm make a tasklist for rest, if you're interest on it, I can assign some to you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "Chenjp (via GitHub)" <gi...@apache.org>.
Chenjp commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2132663861

   @AlbumenJ I have another question, does triple protocol allow method overload currently?
   
   ```java
   public interface GreetingsService {
     String sayHi3(String name, String message, CompositeBean source); 
     String sayHi3(String name, String message, SourceBean source);
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2139190184

   > > > @AlbumenJ I have another question, does triple protocol allow method overload currently?
   > > > ```java
   > > > public interface GreetingsService {
   > > >   String sayHi3(String name, String message, CompositeBean source); 
   > > >   String sayHi3(String name, String message, SourceBean source);
   > > > }
   > > > ```
   > > 
   > > 
   > > For Triple in wrapper mode, we support. For Triple in plain http or grpc mode, we don't support.
   > 
   > Since dubbo support multi-protocols and different protocols have different constraints. It's better to ensure semantic consistency, make each **Service** protocol-**insensitive**. I recommend removing method overload support for all protocols.
   
   That is a hope. Only a hope. Really really really hard~


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "Chenjp (via GitHub)" <gi...@apache.org>.
Chenjp commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2115646911

   > > @AlbumenJ request payload will be determined by interface argument name, is it a good idea?
   > 
   > This is as expected
   
   Assume another composite parameter exist:
   ```java
   public class CompositeBean implements Serializable {
     private String name;
     private String code;
     .... 
   }
   public interface GreetingsService {
     String sayHi3(String name, String message, CompositeBean source); 
   }
   ```
   I dont know what request should be.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "oxsean (via GitHub)" <gi...@apache.org>.
oxsean closed issue #13962: [Feature][3.3] Triple protocol support multi arguments
URL: https://github.com/apache/dubbo/issues/13962


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "finefuture (via GitHub)" <gi...@apache.org>.
finefuture commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2008713794

   > @finefuture I'm currently working on this, and I'm make a tasklist for rest, if you're interest on it, I can assign some to you.
   
   Okay, please assign some to me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2134264281

   > @AlbumenJ I have another question, does triple protocol allow method overload currently?
   > 
   > ```java
   > public interface GreetingsService {
   >   String sayHi3(String name, String message, CompositeBean source); 
   >   String sayHi3(String name, String message, SourceBean source);
   > }
   > ```
   
   For Triple in wrapper mode, we support.
   For Triple in plain http or grpc mode, we don't support.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "Chenjp (via GitHub)" <gi...@apache.org>.
Chenjp commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2134717229

   > > @AlbumenJ I have another question, does triple protocol allow method overload currently?
   > > ```java
   > > public interface GreetingsService {
   > >   String sayHi3(String name, String message, CompositeBean source); 
   > >   String sayHi3(String name, String message, SourceBean source);
   > > }
   > > ```
   > 
   > For Triple in wrapper mode, we support. For Triple in plain http or grpc mode, we don't support.
   
   Since dubbo support multi-protocols and different protocols have different constraints. It's better to ensure semantic consistency, make each **Service** protocol-**insensitive**. I recommend removing method overload support for all protocols.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2109232423

   > @AlbumenJ request payload will be determined by interface argument name, is it a good idea?
   
   This is as expected


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "finefuture (via GitHub)" <gi...@apache.org>.
finefuture commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2008631094

   I'm interested. Please assign it to me.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "Chenjp (via GitHub)" <gi...@apache.org>.
Chenjp commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2107064390

   @AlbumenJ request payload will be determined by interface argument name, is it a good idea?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2116525980

   > > > @AlbumenJ request payload will be determined by interface argument name, is it a good idea?
   > > 
   > > 
   > > This is as expected
   > 
   > Assume another composite parameter exist:
   > 
   > ```java
   > public class CompositeBean implements Serializable {
   >   private String name;
   >   private String code;
   >   .... 
   > }
   > public interface GreetingsService {
   >   String sayHi3(String name, String message, CompositeBean source); 
   > }
   > ```
   > 
   > I dont know what request should be.
   
   `["testName", "testMessage", {"name":"subName", "code": "subCode"}]`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Feature][3.3] Triple protocol support multi arguments [dubbo]

Posted by "oxsean (via GitHub)" <gi...@apache.org>.
oxsean commented on issue #13962:
URL: https://github.com/apache/dubbo/issues/13962#issuecomment-2177332977

   ```groovy
       def "override mapping test"() {
           given:
               def request = new TestRequest(path: path)
           expect:
               runner.run(request, String.class) == output
           where:
               path                          | output
               '/say?name=sam&count=2'       | '2'
               '/say?name=sam'               | '1'
               '/say~SL'                     | '2'
               '/say~S'                      | '1'
               '/say~S?name=sam&count=2'     | '1'
               '/say~S.yml?name=sam&count=2' | '1'
       }
   
       String say(String name, Long count)
   
       String say(String name)
   ```
   In the latest REST Triple, support method override has been added by passing the method signature abbreviation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org