Skip to content

Commit

Permalink
CR comment (rspecs broken)
Browse files Browse the repository at this point in the history
  • Loading branch information
ariana-flipp committed May 8, 2024
1 parent 037719c commit 0999eea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ schema|nil|Name of the schema to use to encode data before producing.
namespace|nil|Namespace of the schema to use when finding it locally.
key_config|nil|Configuration hash for message keys. See [Kafka Message Keys](../README.md#installation)
use_schema_classes|nil|Set to true or false to enable or disable using the producers schema classes. See [Generated Schema Classes](../README.md#generated-schema-classes)
max_batch_size|500|Maximum publishing batch size. Defaults to top-level configuration of 500.

## Defining Consumers

Expand Down
2 changes: 2 additions & 0 deletions lib/deimos/config/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def self.configure_producer_or_consumer(kafka_config)
bulk_import_id_generator: kafka_config.bulk_import_id_generator ||
Deimos.config.consumers.bulk_import_id_generator
)
else # producer
klass.config[:max_batch_size] = kafka_config.max_batch_size || Deimos.config.producers.max_batch_size
end
end
end
Expand Down
9 changes: 1 addition & 8 deletions lib/deimos/producer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ class << self
def config
@config ||= {
encode_key: true,
namespace: Deimos.config.producers.schema_namespace,
max_batch_size: Deimos.config.producers.max_batch_size
namespace: Deimos.config.producers.schema_namespace
}
end

Expand All @@ -90,12 +89,6 @@ def partition_key(_payload)
nil
end

# @param size [Integer] Override the default batch size for publishing.
# @return [void]
def max_batch_size(size)
config[:max_batch_size] = size
end

# Publish the payload to the topic.
# @param payload [Hash, SchemaClass::Record] with an optional payload_key hash key.
# @param topic [String] if specifying the topic
Expand Down

0 comments on commit 0999eea

Please sign in to comment.