-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 optional DeliverTo field to ConsumerGetNextRequest JS API #1929
Conversation
bd7bd83
to
aeadb6c
Compare
As is this wouldn't work when the pull request is done across accounts, it needs to be aware of the remapped inbox:
|
|
||
if shouldRespond { | ||
// Empty message meaning that there were no errors. | ||
pmsg := &jsPubMsg{reply, reply, _EMPTY_, nil, nil, nil, 0} |
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.
In case the sub.Pull()
is done from another account, then this would not deliver the response.
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 should work ok once I push the current branch. Sync with that should work fine.
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 should not be needed. Let's chat in am.
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.
Just tried with latest and seems that for the approach in this PR, it still needs to transform the reply inbox. An alternative that I was thinking to make the sub.Poll() synchronous is to handle as an old style request on the client side: https://github.com/nats-io/nats.go/blob/118341e3023b7bf5bf01b3f332b98fc52e2c22b1/js.go#L913-L980
aeadb6c
to
1cc2454
Compare
This adds a DeliverTo which can be used to signal the server where the next message should be delivered after sending the next message request. This way when a client makes a request to pull messages, it can receive the response from a different response handler than the subscription that is processing the messages. Signed-off-by: Waldemar Quevedo <wally@synadia.com>
1cc2454
to
9f14077
Compare
Closing since taking a different approach. |
This adds a
DeliverTo
which can be used to signal the server where the next message should be delivered after sending the next message request. This way when a client makes a request to pull messages, it can receive the response from a different response handler than the subscription that is processing the messages.Signed-off-by: Waldemar Quevedo wally@synadia.com
git pull --rebase origin master
)/cc @nats-io/core