-
Notifications
You must be signed in to change notification settings - Fork 258
Node.js module initialization issue when starting module is .NET #96
Comments
Thanks for filing the issue @teamdevmatch. From what I can tell it sounds like a race condition of sorts. The .NET module appears to get initialized and starts producing messages before the Node.js module has had a chance to load and initialize. Are you commencing sending of messages from your .NET module from the |
Hey @avranju, the .NET module is the SDK's sensor sample (DotNetSensorModule) and the thread for publishing messages is created in the |
I see. I am going to say that this is an issue with the Node.js binding implementation. In this case I would expect the binding code that bridges the Node.js runtime with the rest of the gateway to delay delivery of the message to the JS code till it has been initialized. I'll file a task for this and get this addressed. Thanks for reporting this! |
Alright, that seems reasonable. Just found out when I give the message thread a little |
@teamdevmatch Update: @zafields is working on this fix for this...shouldn't take too much longer. |
@teamdevmatch The fix is in master, can you please update and confirm this addresses your issue. |
Hey @zafields, sorry for the delayed answer, i had some issues updating and building the new sources... Thanks for the fix, i am closing this issue... |
Hey guys,
first of all I want to thank everybody who is contributing to this repo. I really think you're doing an amazing job here providing us with this open foundation for creating custom hybrid solutions in a fast and consistent way. Also looking forward to be a contributor very soon.
Right now I'm messing around with various gateway configurations and ran into an issue when setting up a Node.js module as sink and a starting .NET module as source.
When I start up the gateway it outputs the following message: Info: Module has not been initialized yet: State: 1, Module: ../../../../samples/nodejs_simple_sample/nodejs_modules/filewriter.js
Then the gateway prints: Gateway is running. and the .NET source module starts sending messages to the broker correctly.
The first message is not being processed by the Node module.
Oddly enough, after ignoring the first message, the Node.js module starts processing incoming messages just fine.
I'm guessing the very first message kind of initializes the Node module and after that the module works as expected.
My question:
Is there anything that I'm missing in the configuration to instruct the gateway to initialize all modules on start? Am I doing something else wrong here or this an actual issue?
As a workaround I'm thinking about sending an initial wake-up / warm-up message, so that Node modules are initializing.
Thanks for reading all of that and y'all have a good one.
The text was updated successfully, but these errors were encountered: