Module: Kafka

Defined in:
lib/kafka/broker_info.rb,
lib/kafka.rb,
lib/kafka/pause.rb,
lib/kafka/broker.rb,
lib/kafka/client.rb,
lib/kafka/digest.rb,
lib/kafka/statsd.rb,
lib/kafka/cluster.rb,
lib/kafka/datadog.rb,
lib/kafka/fetcher.rb,
lib/kafka/version.rb,
lib/kafka/consumer.rb,
lib/kafka/producer.rb,
lib/kafka/protocol.rb,
lib/kafka/heartbeat.rb,
lib/kafka/lz4_codec.rb,
lib/kafka/broker_uri.rb,
lib/kafka/compressor.rb,
lib/kafka/connection.rb,
lib/kafka/crc32_hash.rb,
lib/kafka/gzip_codec.rb,
lib/kafka/prometheus.rb,
lib/kafka/sasl/oauth.rb,
lib/kafka/sasl/plain.rb,
lib/kafka/sasl/scram.rb,
lib/kafka/zstd_codec.rb,
lib/kafka/broker_pool.rb,
lib/kafka/compression.rb,
lib/kafka/partitioner.rb,
lib/kafka/sasl/gssapi.rb,
lib/kafka/ssl_context.rb,
lib/kafka/instrumenter.rb,
lib/kafka/interceptors.rb,
lib/kafka/murmur2_hash.rb,
lib/kafka/snappy_codec.rb,
lib/kafka/fetched_batch.rb,
lib/kafka/tagged_logger.rb,
lib/kafka/async_producer.rb,
lib/kafka/consumer_group.rb,
lib/kafka/message_buffer.rb,
lib/kafka/offset_manager.rb,
lib/kafka/fetch_operation.rb,
lib/kafka/fetched_message.rb,
lib/kafka/pending_message.rb,
lib/kafka/protocol/record.rb,
lib/kafka/protocol/decoder.rb,
lib/kafka/protocol/encoder.rb,
lib/kafka/protocol/message.rb,
lib/kafka/produce_operation.rb,
lib/kafka/connection_builder.rb,
lib/kafka/sasl_authenticator.rb,
lib/kafka/socket_with_timeout.rb,
lib/kafka/transaction_manager.rb,
lib/kafka/protocol/message_set.rb,
lib/kafka/pending_message_queue.rb,
lib/kafka/protocol/record_batch.rb,
lib/kafka/protocol/fetch_request.rb,
lib/kafka/consumer_group/assignor.rb,
lib/kafka/fetched_batch_generator.rb,
lib/kafka/fetched_offset_resolver.rb,
lib/kafka/protocol/fetch_response.rb,
lib/kafka/ssl_socket_with_timeout.rb,
lib/kafka/protocol/end_txn_request.rb,
lib/kafka/protocol/produce_request.rb,
lib/kafka/protocol/request_message.rb,
lib/kafka/protocol/end_txn_response.rb,
lib/kafka/protocol/metadata_request.rb,
lib/kafka/protocol/produce_response.rb,
lib/kafka/transaction_state_machine.rb,
lib/kafka/protocol/heartbeat_request.rb,
lib/kafka/protocol/member_assignment.rb,
lib/kafka/protocol/metadata_response.rb,
lib/kafka/protocol/heartbeat_response.rb,
lib/kafka/protocol/join_group_request.rb,
lib/kafka/protocol/sync_group_request.rb,
lib/kafka/protocol/join_group_response.rb,
lib/kafka/protocol/leave_group_request.rb,
lib/kafka/protocol/list_groups_request.rb,
lib/kafka/protocol/list_offset_request.rb,
lib/kafka/protocol/sync_group_response.rb,
lib/kafka/protocol/api_versions_request.rb,
lib/kafka/protocol/leave_group_response.rb,
lib/kafka/protocol/list_groups_response.rb,
lib/kafka/protocol/list_offset_response.rb,
lib/kafka/protocol/offset_fetch_request.rb,
lib/kafka/protocol/alter_configs_request.rb,
lib/kafka/protocol/api_versions_response.rb,
lib/kafka/protocol/create_topics_request.rb,
lib/kafka/protocol/delete_topics_request.rb,
lib/kafka/protocol/offset_commit_request.rb,
lib/kafka/protocol/offset_fetch_response.rb,
lib/kafka/protocol/alter_configs_response.rb,
lib/kafka/protocol/create_topics_response.rb,
lib/kafka/protocol/delete_topics_response.rb,
lib/kafka/protocol/offset_commit_response.rb,
lib/kafka/protocol/sasl_handshake_request.rb,
lib/kafka/round_robin_assignment_strategy.rb,
lib/kafka/protocol/consumer_group_protocol.rb,
lib/kafka/protocol/describe_groups_request.rb,
lib/kafka/protocol/sasl_handshake_response.rb,
lib/kafka/protocol/describe_configs_request.rb,
lib/kafka/protocol/describe_groups_response.rb,
lib/kafka/protocol/find_coordinator_request.rb,
lib/kafka/protocol/init_producer_id_request.rb,
lib/kafka/protocol/create_partitions_request.rb,
lib/kafka/protocol/describe_configs_response.rb,
lib/kafka/protocol/find_coordinator_response.rb,
lib/kafka/protocol/init_producer_id_response.rb,
lib/kafka/protocol/txn_offset_commit_request.rb,
lib/kafka/protocol/add_offsets_to_txn_request.rb,
lib/kafka/protocol/create_partitions_response.rb,
lib/kafka/protocol/txn_offset_commit_response.rb,
lib/kafka/protocol/add_offsets_to_txn_response.rb,
lib/kafka/protocol/add_partitions_to_txn_request.rb,
lib/kafka/protocol/add_partitions_to_txn_response.rb

