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

feature: suggest to pass all arguments to consumer #65

Open
GuihaiHU opened this issue Mar 31, 2020 · 2 comments
Open

feature: suggest to pass all arguments to consumer #65

GuihaiHU opened this issue Mar 31, 2020 · 2 comments
Labels
question Further information is requested

Comments

@GuihaiHU
Copy link
Contributor

GuihaiHU commented Mar 31, 2020

Innestx-amqp , PublishQueue and PublishExchange just send the first argument to consumer now. I don't understand why it is designed like this. I strongly recommend that I should send all arguments to consumer.

@aquariuslt
Copy link
Member

sorry for late reply,
@PublishQueue/@PublishExchangecurrently only pass first argument to the handling method.

belows are my concern:

  • as producer handler, developer can customize produce options at options property in decorators
  • and the might use other decorator like @PublishEvent, @Broadcast at the same time (setting options in handler method and pass all arguments to decorator might broke other decorators.
  • as decorator options, like PublishExchangeOptions, it can perform type-safe checking

for dynamic options, it's better to design an extra decorator binding queue and exchange.
like below code

@InjectedQueue(queue)
someQueue: Queue;


queue.send(content, options, otherArgs); // pass all arguments to internal producer

@aquariuslt aquariuslt added the question Further information is requested label Apr 1, 2020
@aquariuslt
Copy link
Member

you can refer to @Payload, @Header in spring-messaging . T
these decorators is design to be detected in @PublishQueue/Exchange and covert to runtime arguments.

https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/messaging/handler/annotation/Payload.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants