Closed esatterwhite closed 6 years ago
Hi @esatterwhite if you call
hemera.act(
{
topic: 'stats',
cmd: 'registeredActions',
maxMessages$: -1
},
function(err, resp) {
// is called multiple times
}
)
you will receive multiple responses with the different actions from the services. You have to aggregate by yourself.
If you still get only the actions from one service then it could be a race condition or the plugin is not configured properly.
Oh interesting. Is there a way to know when all of the services have responded?
This a pull mechanism. If you think that all service should send their information to a specific subscriber at startup, feel free to create PR.
Oh interesting. Is there a way to know when all of the services have responded?
You can't know it. You are able to start new services at any time. I prefer to implement a solution as suggested above.
@esatterwhite I implemented here https://github.com/hemerajs/hemera/pull/218 please review
After the PR you can just call
hemera.ready(() => {
hemera.sendActionStats({
topic: 'process.stats'
})
})
in your services to inform your subscriber about new updates. This requires of course that your service process.stats
is ready before the others.
Feature was published with hemera-stats@5.2.0
Description
I 'm using the stats plugin in various services and trying to get all of the registered actions, but it seems to only return the actions from a one of the services in a cluster. I'll only get the actions from Service A, or Service B, or Service C rather than the actions for Service A + B+ C.
Expected Result
actions from every service are returned
Actual Result
actions list are from one and only one of the connected services
Context
Your Environment