[Solved] Dubbo uses filter error: No such extension consumerStaticFilter for filter/com.alibaba.dubbo.rpc.Filter

Dubbo can use filter to implement a filter similar to the Tomcat filter

Realize 1. Interface request time monitoring. 2. Print input/output log (the output log is determined by the application itself)

An error occurred during the configuration

No such extension consumerStaticFilter for filter/com.alibaba.dubbo.rpc.Filter

at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)

Ask experienced students in the company to know the reason

When configuring & lt; dubbo:provider filter=”DubboExceptionFilter”>& lt;/ dubbo:provider>

The value of dubboexceptionfilter is not a spring bean. Instead, the following file contents need to be configured in the meta-inf/Dubbo/com.alibaba.dubbo.rpc.filter file:

DubboExceptionFilter=com.xxx.common.DubboRequestFilter

Create another related type and implement the com.alibaba.dubbo.rpc.filter interface

 

public DubboRequestFilter implements com.alibaba.dubbo.rpc.Filter{

}

This mechanism is the Java Service provider interface, Java specification. In this way, it is not necessary to configure a complete class during configuration

Similar Posts: