0
不要重新排队我有以下配置工作:如果交易失败
@Autowired
private ConnectionFactory connectionFactory;
@Bean
Step step() {
return steps.get("step")
.<~>chunk(chunkSize)
.reader(reader())
.processor(processor())
.writer(writer())
.build();
}
@Bean
ItemReader<Person> reader() {
return new AmqpItemReader<>(amqpTemplate());
}
@Bean
AmqpTemplate amqpTemplate() {
RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
rabbitTemplate.setChannelTransacted(true);
return rabbitTemplate;
}
是否有可能改变RabbitResourceHolder的行为在一个事务回滚的情况下,不重新排队的消息?它在Spring批处理中有意义吗?
我明白了,但我怎么能用Spring Batch来做到这一点?我得到这个工作的唯一方法是在发生故障时手动发送到dlq –
在Spring Batch中如何使用侦听器容器,因为它是消息驱动的?一般来说,如果你更完整地解释你的配置会更好。我有一个JIRA的PR,它应该尽快合并。 –
或者你在使用'RabbitTemplate.receive()'操作吗? –