Class: Sbmt::KafkaProducer::KafkaClientFactory
- Inherits:
-
Object
- Object
- Sbmt::KafkaProducer::KafkaClientFactory
- Defined in:
- lib/sbmt/kafka_producer/kafka_client_factory.rb
Constant Summary collapse
- CLIENTS_REGISTRY_MUTEX =
Mutex.new
- CLIENTS_REGISTRY =
{}
Class Method Summary collapse
Class Method Details
.build(kafka_options = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sbmt/kafka_producer/kafka_client_factory.rb', line 18 def build( = {}) return default_client if .empty? fetch_client() do ConnectionPool::Wrapper.new do WaterDrop::Producer.new do |config| configure_client(config, ) end end end end |
.default_client ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/sbmt/kafka_producer/kafka_client_factory.rb', line 10 def default_client @default_client ||= ConnectionPool::Wrapper.new do WaterDrop::Producer.new do |config| configure_client(config) end end end |