Skip to content

Enforce schema for known data types #101

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ public DefaultRecordBuilder() {
Object value = null;

// Interpreting the body as a JMS message type, we can accept BytesMessage and TextMessage only.
// We do not know the schema so do not specify one.
if (messageBodyJms) {
if (message instanceof BytesMessage) {
log.debug("Bytes message with no schema");
log.debug("Bytes message. Setting bytes schema");
value = message.getBody(byte[].class);
valueSchema = Schema.BYTES_SCHEMA;
}
else if (message instanceof TextMessage) {
log.debug("Text message with no schema");
log.debug("Text message. Setting string schema");
value = message.getBody(String.class);
valueSchema = Schema.STRING_SCHEMA;
}
else {
log.error("Unsupported JMS message type {}", message.getClass());
Expand Down