Prevent jetty from sending chunked responses

  • Platform information:
    • Hardware: x86_64
    • OS: ArchLinux
    • Java Runtime Environment: openjdk version “1.8.0_292”
    • openHAB version: 3.1.0
  • Issue of the topic:

I’m retrieving a sitemap from an ESP32 based device and am facing some issues related to the fact that the output is sent with Transfer-Encoding:chunked. Basically, openHAB sends the data properly, I can see it getting out of the WiFi interface just fine with WireShark but the ESP32 gets confused with it.
While investigating the core reason for the issue, I stumbled onto a different code path for chunked and non chunked transfers.
To rule out this option, I would like openHAB to stop sending chunked responses and am wondering if there is a setting somewhere that would instruct the embedded Jetty sever to send responses without the Transfer-Encoding:chunked header.

Do you know if such a setting exist? If not, what would you suggest that I try?

Did you read the prerequisits ?
OpenHAB 3 requires Java 11, not Java 8.
Furthermore, OpenJDK is not recommended, so please change to Zulu 11.

This might not solve your issue, but might reduce further issues.

Well, I got fooled by may PATH environment variable, openHAB is running with the following command line:

/usr/lib/jvm/java-11-openjdk/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab3 ...

I’ll keep that in mind, thanks.

This is not an issue per se, chunked transfer is fine for most clients. It’s just that I have issues with an ESP32 based board and was wondering if I could rule out chunked transfer as the culprit.

There is a reason why chunked encoding is being used:

So I doubt that it can be turned off.
Did you try if code like mentioned in a link in Having issue with http chunked response - ESP32 Forum helps to solve it on your client side ?

Yes, I know the benefits of chunked transfers, it’s just that I hoped for a single switch to turn it off.
There is no such switch, so I placed a reverse proxy in between that allows to consolidate chunk transfers and that confirmed the issue.

Thanks, it did not help but I managed to find the issue in my own code and now have a working situation