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 2023/02/13 23:22:18 UTC
[GitHub] [dubbo] AlbumenJ opened a new issue, #11558: NPE in consumer filter listener
AlbumenJ opened a new issue, #11558:
URL: https://github.com/apache/dubbo/issues/11558
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
### Steps to reproduce this issue
1. Define a provider filter which will always throw RpcException
```java
@Activate(group = "provider")
public class ProviderFilter implements Filter {
@Override
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
if (invocation.getMethodName().contains("sayHiWithException")) {
throw new RpcException(FORBIDDEN_EXCEPTION, "provider filter exception");
} else {
return invoker.invoke(invocation);
}
}
}
```
2. Define a consumer Filter to get `path` from `invoker`
```java
@Activate(group = "consumer")
public class ConsumerFilter implements Filter, BaseFilter.Listener {
@Override
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
return invoker.invoke(invocation);
}
@Override
public void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation) {
if (invoker.getUrl().getPath() == null) {
throw new IllegalArgumentException("invoker.getUrl().getPath() is null");
}
}
@Override
public void onError(Throwable t, Invoker<?> invoker, Invocation invocation) {
if (invoker.getUrl().getPath() == null) {
throw new IllegalArgumentException("invoker.getUrl().getPath() is null");
}
}
}
```
### Expected Behavior
<!-- What do you expect from the above steps?-->
`invoker.getUrl().getPath()` returns real path.
### Actual Behavior
<!-- What actually happens? -->
`invoker.getUrl().getPath()` returns null in `onResponse` and `onError`.
--
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
[GitHub] [dubbo] AlbumenJ commented on issue #11558: NPE in consumer filter listener
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #11558:
URL: https://github.com/apache/dubbo/issues/11558#issuecomment-1428855673
Integration test case: https://github.com/apache/dubbo-samples/pull/735
--
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
[GitHub] [dubbo] AlbumenJ commented on issue #11558: NPE in consumer filter listener
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #11558:
URL: https://github.com/apache/dubbo/issues/11558#issuecomment-1428851424
Fixed in https://github.com/apache/dubbo/pull/11443
--
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
[GitHub] [dubbo] AlbumenJ closed issue #11558: NPE in consumer filter listener
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ closed issue #11558: NPE in consumer filter listener
URL: https://github.com/apache/dubbo/issues/11558
--
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