openhab-addons: [remoteopenhab] large response from REST API causes COMMUNICATION_ERROR
I’m running 2 OH instances in my house and I’m really happy about the new remoteopenhab binding which should make the MQTT based workaround to connect the instances obsolete. Thanks for this valuable contribution!
Trying to establish a connection with one of my instances from an OH3 test instance showed the behavior described under “Current Behavior”. This instance uses the DoorBird binding which provides Image channels for camera stills. The linked items’ state is the corresponding Base64 encoded image, leading to a substantially sized response from the REST API. In my case the response body contained 2323008 bytes and thus exceeded the below mentioned buffer capacity, preventing the bridge to become ONLINE. Removing some if the image items immediately solved the problem.
Expected Behavior
If the OH instance which should be integrated via the binding is online and reachable via the network, the binding should have the status ONLINE, regardless of the size of the response.
Current Behavior
When requesting the remote instance’ items via its REST API (URL http://<remote-instance-ip>:8080/rest/items?recursive=false) a response exceeding a buffer size of 2097152 bytes causes a COMMUNICATION_ERROR with the following error message:
Failed to get the list of remote items using the items REST API: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Buffering capacity 2097152 exceeded
Possible Solution
The problem seems to root in the FutureResponseListener’s limitation to 2MB.
Probably switching to another approach (asynchronous) will be necessary.
Steps to Reproduce (for Bugs)
See above introduction…
- Create items of type Image and update them with image data
- Check that URL http://<remote-instance-ip>:8080/rest/items?recursive=false returns a response exceeding 2097152 bytes
- Connect remoteopenhab binding to this instance
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- [remoteopenhab] Reduced response size from REST API items Related to #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to lolodomo/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Reduced response size from REST API items (#9284) Related to #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to openhab/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Avoid going OFFLINE when request of items states fails Related to #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to lolodomo/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Avoid going OFFLINE when request of items states fails (#9287) Related to #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to openhab/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Asynchronous reading of big API response Fix #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to lolodomo/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Asynchronous reading of big API response (#9320) * [remoteopenhab] Asynchronous reading of big API response Fix #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to openhab/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Reduced response size from REST API items (#9284) Related to #9281 — committed to nowaterman/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Avoid going OFFLINE when request of items states fails (#9287) Related to #9281 — committed to nowaterman/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Asynchronous reading of big API response (#9320) * [remoteopenhab] Asynchronous reading of big API response Fix #9281 — committed to nowaterman/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Reduced response size from REST API items (#9284) Related to #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to boehan/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Reduced response size from REST API items (#9284) Related to #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to bosch-io/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Avoid going OFFLINE when request of items states fails (#9287) Related to #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to bosch-io/openhab-addons by lolodomo 4 years ago
- [remoteopenhab] Asynchronous reading of big API response (#9320) * [remoteopenhab] Asynchronous reading of big API response Fix #9281 Signed-off-by: Laurent Garnier <lg.hc@free.fr> — committed to bosch-io/openhab-addons by lolodomo 4 years ago
The problem is fixed. The API response can now be bigger than 2 MB.
Reproduced just now.