Closed georgedbarr closed 2 years ago
In https://github.com/moleculerjs/moleculer/commit/b48ec4f3d39951ad433a64c4c36ecdc2af824c24 it will be available as
require("moleculer").INTERNAL_MIDDLEWARES
// or
ServiceBroker.INTERNAL_MIDDLEWARES
And it contains:
[
"ActionHook",
"Validator",
"Bulkhead",
"Cacher",
"ContextTracker",
"CircuitBreaker",
"Timeout",
"Retry",
"Fallback",
"ErrorHandler",
"Tracing",
"Metrics",
"Debounce",
"Throttle"
];
Brilliant, thanks!
Is your feature request related to a problem? Please describe.
Started using the recent updates to manage middleware ordering and adding custom middleware in place of an existing one as described in https://github.com/moleculerjs/moleculer/pull/1012
Previously we used all the internal Moleculer middlewares and overwriting the ErrorHandler with our own middleware like so:
This meant that ordering was maintained with the internal middlewares ordering.
Now with the new reordering middleware config, we can define our custom middleware like so:
The concern is that if for whatever reason, the internal middleware was updated and the internal ordering was changed, then this could lead to issues where the list we have defined is now out of sync and could lead to ordering issues.
Describe the solution you'd like
Moleculer package to export the default middleware ordering array