Class: DeliveryBoy::Config

Inherits:
KingKonf::Config
  • Object
show all
Defined in:
lib/delivery_boy/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sasl_oauth_token_providerObject

SASL OAUTHBEARER (legacy - callback-based, not supported with librdkafka)



116
117
118
# File 'lib/delivery_boy/config.rb', line 116

def sasl_oauth_token_provider
  @sasl_oauth_token_provider
end

Instance Method Details

#ack_timeout_msObject



27
28
29
# File 'lib/delivery_boy/config.rb', line 27

def ack_timeout_ms
  ack_timeout * 1000
end

#connection_timeout_msObject



7
8
9
# File 'lib/delivery_boy/config.rb', line 7

def connection_timeout_ms
  connect_timeout * 1000
end

#delivery_interval_msObject



23
24
25
# File 'lib/delivery_boy/config.rb', line 23

def delivery_interval_ms
  delivery_interval * 1000
end

#max_buffer_kbytesizeObject



19
20
21
# File 'lib/delivery_boy/config.rb', line 19

def max_buffer_kbytesize
  max_buffer_bytesize / 1024
end

#retry_backoff_msObject



31
32
33
# File 'lib/delivery_boy/config.rb', line 31

def retry_backoff_ms
  retry_backoff * 1000
end

#sasl_enabled?Boolean

Returns:

  • (Boolean)


35
36
37
38
# File 'lib/delivery_boy/config.rb', line 35

def sasl_enabled?
  return false unless sasl_mechanism && !sasl_mechanism.empty?
  sasl_mechanism.upcase != "GSSAPI"
end

#socket_timeout_msObject



11
12
13
# File 'lib/delivery_boy/config.rb', line 11

def socket_timeout_ms
  socket_timeout * 1000
end

#transactional_timeout_msObject



15
16
17
# File 'lib/delivery_boy/config.rb', line 15

def transactional_timeout_ms
  transactional_timeout * 1000
end

#validate_aws_msk_iam!Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/delivery_boy/config.rb', line 40

def validate_aws_msk_iam!
  if sasl_aws_msk_iam_access_key_id || sasl_aws_msk_iam_secret_key_id || sasl_aws_msk_iam_aws_region
    raise ConfigError, <<~ERROR
      AWS MSK IAM authentication is not supported by librdkafka.

      Alternatives:
      1. Use AWS MSK SCRAM-SHA-512 authentication (recommended)
         - Create SCRAM credentials in AWS Secrets Manager
         - Set sasl_mechanism = "SCRAM-SHA-512"
         - Set sasl_username and sasl_password

      2. Use mTLS (mutual TLS) with client certificates
         - Configure ssl_client_cert and ssl_client_cert_key

      See migration guide: https://github.com/zendesk/delivery_boy/blob/master/MIGRATION.md#aws-msk-iam
    ERROR
  end
end