Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.deadLetter() method doesn't work as intended #261

Open
damngamerz opened this issue Feb 20, 2024 · 0 comments
Open

.deadLetter() method doesn't work as intended #261

damngamerz opened this issue Feb 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@damngamerz
Copy link

damngamerz commented Feb 20, 2024

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

@damngamerz damngamerz added the bug Something isn't working label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant