moleculerjs / moleculer-channels

Reliable messages for Moleculer services via external queue/channel/topic.
MIT License
73 stars 15 forks source link

Change handler signature #9

Closed AndreMaz closed 3 years ago

AndreMaz commented 3 years ago

This PR changes the handler signature from:

{
    name: "sub1",
    channels: {
        "my.topic": {
            handler(msg) {...}
        }
    }
};

to

{
    name: "sub1",
    channels: {
        "my.topic": {
            handler(msg, raw) {...}
        }
    }
};

where raw is the message that was sent via the adapter.

Here's the integrations tests:

image

To fix things it's necessary to change the AMQP adapter in a way that raw message is passed to the handler.