rsocket-micrometer
我已经在客户端设置了 rsocket 指标,通过配置RSocketConnector
拦截器,像这样(Kotlin):
rSocketReqesterBuilder.rsocketConnector { configureConnector(it) }
// ...
private fun configureConnector(rSocketConnector: RSocketConnector) {
rSocketConnector.interceptors { iRegistry ->
// This gives us the rsocket.* counter metrics, like rsocket.frame
iRegistry.forResponder(MicrometerRSocketInterceptor(registry, *localTags.toArray()))
iRegistry.forRequester(MicrometerRSocketInterceptor(registry, *localTags.toArray()))
iRegistry.forConnection(MicrometerDuplexConnectionInterceptor(registry, *localTags.toArray()))
}
}
但在SERVER端,我使用带注释的 ( @MessageMapping
) Spring Boot RSocket 控制器,如下所示(Java):
@MessageMapping("replace-channel-controller")
public Flux<TransformResponse> replace(Flux<String> texts) ...
在这里,我没有明确控制连接器。
如何在服务器端添加拦截器?