-
Notifications
You must be signed in to change notification settings - Fork 7
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
new: add ability for caller to get back received raw *nats.Msg to a channel #56
Conversation
…hannel they provide when using the request-reply mode Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
I think it would be more symetrical to return a publication in response |
Yeah, you're right because the only thing you can publish right now is a |
/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0
|
Codecov Report
@@ Coverage Diff @@
## master #56 +/- ##
==========================================
+ Coverage 88.27% 88.35% +0.07%
==========================================
Files 28 28
Lines 2107 2121 +14
==========================================
+ Hits 1860 1874 +14
Misses 220 220
Partials 27 27
Continue to review full report at Codecov.
|
…r Publish API - when using the Request-Reply pattern, the response is expected to be a Publication as well Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
…sponse could not be decoded into a Publication when using the NATSOptRespondToChannel option Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>
/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0
|
Update @primalmotion |
EXPECT(). | ||
RequestWithContext(gomock.Any(), pub.Topic, expectedPublishData). | ||
Return(&nats.Msg{ | ||
Data: []byte("this cannot be decoded into a publication!"), |
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.
👀
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.
LGTM. please run a test of the backend with this
Edit: oh you did
Edit 2: oh no you did not
Edit 3: actually we need a full ft in here
/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0
|
/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0
|
ft failed on a unrelated unstable test. merging |
Issue: https://github.com/aporeto-inc/aporeto/issues/1274
This PR introduces a new option to the NATS pubsub
Publish
method:NATSOptRespondToChannel
This option allows clients to receive the response
*Publication
to a channel they configure when using the NATS request-reply messaging pattern. This is particularly useful in situations where the client is publishing something within an HTTP handler and they need to block and wait for a reply so they can use the response message to craft an appropriate HTTP response (e.g. Aporeto automations handling webhooks!).Sample usage:
Other things
👀Review: @primalmotion @t00f