我想配置重试建议。
这行得通吗?
IntegrationFlows.from("inputChannel")
.transform(theTranformer , "theTransfomerMethod" , e -> e.handleMessageAdvice(new RequestHandlerRetryAdvice()))
.channel("outputChannel").get();
它可以工作,但只有在 JavaDocs 上对此进行注释后才能工作
handleMessageAdvice
:
/**
* Configure a list of {@link MethodInterceptor} objects to be applied, in nested order, to the
* endpoint's handler. The advice objects are applied to the {@code handleMessage()} method
* and therefore to the whole sub-flow afterwards.
* @param interceptors the advice chain.
* @return the endpoint spec.
* @since 5.3
*/
public S handleMessageAdvice(MethodInterceptor... interceptors) {
如果您只想重试您的
theTransfomerMethod
,请考虑通过以下方式配置此建议:
/**
* Configure a list of {@link Advice} objects to be applied, in nested order, to the
* endpoint's handler. The advice objects are applied only to the handler.
* @param advice the advice chain.
* @return the endpoint spec.
*/
public S advice(Advice... advice) {