Skip to content
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

Create batch requests for (un)registering command consumers in Command Router (MQTT/AMQP) #3445

Open
calohmn opened this issue Nov 22, 2022 · 1 comment

Comments

@calohmn
Copy link
Contributor

calohmn commented Nov 22, 2022

Follow-up of #2069:
If a large number of AMQP/MQTT devices get disconnected by an adapter shutdown, the subsequent reconnects to another adapter instance will produce many "registerCommandConsumer" requests to the Command Router (potentially leading to "no credits" errors), which could probably better be done as batch requests.
(Implementation of batch requests had been already started in the abandoned PR #3386.)

It could also be considered creating batch requests for "unregisterCommandConsumer" requests, although the question is whether this is really needed.

@n-deliyski
Copy link
Contributor

The discussed batch feature has benefit in respect of (API call) optimization but has drawback of client delay.

The batch requests will impose delay on the client requests. See #2069 (comment)
The batch requests would be triggered in a configurable interval or if the batch size is reached (the first come)
Thus the client delay depends on the configurable interval. The interval could be in the range of hundred of milliseconds up to a second. The only case where delay is not required is when doing the unregister as part of a AMQP/MQTT connection disconnect.

I think the batch requests have main value during adapter start up when all devices connects and do command subscription.
At that case the delay on the clients would be less as the blocking wait interval would be applied only on the last batch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants