Skip to content

Commit

Permalink
allow override the Schema Creator by a reader
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianiacobghiula committed Mar 3, 2024
1 parent 4938292 commit 1ea39fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pulsar/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ type ReaderOptions struct {
// Schema represents the schema implementation.
Schema Schema

// SchemaCreator allows to override the default creator of Schema based on schemaType, schemaData and properties
// will default to NewSchema if not set
SchemaCreator SchemaCreator

// BackoffPolicy parameterize the following options in the reconnection logic to
// allow users to customize the reconnection logic (minBackoff, maxBackoff and jitterPercentage)
BackoffPolicy internal.BackoffPolicy
Expand Down
1 change: 1 addition & 0 deletions pulsar/reader_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func newReader(client *client, options ReaderOptions) (Reader, error) {
ReplicateSubscriptionState: false,
Decryption: options.Decryption,
Schema: options.Schema,
SchemaCreator: options.SchemaCreator,
BackoffPolicy: options.BackoffPolicy,
MaxPendingChunkedMessage: options.MaxPendingChunkedMessage,
ExpireTimeOfIncompleteChunk: options.ExpireTimeOfIncompleteChunk,
Expand Down

0 comments on commit 1ea39fe

Please sign in to comment.