Please answer the following questions for yourself before submitting an issue.
[ X] I am running the latest version
[ X] I checked the documentation and found no answer
[ X] I checked to make sure that this issue has not already been filed
[ X] I'm reporting the issue to the correct repository
Current Behavior
When emitlLocalChannelHandler is called on a service with a channel that is defined as an options object, such as:
channels: {
"payment.processed": {
// Using custom consumer-group
group: "other",
handler: async (payload) {
// Do something with the payload
// You should throw error if you want to NACK the message processing.
}
}
}
then the emitlLocalChannelHandler call fails with:
TypeError: svc.schema[mwOpts.schemaProperty][channelName].call is not a function
If the channel is defined as just a function, such as:
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
When
emitlLocalChannelHandler
is called on a service with a channel that is defined as an options object, such as:then the
emitlLocalChannelHandler
call fails with:If the channel is defined as just a function, such as:
then the
emitlLocalChannelHandler
call works.Expected Behavior
emitLocalChannelHandler
should work when channel is defined as an options object.Failure Information
See https://github.com/moleculerjs/moleculer-channels/pull/34#discussion_r1087590328