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

on_before_message affecting message to all listeners #300

Closed
fabiohk opened this issue Mar 27, 2020 · 4 comments
Closed

on_before_message affecting message to all listeners #300

fabiohk opened this issue Mar 27, 2020 · 4 comments

Comments

@fabiohk
Copy link

fabiohk commented Mar 27, 2020

I'm not sure if this is the correct approach nor if it's the desirable behaviour, but I noticed that if I have two listeners attached to the same transport and one of them change the headers or body inside the on_before_message method, all the subsequent listeners will received the modified message.

Is this the desired behaviour or am I missing something?

@jasonrbriggs
Copy link
Owner

Yes, the stomp frame is an object -- and not intended to be unmodifiable -- so changing it in one listener would affect the next.

@fabiohk
Copy link
Author

fabiohk commented Mar 29, 2020

Ok, but then with that listeners interdependency, we can’t establish two, or more, lines of execution in a simple manner.

Why have it? Is there any advantage in that approach?

@jasonrbriggs
Copy link
Owner

The advantage is you can use a chain of listeners to enrich the message with further detail (i.e. pre/post processing steps). I recall at least one conversation with a user who is doing something along those lines. Ideally both usecases should be possible. A version of the frame which is the modified version versus the original -- but obviously it hasn't be raised before.

@jasonrbriggs
Copy link
Owner

Closing issue since this will be addressed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants