我正在尝试为$ad = new AdHere();
$this->em->persist($ad);
$this->em->flush();
$this->em->persist($ad);
$this->em->flush();
实施重试建议。我有以下配置:
<int-http:outbound-gateway>
在Logback中为<int-http:outbound-gateway
request-channel="REQUEST_CHANNEL"
reply-channel="RESPONSE_CHANNEL"
url="HTTP_URL"
http-method="POST"
charset="UTF-8"
header-mapper="headerMapper"
extract-request-payload="true">
<int-http:request-handler-advice-chain>
<ref bean="retryHttpAdvice" />
</int-http:request-handler-advice-chain>
</int-http:outbound-gateway>
<bean id="headerMapper" class="org.springframework.integration.http.support.DefaultHttpHeaderMapper">
<property name="outboundHeaderNames" value="HTTP_REQUEST_HEADERS, UserRole" />
<property name="userDefinedHeaderPrefix" value="" />
</bean>
<int:handler-retry-advice id="retryHttpAdvice" recovery-channel="RECOVERY_CHANNEL"
max-attempts="5">
<int:exponential-back-off
initial="1000"
multiplier="2" />
</int:handler-retry-advice>
启用了DEBUG
级别,我可以看到正在执行RetryAdvice但没有任何重试尝试。
这是预期的行为吗?例如,我收到404错误,我预计至少会看到3次尝试(重试计数类似于service-activator),但此时只有一次没有重试次数。
org.springframework.integration
使用http-outbound-gateway调用retryAdvice的最佳方法是什么?