As I found out the registry class always uses RoundRobinStrategy for ActionCatalog and EventCatalog and my tests showed that the config option registry: {strategy: Moleculer.Strategies.Random} has no effect.
ActionCatalog and EventCatalog are always initialized with RoundRobinStrategy: https://github.com/ice-services/moleculer/blob/master/src/registry/registry.js#L42-L43
And is the correct config name 'strategy' (see service-broker.js:51) or 'StrategyFactory' (see registry.js:38)?
Sorry, I will check it.
Thanks!
The correct name in broker options is StrategyFactory, I will fix it.
I rather like the name “strategy” better for an option than having to type out “StrategyFactory” — which really doesn’t add much clarity IMHO. So which will you fix? :)
On Oct 11, 2017, at 4:21 PM, Icebob notifications@github.com wrote:
The correct name in broker options is StrategyFactory, I will fix it.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/ice-services/moleculer/issues/121#issuecomment-335935887, or mute the thread https://github.com/notifications/unsubscribe-auth/AB8M7XUtaSSLgCvTbr_6r482yThGms4aks5srSMugaJpZM4P2D8k.
Yes, I'm thinking on same thing. The strategy is better in options, but StrategyFactory is better in Registry source code :)
So strategy stays, and I fix in the Registry code.
Sounds perfect!
On Oct 11, 2017, at 4:25 PM, Icebob notifications@github.com wrote:
Yes, I'm thinking on same thing. The strategy is better in options, but StrategyFactory is better in Registry source code :)
So strategy stays, and I fix in the Registry code.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/ice-services/moleculer/issues/121#issuecomment-335937092, or mute the thread https://github.com/notifications/unsubscribe-auth/AB8M7Uh5shvpvCc7bVLrJw2hxjWkajR5ks5srSRSgaJpZM4P2D8k.
Fixed. Tomorrow I will release it.
That's great! Thank you!
Fix is released in v0.11.5
Most helpful comment
Fix is released in v0.11.5