[Bug] Using Stream With generic and injvm not work
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 and found no similar issues.
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
3.2.*
Steps to reproduce this issue
https://github.com/xixingya/dubbo-demo/blob/master/dubbo-demo-spi/src/main/java/tech/xixing/dubbo/demo/stream/StreamProviderDemo.java
please see this code. which is copy from
https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/protocol/triple/streaming/#%E5%AE%9E%E7%8E%B0%E7%B1%BB
What you expected to happen
the stream mode not working
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
- [X] I agree to follow this project's Code of Conduct
org.apache.dubbo.rpc.RpcException: java.lang.IllegalArgumentException: [Serialization Security] Serialized class tech.xixing.dubbo.demo.stream.StreamConsumerDemo$1 has not implement Serializable interface. Current mode is strict check, will disallow to deserialize it by default. at org.apache.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:129) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) at org.apache.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:54) at org.apache.dubbo.rpc.cluster.filter.FilterChainBuilder$CopyOfFilterChainNode.invoke(FilterChainBuilder.java:349) at org.apache.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:41)
at org.apache.dubbo.rpc.TriRpcStatus.asException(TriRpcStatus.java:213)
at org.apache.dubbo.rpc.protocol.tri.call.UnaryClientCallListener.onClose(UnaryClientCallListener.java:53)
at org.apache.dubbo.rpc.protocol.tri.call.TripleClientCall.onComplete(TripleClientCall.java:127)
at org.apache.dubbo.rpc.protocol.tri.stream.TripleClientStream$ClientTransportListener.finishProcess(TripleClientStream.java:243)
at org.apache.dubbo.rpc.protocol.tri.stream.TripleClientStream$ClientTransportListener.onTrailersReceived(TripleClientStream.java:328)
at org.apache.dubbo.rpc.protocol.tri.stream.TripleClientStream$ClientTransportListener.lambda$onHeader$1(TripleClientStream.java:431)
at org.apache.dubbo.common.threadpool.serial.SerializingExecutor.run(SerializingExecutor.java:105)
System.setProperty("dubbo.application.check-serializable", "false"); must set this properties works well,But using stream mode why I should set this properties
because your stream consumer demo application invoke with generic,
but stream pattern can't either use generic or two params
you should remove reference.setGeneric("true"); than try again
do you have some idea for your case ? i can implement that @xixingya
do you have some idea for your case ? i can implement that @xixingya
maybe streamObserver can exclude by Serializable check?
StreamObserver is a special class and should not pass to Serialize checker
StreamObserver is a special class and should not pass to Serialize checker
i guess that he wants to use generic invoke, and at the same time use StreamObserver(BI or S),such as following case:
// generic invoke
GenericService genericService = bootstrap.getCache().get(reference);
StreamObserver<String> responseObserver = new StreamObserver<String>() {
@Override
public void onNext(String data) {
}
@Override
public void onError(Throwable throwable) {
}
@Override
public void onCompleted() {
}
};
while (true) {
try {
Object genericInvokeResult =
genericService.$invoke("sayHello",
new String[] {String.class.getName(),StreamObserver.class.getName()},
new Object[] {param,responseObserver});
System.out.println(genericInvokeResult);
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
is it ? @xixingya
StreamObserver is a special class and should not pass to Serialize checker
yesterday, i try to rebuild GenericFilter and TripleInvoker to support it, but it's costly, need i support it ? @AlbumenJ
You can try it
same promblem, looking forword to a solution~~
// generic invoke
GenericService genericService = bootstrap.getCache().get(reference);
StreamObserver<String> responseObserver = new StreamObserver<String>() {
@Override
public void onNext(String data) {
}
@Override
public void onError(Throwable throwable) {
}
@Override
public void onCompleted() {
}
};
while (true) {
try {
Object genericInvokeResult =
genericService.$invoke("sayHello",
new String[] {String.class.getName(),StreamObserver.class.getName()},
new Object[] {param,responseObserver});
System.out.println(genericInvokeResult);
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
@JunJieLiu51520 I have this requirement, how can it be implemented?