Skip to content

Conversation

@cfredri4
Copy link
Contributor

This changes allows configuring interceptors on AbstractKafkaListenerContainerFactory in same way as on KafkaMessageListenerContainer, and changes the examle docs to show this instead.
I can revert the update to the docs if desired but I thought it to be more useful as an example since you normally have access to the listener container factory as a bean, but not to the listener container since it's not a bean.

@cfredri4
Copy link
Contributor Author

@sobychacko I thought it was enough with a single example to illustrate the concept of adding interceptors afterwards, and so I changed the example to instead show how it's done with the listener container factory since that should be more universally applicable.

The reasoning being that the listener container factory is normally a bean, but only the few who manually create their own listener container would have access to it and could follow the previous example.

Should I add back the old example and show both?

@sobychacko
Copy link
Contributor

sobychacko commented Sep 15, 2025

Since that old functionality is sill available (via the previous changes you made as public API's), I think its probably better to show both examples?

@cfredri4 cfredri4 force-pushed the configure-interceptors-on-listener-container-factory branch from 0717605 to 3305f97 Compare September 15, 2025 19:18
This changes allows configuring interceptors on AbstractKafkaListenerContainerFactory in same way as on KafkaMessageListenerContainer, and changes the example docs to show this instead.

Signed-off-by: Christian Fredriksson <christian.fredriksson.2@volvocars.com>
@cfredri4 cfredri4 force-pushed the configure-interceptors-on-listener-container-factory branch from 3305f97 to 08b6715 Compare September 15, 2025 19:20
@cfredri4
Copy link
Contributor Author

@sobychacko the two examples became almost identical except for two lines with container vs containerFactory so I mostly reverted back to the original example (but there was an issue with the original example; if previousInterceptor already was a CompositeRecordInterceptor it would add itself to itself 🙃).
Please check again.

@cfredri4
Copy link
Contributor Author

@sobychacko gentle reminder.

@sobychacko sobychacko self-requested a review September 23, 2025 17:37
@sobychacko sobychacko added this to the 4.0.0-RC1 milestone Sep 23, 2025
@sobychacko sobychacko merged commit d613fa3 into spring-projects:main Sep 23, 2025
3 checks passed
@cfredri4 cfredri4 deleted the configure-interceptors-on-listener-container-factory branch September 29, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants