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

consumer example from the cli prints 'undefined' #199

Closed
yanivbh1 opened this issue Jun 16, 2022 · 1 comment
Closed

consumer example from the cli prints 'undefined' #199

yanivbh1 opened this issue Jun 16, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@yanivbh1
Copy link
Contributor

yanivbh1 commented Jun 16, 2022

consumer code

const memphis = require('memphis-dev');

(async function () {
    try {
        await memphis.connect({
            host: 'localhost',
            username: 'root',
            connectionToken: 'memphis'
        });

        const consumer = await memphis.consumer({
            stationName: 'benchmark',
            consumerName: 'yaniv_cons1',
            consumerGroup: ''
        });

        consumer.on('message', (message) => {
            console.log(message.getData().toString());
            message.ack();
        });

        consumer.on('error', (error) => {
            console.log(error);
        });
    } catch (ex) {
        console.log(ex);
        memphis.close();
    }
})();

@yanivbh1 yanivbh1 added the bug Something isn't working label Jun 16, 2022
@idanasulin2706
Copy link
Contributor

The undefined printed because currently you can not give CG or consumer name a name contains numbers.
Instead undefined you suppose to see a proper error message - this bug has fixed

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

2 participants