eclipse-ditto / ditto

Eclipse Ditto™: Digital Twin framework of Eclipse IoT - main repository
https://eclipse.dev/ditto/
Eclipse Public License 2.0
693 stars 227 forks source link

Not able to fetch all connections via the http connection api when there are more than 100 connections #2002

Open JeffreyThijs opened 3 months ago

JeffreyThijs commented 3 months ago

When i request all connection via the connection http api while having more than 100 connection, I receive following error message:

{
    "status": 400,
    "error": "connectivity:connections.amount.illegal",
    "message": "The amount of requested exceptions exceeds the limit of '100'.",
    "description": "Please request less connection ids."
}

This limit seems to be configured via:

https://github.com/eclipse-ditto/ditto/blob/master/gateway/service/src/main/resources/gateway.conf#L220

Currently, you can not configure this option via an environment variable so it would be a good idea to add this to allow a quick fix. A better solution would be add pagination to the endpoint like what is done with the search things http api.

thjaeckle commented 2 months ago

Hi @JeffreyThijs

Indeed, configuring it via ENV var would be a quick win for this. In the meantime, you can configure every HOCON (the config format) setting via Java system properties. In this case, this would be a parameter to the JVM:

-Dditto.gateway.command.connections-retrieve-limit=1337

And yes - eventually we will need pagination on this API.