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…

  1. Create items of type Image and update them with image data
  2. Check that URL http://<remote-instance-ip>:8080/rest/items?recursive=false returns a response exceeding 2097152 bytes
  3. 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

Most upvoted comments

The problem is fixed. The API response can now be bigger than 2 MB.

Reproduced just now.