Spring RabbitMQ – using manual channel acknowledgement on a service with @RabbitListener configuration

Add the Channel to the @RabbitListener method… @RabbitListener(queues = “${eventqueue}”) public void receiveMessage(Order order, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) throws Exception { … } and use the tag in the basicAck, basicReject. EDIT @SpringBootApplication @EnableRabbit public class So38728668Application { public static void main(String[] args) throws Exception { ConfigurableApplicationContext context = SpringApplication.run(So38728668Application.class, args); context.getBean(RabbitTemplate.class).convertAndSend(“”, “so38728668”, “foo”); … Read more