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 error message to use subject_name #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions lib/field_struct/avro_schema/kafka.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ def register_event_schemas
def register_event_schema(klass)
return nil unless klass.publishable?

subject_name = build_subject_name(klass)
id = if configuration.automatic_schema_registration
schema_registry.register build_subject_name(klass), klass.schema
schema_registry.register subject_name, klass.schema
else
data = schema_registry.check build_subject_name(klass), klass.schema
data = schema_registry.check subject_name, klass.schema
data&.fetch('id')
end
raise StandardError, "Schema Not Found -- Schema Name: #{klass.default_schema_record_name}" if id.blank?
raise StandardError, "Schema Not Found for subject -- Subject Name: #{subject_name}" if id.blank?

klass.schema_id id
klass
Expand Down
2 changes: 1 addition & 1 deletion lib/field_struct/avro_schema/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module FieldStruct
module AvroSchema
VERSION = '0.2.0'
VERSION = '0.2.1'
end
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require 'field_struct/avro_schema'
require 'avro_acima/encryption/dummy_encryption_provider'
require 'fileutils'
require 'ostruct'

FieldStruct::AvroSchema.logger.level = ENV.fetch('LOG_LEVEL', Logger::INFO).to_i

Expand Down
Loading