You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "paxxie2 (via GitHub)" <gi...@apache.org> on 2025/05/09 04:03:07 UTC
[I] [Bug] @Mapping annotation cannot register rest RequestMapping when it is not a method declared by triple proto [dubbo]
paxxie2 opened a new issue, #15366:
URL: https://github.com/apache/dubbo/issues/15366
### 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 issues.
### Apache Dubbo Component
Java SDK (apache/dubbo)
### Dubbo Version
Dubbo 3.3.1 , java 17, mac os 15.3.2
### Steps to reproduce this issue
1. proto
```
syntax = "proto3";
option java_multiple_files = true;
package org.apache.dubbo.samples.tri.grpc;
message GreeterRequest {
string name = 1;
}
message GreeterReply {
string message = 1;
}
service Greeter{
rpc Greet(GreeterRequest) returns (GreeterReply);
rpc BiStream(stream GreeterRequest) returns (stream GreeterReply);
rpc ServerStream(GreeterRequest) returns (stream GreeterReply);
}
```
2. Define server implement, add extra method with Mapping annotation
```
public class TriGreeterImpl extends DubboGreeterTriple.GreeterImplBase {
private static final Logger LOGGER = LoggerFactory.getLogger(org.apache.dubbo.samples.tri.grpc.interop.server.TriGreeterImpl.class);
public TriGreeterImpl() {
}
@Override
public GreeterReply greet(GreeterRequest request) {
LOGGER.info("Server received greet request {}", request);
return GreeterReply.newBuilder()
.setMessage("hello," + request.getName())
.build();
}
// extra add method
@Mapping("/test")
public String test(){
return "success pax";
}
}
```
3. Run server and http invoke
method: Post
url: 127.0.0.1:50051/org.apache.dubbo.samples.tri.grpc.Greeter/test
response: 404

4. When use java interface + pojo, it will be success whith http invoke
```
@DubboService
public class DemoServiceImpl implements DemoService {
@Override
public String sayHello(String name) {
return "Hello " + name;
}
@Mapping("/test")
public String test(){
return "hello pax";
}
}
```
### What you expected to happen
Comment triple proto whether support additional methods to modify with mapping annotations
### Anything else
_No response_
### Are you willing to submit a pull request to fix on your own?
- [x] 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] [Bug] @Mapping annotation cannot register rest RequestMapping when it is not a method declared by triple proto [dubbo]
Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw closed issue #15366: [Bug] @Mapping annotation cannot register rest RequestMapping when it is not a method declared by triple proto
URL: https://github.com/apache/dubbo/issues/15366
--
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