This middleware can connect to other namespaces.
moleculer.config.js
const InterNamespaceMiddleware = require("./inter-namespace.js");
module.exports {
namespace: "local",
nodeID: "node-1",
transporter: "NATS",
middlewares: [
InterNamespaceMiddleware(["ns-mars", "ns-venus"])
]
}
moleculer.config.js
const InterNamespaceMiddleware = require("./inter-namespace.js");
module.exports {
namespace: "local",
nodeID: "node-1",
transporter: "NATS",
middlewares: [
InterNamespaceMiddleware([
{
namespace: "ns-mars",
transporter: "NATS"
},
{
namespace: "ns-venus",
transporter: "Redis",
}
])
]
}
// Call service in the local namespace
broker.call("greeter.hello");
// Call service in the local namespace with the namespace
broker.call("greeter.hello@local");
// Call service in the "ns-venus" namespace
broker.call("greeter.hello@ns-venus");
// Call service in the "ns-mars" namespace
broker.call("greeter.hello@ns-mars");
This middleware does not work with moleculer Api gateway.
Parameter actionName is an Object of Type Endpoit
opt is always undefined.
My plan was to extend callOptions in Routedefinition to achive something like a multitenant Gateway, but the Gateway Service somehow messes this up. Any idea how to solve this?