Overview

Represents a broker in a Kafka cluster.

Defined Under Namespace

Modules: BrokerUri, Compression, Datadog, Digest, Prometheus, Protocol, Sasl, SslContext, Statsd Classes: AsyncProducer, Broker, BrokerInfo, BrokerNotAvailable, BrokerPool, BufferOverflow, Client, Cluster, ClusterAuthorizationFailed, Compressor, ConcurrentTransactionError, Connection, ConnectionBuilder, ConnectionError, Consumer, ConsumerGroup, CoordinatorLoadInProgress, CoordinatorNotAvailable, CorruptMessage, Crc32Hash, DecoratingInstrumenter, DeliveryFailed, DuplicateSequenceNumberError, Error, FailedScramAuthentication, FetchError, FetchOperation, FetchedBatch, FetchedBatchGenerator, FetchedMessage, FetchedOffsetResolver, Fetcher, GroupAuthorizationFailed, GzipCodec, Heartbeat, HeartbeatError, IdleConnection, IllegalGeneration, InconsistentGroupProtocol, Instrumenter, InsufficientDataMessage, Interceptors, InvalidCommitOffsetSize, InvalidConfig, InvalidGroupId, InvalidMessageSize, InvalidPartitions, InvalidProducerEpochError, InvalidProducerIDMappingError, InvalidReplicaAssignment, InvalidReplicationFactor, InvalidRequest, InvalidRequiredAcks, InvalidSaslState, InvalidSessionTimeout, InvalidTimestamp, InvalidTopic, InvalidTransactionTimeoutError, InvalidTxnStateError, LZ4Codec, LeaderNotAvailable, MessageBuffer, MessageSizeTooLarge, MessageTooLargeToRead, Murmur2Hash, NetworkException, NoPartitionsToFetchFrom, NoSuchBroker, NotController, NotCoordinatorForGroup, NotEnoughReplicas, NotEnoughReplicasAfterAppend, NotLeaderForPartition, OffsetCommitError, OffsetManager, OffsetMetadataTooLarge, OffsetOutOfRange, OutOfOrderSequenceNumberError, Partitioner, Pause, PendingMessage, PendingMessageQueue, PolicyViolation, ProcessingError, ProduceOperation, Producer, ProtocolError, RebalanceInProgress, RecordListTooLarge, ReplicaNotAvailable, RequestTimedOut, RoundRobinAssignmentStrategy, SSLSocketWithTimeout, SaslAuthenticator, SaslScramError, SnappyCodec, SocketWithTimeout, StaleControllerEpoch, TaggedLogger, TokenMethodNotImplementedError, TopicAlreadyExists, TopicAuthorizationFailed, TransactionCoordinatorFencedError, TransactionManager, TransactionStateMachine, UnknownError, UnknownMemberId, UnknownTopicOrPartition, UnsupportedForMessageFormat, UnsupportedSaslMechanism, UnsupportedVersion, ZstdCodec

Constant Summary collapse

VERSION =
"1.4.0"

Class Method Summary collapse

Class Method Details

.new(seed_brokers = nil, **options) ⇒ Client

Initializes a new Kafka client.

Returns:

See Also:



362
363
364
365
366
367
368
369
370
# File 'lib/kafka.rb', line 362

def self.new(seed_brokers = nil, **options)
  # We allow `seed_brokers` to be passed in either as a positional _or_ as a
  # keyword argument.
  if seed_brokers.nil?
    Client.new(**options)
  else
    Client.new(seed_brokers: seed_brokers, **options)
  end
end