-
Notifications
You must be signed in to change notification settings - Fork 0
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
First implementation #1
Conversation
Signed-off-by: marcopiraccini <[email protected]>
Signed-off-by: marcopiraccini <[email protected]>
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 also expose routes to publish messages on those exchanges
Signed-off-by: marcopiraccini <[email protected]>
Signed-off-by: marcopiraccini <[email protected]>
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.
Could you add a test with two instances listening to the same exchange and queue? They should deliver the message only once.
method: 'POST', | ||
headers: targetHeaders, | ||
body: JSON.stringify({ message }) | ||
}) |
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.
you must consume the incoming body, or you'd wait for the socket to timeout to close it.
}) | ||
|
||
app.post('/publish/:exchange/:routingKey?', { | ||
schema: { |
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.
can you also add a schema for the output?
|
||
const targetHeaders = headers || {} | ||
if (!targetHeaders['Content-Type'] && !targetHeaders['content-type']) { | ||
targetHeaders['Content-Type'] = 'application/json' |
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 missing the charset. Unfortunately it's needed or it won't work for folks in asia.
It's already done here: https://github.com/platformatic/rabbitmq-hooks/blob/first-implementation/test/rabbitmq.test.js#L160 |
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
First implementation.
This is configured with: