-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
GH-3696: DeserializationEx support for KafkaMS #8689
Conversation
Fixes spring-projects#3696 * Add an internal logic into `KafkaMessageSource` to react properly for the `ErrorHandlingDeserializer` configuration and re-throw `DeserializationException`
In general just copy/pasted the logic from the Thanks |
} | ||
|
||
@Nullable | ||
private Object findDeserializerClass(Map<String, Object> props, Properties consumerOverrides, boolean isValue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will move most of the duplicated code to SK.ErrorHandlingUtils
; then you can use it from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…alizer` from consumer properties
@Test | ||
void deserializationErrorIsThrownFromSource() throws Exception { | ||
Map<String, Object> consumerProps = KafkaTestUtils.consumerProps(brokers, "testErrorChannelSource", "false"); | ||
consumerProps.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, this is now the default in KTU.
String testData = "test data"; | ||
template.send(TOPIC2, testData); | ||
|
||
source.receive(); // Trigger Kafka Consumer creation and poll() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not entirely sure, but the record might be returned by this initial poll.
It would be safer to remove this and move the following assertion into the untilAsserted() -> {...}
block.
no reason to wait for assignment or check for returned record. We just need to be sure that `DeserializationException` is thrown eventually
Fixes #3696
KafkaMessageSource
to react properly for theErrorHandlingDeserializer
configuration and re-throwDeserializationException