You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Incoming(PROCESS_VIEWS_CHANNEL)
@Outgoing(PROCESS_VIEWS_DLQ_CHANNEL)
@Acknowledgment(Strategy.MANUAL) // Enable manual ack/nack
@ActivateRequestContext
public Message<byte[]> process(Message<byte[]> message) {
try {
// some processing logic and if successful
return null; // to ack
} catch(Exception e) {
var metadata = OutgoingRabbitMQMetadata.Builder().withRoutingKey("processView.lifecycle").build();
return message.withMetadata(Metadata.of(metadata)); // to send to the dlq
}
}
I also tried the following setup but the same issue exists:
@Inject
@Channel(PROCESS_VIEWS_DLQ_CHANNEL)
Emitter<byte[]> failedEventsEmitter;
@Incoming(PROCESS_VIEWS_CHANNEL)
@Acknowledgment(Strategy.MANUAL) // Enable manual ack/nack
@RunOnVirtualThread
@ActivateRequestContext
public CompletionStage<Void> process(Message<byte[]> message) {
try {
// some processing logic and if successful
return message.ack(); // to ack
} catch(Exception e) {
// send the event to DLQ
failedEventsEmitter.send(message.getPayload()).toCompletableFuture().join();
return message.ack();
}
the problem now, is that the failed messages are not routed correctly to the outgoing exchange, i.e. process-view-lifecycle-dlx. Looking at the management ui of rabbitmq using the dev services, I find that the incoming exchange is always created eagerly and properly bound to the queue. But the outgoing exchange is only created when a message is sent and failed and then it has no binding to the queue.
so what is the issue here?
I want to use this exchange as a sink for all failed messages and then later I will have job that consume those messages.
if you ask why I am not using the dlq of rabbit itself, it is because this feature is not supported currently within my org setup for rabbit. so We have to do this custom dlx/dlq stuff.
The text was updated successfully, but these errors were encountered:
I have the following setup:
I also tried the following setup but the same issue exists:
my properties looks the following:
the problem now, is that the failed messages are not routed correctly to the outgoing exchange, i.e. process-view-lifecycle-dlx. Looking at the management ui of rabbitmq using the dev services, I find that the incoming exchange is always created eagerly and properly bound to the queue. But the outgoing exchange is only created when a message is sent and failed and then it has no binding to the queue.
so what is the issue here?
I want to use this exchange as a sink for all failed messages and then later I will have job that consume those messages.
if you ask why I am not using the dlq of rabbit itself, it is because this feature is not supported currently within my org setup for rabbit. so We have to do this custom dlx/dlq stuff.
The text was updated successfully, but these errors were encountered: