Skip to content
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

How to set response message contentType from rpcHandler? #228

Closed
igorz24 opened this issue Feb 1, 2021 · 2 comments
Closed

How to set response message contentType from rpcHandler? #228

igorz24 opened this issue Feb 1, 2021 · 2 comments

Comments

@igorz24
Copy link

igorz24 commented Feb 1, 2021

Hi,

I'm integrating two microservices written in NodeJS and Java. I have trouble in making both communicate, because Spring AMQP handler expects to receive "application/json" message from Node RPC Handler. As far as I understand it, the content actually is buffered as a JSON message, however, I cannot set the appropriate header for the returned message.

I would like to be able to set the headers (options) while returning a response from RPC Handler as specified in the publish API.

Looking at the source code, I see that the options object is passed as an argument, but I cannot find where to pass my own values:
image

Here's my method, from which I want to return the message with specified contentType header:
image

@WonderPanda
Copy link
Collaborator

WonderPanda commented Feb 1, 2021

It isn't really possible to do this today. I'm starting to consider the roadmap for v2.0 which might fix this and a lot of other issues. Please consider sharing some ideas you have for how you would like this feature to work over at #227.

Some ideas that come to mind:

  • should it be a new function that you add to the decorator?
  • would you like to return a "special" object from the getUser function which will allow for attaching additional optional options for each response sent over RPC?

Please let me know what you think so that I can properly determine the roadmap

@igorz24
Copy link
Author

igorz24 commented Feb 2, 2021

I'll join the conversation and move the discussion there.

@igorz24 igorz24 closed this as completed Feb 2, 2021
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

No branches or pull requests

2 participants