You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/08/16 08:45:41 UTC
[GitHub] [dubbo] JasonMing commented on issue #8470: 提供可控的 `Invoker` 链组装过程。
JasonMing commented on issue #8470:
URL: https://github.com/apache/dubbo/issues/8470#issuecomment-899334517
## Configurable `InvokerChain`
The configurer mechanism is inspired by spring-webmvc's [`WebMvcConfigurer`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.html).
It is a post processor provides a chance for user to change internal components programatically.
The most important thing is, the `Invoker` model should be transparent to the users are **using** it, but should be configurable and expose details to the users are **configuring** it.
### `InovkerChainConfigurer` SPI
The configurer is a callback essentially, the configurer will setup every components properly.
```java
@SPI
interface InovkerChainConfigurer {
default void configurerRegistry(RegistryHandler handler) {}
default void configureFilters(FilterHandler handler) {}
// other hooks ......
}
```
The configuration code
```java
class MyInovkerChainConfigurer implements InovkerChainConfigurer {
@Override
void configurerRegistry(RegistryHandler handler) {
handler.setRegistryDirectory(......);
}
@Override
void configurerFilters(FilterHanlder handler) {
handler.remove(sentinelFilter);
}
}
```
--
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