Skip to content

Add endpoint to stream data read from database#32

Open
robjwilkins wants to merge 1 commit intomainfrom
add/data_stream
Open

Add endpoint to stream data read from database#32
robjwilkins wants to merge 1 commit intomainfrom
add/data_stream

Conversation

@robjwilkins
Copy link
Owner

Add a streaming http endpoint returning Book objects. Books are streamed from the database using the JOOQ framework. The books read from the database are then streamed to an OutputStream. Where there are a large number of documents needing to be returned, or processing each document takes time, this allows the service to return documents to the client as then are available, rather than having to wait for them all to be returned at the end

the endpoint can be tested with curl:

curl --no-buffer localhost:8080/books

where books can be seen streamed individually to the console.

Add a streaming http endpoint returning Book objects. Books are streamed from the database using
the JOOQ framework. The books read from the database are then streamed to an OutputStream.
Where there are a large number of documents needing to be returned, or processing each
document takes time, this allows the service to return documents to the client as then
are available, rather than having to wait for them all to be returned at the end

the endpoint can be tested with curl:

curl --no-buffer localhost:8080/books

where books can be seen streamed individually to the console.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant