-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Crash on Kafka consume when key is string with recordType: JSON
#657
Comments
- fix recordType JSON authorjapps#657 - use objectMapper to convert from POJO to JSON instead of toString() - misspelled recordType - topic "demo-p6" is used in another test, replace by "demo-p7"
@Tobolov , understood the issue.
Just checking about your test usecase, did you produce the messages that way(mentioned in No. 1) |
Thanks for the swift reply @authorjapps! I first identified the issue when I had another application produce a record with an alpha-number key and a JSON value in response to a HTTP request. That said, I will have also have tests quite similar in nature to the one included in the bug report. The only notable difference being the key will be |
@Tobolov , we will be sorting this out soon in the next release. Until the fix is in place, the below work-around could be used(temporarily fix only if feasible) :
instead of I am aware that this may not be very convinient if the message is produced by another application(internal or external to your system), but may be an alternative(for temporarily until the PR is merged) if your one of your test step is doing the A working example is here for reference, for the the this test scenario. |
TODO: Available in version: Release Details: |
When consuming a Kafka records with
recordType: JSON
, records with a plain string as a the key can't be deserialized.Scenario to reproduce:
Exception:
Root cause:
On KafkaConsumerHelper.java#L307, we run
JsonNode keyNode = objectMapper.readTree(keyStr);
. This expects the key to be a supported JSON element. The value1dd2e6c2-9d40-4c75-b735-c83911b6b652
is not a supported JSON element, however"1dd2e6c2-9d40-4c75-b735-c83911b6b652"
would be.JSON equivalent:
The text was updated successfully, but these errors were encountered: