Spring Integration 重试建议配置

问题描述 投票:0回答:1

我想配置重试建议。

这行得通吗?

IntegrationFlows.from("inputChannel")

.transform(theTranformer , "theTransfomerMethod" , e -> e.handleMessageAdvice(new RequestHandlerRetryAdvice()))

.channel("outputChannel").get();

spring spring-integration spring-integration-dsl
1个回答
0
投票

它可以工作,但只有在 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) {
© www.soinside.com 2019 - 2024. All rights reserved.