-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: mediator role #980
feat: mediator role #980
Conversation
Add mediationRole property to AgentConfig to ensure MediatorModule is initialized correctly. This prevents concurrency issues when multiple attempts to create a mediatorRoutingRecord fail. Signed-off-by: Niall Shaw <[email protected]>
Aims to fix #899 |
Technically an agent can be both a mediator and a recipient, so I'm not to keen on adding the role property to the config. I see two options, but there's probably other good options:
In addition, I'm not sure if it should be impossible to use mediation without the mediation role . E.g. with the ledger we have connectToLedgersOnStartup. If you have it enabled it will connect on startup, but otherwise when first requested. Is that something we could also do here? Another issue is that this won't work for high availability deployments (multiple instances connecting to the same database). There's more places where this will lead to issues, so we can probably ignore this for now. |
Then it might be an array of roles. I usually try to avoid these flag config attributes (you need to understand what it does instead of just saying I want to run this agent as a mediator and don't care how the framework manages that), but if the array is a problem I'm also ok with something like
Yes, without this change, it doesn't work even with a few edge agents trying to connect at the same time, so I would rather do this now and fix "high availability deployments" later. |
Probably I'm missing something, but I don't see a major problem on always initializing mediator module, as it will actually initialize the routing key only once and then just query it and store it in the internal variable. In such case, no new config parameters would be needed. What do you think? |
Agree with @genaris here. I think avoiding the config option is worth the little bit of extra overhead. |
always initialize mediator Signed-off-by: Niall Shaw <[email protected]>
5f80dbd
to
092f5f7
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Moved to #985 |
Add mediationRole property to AgentConfig to ensure MediatorModule is initialized correctly. This prevents concurrency issues when multiple attempts to create a mediatorRoutingRecord fail.
Signed-off-by: Niall Shaw [email protected]