Closed
Description
Environment
I use grpc io.grpc:protoc-gen-grpc-java:1.15.1
for code generation:
protobuf {
plugins {
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.15.1"
}
}
}
Cause
the generated BlockingStub extends AbstractStub
by this version, not AbstractBlockingStub
:
when creating stub on start, it is not match correctly in BlockingStubFactory:
because it's just judge if extends AbstractBlockingStub
and !type.getSimpleName().contains("BlockingV2")
i tried change the plugin version to 1.30.0, BlockingStub in generated code extends AbstractBlockingStub, it works now.
Issue
i think we can change the predicate to make compatible with old version:
public class BlockingStubFactory extends AbstractStubFactory<AbstractBlockingStub<?>> implements Ordered {
@Override
public boolean supports(Class<?> type) {
return (AbstractStubFactory.supports(AbstractBlockingStub.class, type) && !type.getSimpleName().contains("BlockingV2"))
|| type.getSimpleName().endsWith("BlockingStub");
}
}
Metadata
Metadata
Assignees
Labels
No labels