How to access json parameters used in moleculer.config.js from docker compose environment config file (.env) #1086
-
Hello Everyone, Do anyone has any suggestion on this i.e. pass json object parameters to docker container. (I know this is more question is more related to docker compose but want to understand if anyone has done such configuration) Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
To set deeply nested options please check this https://moleculer.services/docs/0.14/runner.html#Configuration-loading-logic
|
Beta Was this translation helpful? Give feedback.
-
Thanks @AndreMaz for the reply, MOL_TRANSPORTER__TYPE=AMQP In above parameter options 'type', 'url' and 'prefetch' works perfectly (I can see this reflected on channel) but not eventTimeToLive/heartBeatTimeToLive (queues are created with default options). So when it tries to read 'HEARTBEATTIMETOLIVE' from env parameter then above code in runner.js changes it to 'heartbeattimetolive', and this won't work. So the parameter options which have capital letters won't be taken into consideration. Is this analysis correct? CC : @icebob |
Beta Was this translation helpful? Give feedback.
-
Hi @AndreMaz and @icebob , Thanks Again Buddy. |
Beta Was this translation helpful? Give feedback.
Hi @AndreMaz and @icebob ,
Thanks a lot for your quick replies , I tried below as you suggested (with one change HEART_BEAT to HEARTBEAT) and it works ( hope I should have seen line 240 in runner.js :) prior ):
MOL_TRANSPORTER__OPTIONS__EVENT_TIME_TO_LIVE=10000
MOL_TRANSPORTER__OPTIONS__HEARTBEAT_TIME_TO_LIVE=10000
Thanks Again Buddy.