-
Notifications
You must be signed in to change notification settings - Fork 614
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
i can't find anything about callback after acked. why there's no before and after method in MessageListener? #1338
Comments
Let's see if https://docs.spring.io/spring-amqp/docs/current/reference/html/#containerAttributes
So, you write your own |
it works, thanks |
the aop advice works on target method |
You would need to add a reference to the listener container to the advice and stop the container (use the async |
why stop container, i only need to cancel some not all. |
right now i used manual ack, then remove queueNames from container, may be another thread to remove, i'm not sure.
|
Ok; now I see what your requirements are. You are correct, there is currently no callback after the ack. Contributions are welcome. |
This requirement seems simple to achieve. Define a method in
Is it necessary to implement this feature? If necessary, does this approach make sense? @garyrussell |
Looks reasonable to me. |
Hi gary! I am trying to implement this feature today. In the process of implementation, I found it is easy to pass in
Any ideas? @garyrussell |
@zysaaa I don't think we want to over-complicate this; the user can capture the delivery tag in the listener and then correlate it in the callback if (s)he needs to. |
- Add a default ack listener - Use lambdas in tests - NOSONAR tags
- Add a default ack listener - Use lambdas in tests - NOSONAR tags
Affects Version(s): <Spring AMQP version>
all
Enhancement
sometimes we used some state in memory map. needs to get it in
listener#onMessage
, and remove it after acked.but now i can only remove it in onMessage, if the method exits and ack failed, the state lost.
next time, the same message comes to onMessage, but the state is gone.
so, i was wondering why there's no interceptor like before and after method in MessageListener, then we can do some inilialize before invoke onMessage and release some resources after acked ok or not.
MessagePostProcessor
seems to be act as before interceptor, what about create a newMessageAckProcessor
?The text was updated successfully, but these errors were encountered: