Executive Summary
RabbitMQ messages are not persisted to disk and consumers don't acknowledge processing. If a service crashes, in-flight orders are lost permanently.
Proposed Solution
@Configuration
public class OrderQueueConfig {
@Bean
public DirectExchange orderExchange() {
return new DirectExchange("orders.exchange", true, false);
}
@Bean
public Queue orderQueue() {
return QueueBuilder.durable("orders.queue")
.withArgument("x-message-ttl", 86400000) // 24h retention
.build();
}
@Bean
public Binding orderBinding() {
return BindingBuilder.bind(orderQueue())
.to(orderExchange())
.with("order.*");
}
}
@Service
public class OrderConsumer {
@RabbitListener(queues = "orders.queue", ackMode = AcknowledgmentMode.MANUAL)
public void consumeOrder(Order order, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag)
throws IOException {
try {
processOrder(order);
channel.basicAck(tag, false); // Acknowledge only after processing
} catch (Exception e) {
channel.basicNack(tag, false, true); // Requeue on failure
logger.error("Failed to process order", e);
}
}
}
Checklist
@pooranjoyb Could you please /assign this issue to me? I would like to implement message persistence and acknowledgment under NSOC '26.
/assign
Executive Summary
RabbitMQ messages are not persisted to disk and consumers don't acknowledge processing. If a service crashes, in-flight orders are lost permanently.
Proposed Solution
Checklist
@pooranjoyb Could you please /assign this issue to me? I would like to implement message persistence and acknowledgment under NSOC '26.
/assign