diff --git a/examples/waterdrop/Gemfile b/examples/waterdrop/Gemfile index a2e2b6f..4c276fe 100644 --- a/examples/waterdrop/Gemfile +++ b/examples/waterdrop/Gemfile @@ -2,5 +2,5 @@ source "https://rubygems.org" gem "aws-msk-iam-sasl-signer" gem "base64" -gem 'waterdrop' gem "rexml", "~> 3.2" +gem "waterdrop" diff --git a/examples/waterdrop/oauth_token_refresher.rb b/examples/waterdrop/oauth_token_refresher.rb index ff53810..3f8786a 100644 --- a/examples/waterdrop/oauth_token_refresher.rb +++ b/examples/waterdrop/oauth_token_refresher.rb @@ -10,7 +10,7 @@ def on_oauthbearer_token_refresh(event) event[:bearer].oauthbearer_set_token( token: token.token, lifetime_ms: token.expiration_time_ms, - principal_name: 'kafka-cluster' + principal_name: "kafka-cluster" ) end end diff --git a/examples/waterdrop/producer.rb b/examples/waterdrop/producer.rb index cf04df2..fb2d0c9 100644 --- a/examples/waterdrop/producer.rb +++ b/examples/waterdrop/producer.rb @@ -1,22 +1,20 @@ # frozen_string_literal: true require_relative "oauth_token_refresher" -require 'waterdrop' +require "waterdrop" module Producer - def self.start!(kafka_config) @producer = WaterDrop::Producer.new do |config| config.deliver = true config.kafka = kafka_config # can either configure the listener or subscribe to the event - #config.oauth.token_provider_listener = OAuthTokenRefresher.new + # config.oauth.token_provider_listener = OAuthTokenRefresher.new end - @producer.monitor.subscribe('oauthbearer.token_refresh') do |event| + @producer.monitor.subscribe("oauthbearer.token_refresh") do |event| OAuthTokenRefresher.new.on_oauthbearer_token_refresh(event) end - end def self.produce(**args)