Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add support for partial response messages #101
base: dev
Are you sure you want to change the base?
Add support for partial response messages #101
Changes from all commits
0c2245c
34e2a84
162510a
7b3d4d8
d1a8ec9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could try to achieve this behaviour using Streams? https://www.rabbitmq.com/docs/streams
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into streams briefly and it seemed to me they were more oriented at sending either larger quantities of data or broadcasting to multiple recipients based on RMQ documented use cases.
I opted for this method because it appears to be simpler to implement with fewer changes to our client helpers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean that the only way to send objects is not chunk by chunk but only solid object but with partial additions to it's content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the intended use case as documented in the README changes.
I implemented the stream callback as optional, so
send_mq_request
is expected to always return a complete result at the end.Chunked responses would require specifying a standard method for combining them into a single complete response which is also valid, but would require some additional information in responses, i.e.:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently required because nothing accounts for responses arriving out of order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very bad, if rabbitMQ do not guarantee order of delivery, sleep isn't a reliable solution
For me better to send the whole response every time with small additions in the end
Then if they will not arrive in order the text will just appear and dissapear, but final responce will always be corrent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how I specified it in documentation, each response should be cumulative, rather than incremental (response 2 includes all of response 1 and more). The one with the
_is_final
parameter set toTrue
will always be the complete response.Each message does have an index, so we could enforce on the client side that the callback receives the messages in order..