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

[rest] stream json without starting a new thread #4136

Merged
merged 1 commit into from Mar 10, 2024

Conversation

joerg1985
Copy link
Contributor

This PR does use the JAX-RS way of streaming data without starting a new short living thread.

Signed-off-by: Jörg Sautter joerg.sautter@gmx.net

@joerg1985 joerg1985 requested a review from a team as a code owner March 7, 2024 16:23
@J-N-K
Copy link
Member

J-N-K commented Mar 7, 2024

Can you check why this test is failing?

[INFO] Running org.openhab.core.io.rest.core.internal.config.ConfigDescriptionResourceTest
Error:  Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.864 s <<< FAILURE! -- in org.openhab.core.io.rest.core.internal.config.ConfigDescriptionResourceTest
Error:  org.openhab.core.io.rest.core.internal.config.ConfigDescriptionResourceTest.shouldReturnAConfigDescription -- Time elapsed: 0.074 s <<< ERROR!
java.lang.ClassCastException: class org.openhab.core.io.rest.JSONResponse$$Lambda$615/0x00007f6398310260 cannot be cast to class java.io.InputStream (org.openhab.core.io.rest.JSONResponse$$Lambda$615/0x00007f6398310260 is in unnamed module of loader 'app'; java.io.InputStream is in module java.base of loader 'bootstrap')
	at org.openhab.core.io.rest.core.internal.config.ConfigDescriptionResourceTest.shouldReturnAConfigDescription(ConfigDescriptionResourceTest.java:90)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

@J-N-K J-N-K added the enhancement An enhancement or new feature of the Core label Mar 7, 2024
@joerg1985
Copy link
Contributor Author

@J-N-K i have fixed it, sorry i can still not build the root project locally ...

@joerg1985 joerg1985 force-pushed the json-streaming branch 2 times, most recently from 53df62b to 0fe2a62 Compare March 8, 2024 17:39
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@J-N-K J-N-K merged commit 094e4a6 into openhab:main Mar 10, 2024
3 checks passed
@J-N-K J-N-K added the REST/SSE label Mar 10, 2024
@J-N-K J-N-K added this to the 4.2 milestone Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core REST/SSE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants