-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Describe the bug
As the docs suggests here: https://github.com/memphisdev/memphis.js?tab=readme-ov-file#sending-a-message-to-the-dead-letter
message.deadLetter("reason") should forward the message to dlq. It doesn't work at all.
To Reproduce
Just consume a message in a station and try to use the .deadLetter() function.
For example:
consumer.on('message', (message: Message, context: object) => {
const data = message.getDataAsJson() as Employee;
if (data.employeeId) {
console.log(data);
message.ack();
} else {
console.log('This one is dead letter: ');
console.log(data)
message.deadLetter('Invalid employee id')
}
});Expected behavior
The method should directly send the message to dlq/dlq_station.
Current behavior
Nothing happens. If you see your dlq stations the message doesn't end up there with the reason.
Screenshots
NA
Additional context
What i noticed it's counterpart .nack works as intended.
What i also tried is to create a separate DLQ station and attach it. Also doesn't work.
We are using latest memphis -> 1.4.3-stable
js sdk -> 1.3.2