Java Spring云rabbitMq:异常后重试发送

Java Spring云rabbitMq:异常后重试发送,java,spring,rabbitmq,spring-cloud,spring-messaging,Java,Spring,Rabbitmq,Spring Cloud,Spring Messaging,我正在制作一个应用程序,从队列1接收数据,存储并发送到队列2。它还从队列2接收数据,发出请求(http),保存并发送到队列3。如果我在处理队列中的数据时出错,我想让它们永远保持一致(再次从队列中获取)。当我从队列2获取数据时,我得到一个错误,但随后我在队列1中获取数据,而不是像我预期的那样在队列2中获取数据 这是我的处理器 public interface MyProcessor { String INPUT = "input-1"; String OUTPU

我正在制作一个应用程序,从队列1接收数据,存储并发送到队列2。它还从队列2接收数据,发出请求(http),保存并发送到队列3。如果我在处理队列中的数据时出错,我想让它们永远保持一致(再次从队列中获取)。当我从队列2获取数据时,我得到一个错误,但随后我在队列1中获取数据,而不是像我预期的那样在队列2中获取数据

这是我的处理器

public interface MyProcessor {
    String INPUT = "input-1";
    String OUTPUT = "input-2";

    @Input(INPUT)
    SubscribableChannel input();

    @Output(Source.OUTPUT)
    MessageChannel output();
}
public interface MyProcessor2 {
    String INPUT = "input-2";
    String OUTPUT = "input-3";

    @Input(INPUT)
    SubscribableChannel input();

    @Output(Source.OUTPUT)
    MessageChannel output();
}
我的消费者:

@Slf4j
@Component
@EnableBinding(MyProcessor.class)
@RequiredArgsConstructor
public class MyConsumer {

    private final SomeService someService;

    @Transformer(inputChannel = MyProcessor.INPUT, outputChannel = MyProcessor.INPUT)
    public SomeEntity handle(String text) {
        SomeEntity entity = new SomeEntity(text);
        entity = someService.save(entity);
        return entity ;
    }
}

@Slf4j
@Component
@EnableBinding(MyProcessor2.class)
@RequiredArgsConstructor
public class MyConsumer2 {

    private final SendService sendService;
    private final SomeService someService;

    @Transformer(inputChannel = MyProcessor2.INPUT, outputChannel = MyProcessor2.OUTPUT)
    @Transactional
    public SomeEntity handle(SomeEntity entity) {
        entity = sendService.send(entity);
        entity =  someService.save(entity);
        return entity;
    }
}
我的应用程序.yml

spring:
  cloud:
    stream:
      bindings:
        input-1:
          destination: input-event
        input-2:
          destination: send-event
        input-3:
          destination: end-event
      default:
        contentType: application/json
所以当我在
MyConsumer2
中出现异常时,我在
MyConsumer
中再次出现消息,而不是在我的
MyConsumer2

我该怎么做才能解决这个问题