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

fix: interceptor preventing metadata propagation #2964

Conversation

holomekc
Copy link
Contributor

@holomekc holomekc commented Mar 9, 2025

I am not 100% sure about this, but at the moment it is not possible to access the OutgoingMessageMetadata (omd) in case an interceptor is used. Is this intended? I am also not sure if the approach to access the omd I used in the test is actually something you guys had in mind.

Nevertheless, at the moment the OutgoingInterceptorDecorator is overwriting the omd without checking if the meta data already exists

@ozangunalp
Copy link
Collaborator

I didn't think of the scenario where an OutgoingMessageMetadata object instance can be reused. Overall it doesn't make a nydifference.

@holomekc
Copy link
Contributor Author

holomekc commented Mar 10, 2025

Hi @ozangunalp ,
thx for the quick answer. Hmm I am not sure if I understand you correctly. I was trying to figure out how I can even access the OutgoingMessageMetadata in my application code, to get access to the result (For access tosqs messageId) . I couldn't figure out how except the way I used in the test I added here. I also could not find it in the documentation except in the Interceptor. But this is not always sufficient.

But using the approach I used in the test does not work, if the decorator overwrites the OutgoingMessageMetadata. Without this change I end up with no omd. No matter if I set the omd or if I do not set the omd beforehand.

@ozangunalp
Copy link
Collaborator

This definitely makes sense in the emitter use case.

@holomekc could you rewrite your commits by signing them?

@holomekc holomekc force-pushed the fix/interceptor-preventing-metadata-propagation branch from de5f123 to 23410b6 Compare March 10, 2025 18:09
@holomekc
Copy link
Contributor Author

Hi @ozangunalp,
looks like Schrödinger's cat. Java 17 is green and yellow at the same time.

@ozangunalp
Copy link
Collaborator

I know, there is a quirk in the PR acceptance ruleset which doesn't recognize the required check.

@ozangunalp ozangunalp merged commit ee134d7 into smallrye:main Mar 13, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants