我有一个spring RetryTemplate,它包装了一组对DB包装服务的http调用,当组合在一起时,这些调用都具有事务性质,这意味着如果最后一个失败,我需要回滚所有以前执行的操作,并重新开始处理。 问题是,只有在最后一次失败尝试之后才执行恢复,这使得问题比我试图解决的问题更大: 我的DB状态在每次尝试之间都不一致。 如何在每次尝试失败时执行恢复? 我试着自己写样板代码。除了它非常丑陋的外观之外,我更喜欢一个经过良好测试和设计的方法。 //I'm only experimenting now, when I'm done the template and policy
嗨,我想在春季集成XML中实现死信交换,所以场景是AAA 绑定BBB队列如果BBB队列在某些场景中失败,比如lister抛出异常,我想导航异常到死交换队列以存储下面的消息。
创建样例项目
main.java
package com.spring.rabbit.first.deadletter;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Main {
public static void main(String[] args) {
n
我们有一个Gradle项目,我正尝试在Eclipse中使用它。在其他用户进行了更改而我必须执行Gradle Refresh之后,Eclipse现在无法编译该项目。
The project was not built since its build path is incomplete. Cannot find the class file for
org.springframework.retry.support.RetryTemplate. Fix the build path then try building this project
The type org.spring
我使用RabbitMQ设置PubSub,因此每当消息处理出现故障时,监听器都会发送否定确认,理想情况下,重试应该在某个预先配置的时间间隔之后进行,但重试会在每秒直到message -TTL值的时间连续进行。对于重试,在SimpleMessageListenerContainer中添加了已创建的建议链。根据订阅动态创建队列和使用者。以下是rabbitmq服务的代码
@Service
public class RabbitMQQueueServiceImpl {
private final String JAVA_OBJECT_SERIALIZER_HEADER_NAME = "