Skip to content

Commit

Permalink
Replace older kafka with new in kraft mode (karafka#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
mensfeld authored Nov 1, 2023
1 parent 81e3147 commit ed8a10a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [Enhancement] Introduce `#name` for producers and consumers (mensfeld)
* [Fix] `#flush` does not handle the timeouts errors by making it return `true` if all flushed or `false` if failed. We do **not** raise an exception here to keep it backwards compatible (mensfeld)
* [Change] Remove support for Ruby 2.6 due to it being EOL and WeakMap incompatibilities (mensfeld)
* [Change] Update Kafka Docker with Confluent KRaft (mensfeld)

# 0.13.0
* Support cooperative sticky partition assignment in the rebalance callback (methodmissing)
Expand Down
31 changes: 16 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
---

version: '2'

services:
zookeeper:
image: confluentinc/cp-zookeeper:7.5.1
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000

kafka:
image: confluentinc/cp-kafka:5.3.6-10
depends_on:
- zookeeper
container_name: kafka
image: confluentinc/cp-kafka:7.5.1

ports:
- 9092:9092

environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
CLUSTER_ID: kafka-docker-cluster-1
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
KAFKA_BROKER_ID: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: [email protected]:9093
ALLOW_PLAINTEXT_LISTENER: 'yes'
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
2 changes: 1 addition & 1 deletion spec/rdkafka/admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}.to raise_exception { |ex|
expect(ex).to be_a(Rdkafka::RdkafkaError)
expect(ex.message).to match(/Broker: Invalid topic \(topic_exception\)/)
expect(ex.broker_message).to match(/Topic name.*is illegal, it contains a character other than ASCII alphanumerics/)
expect(ex.broker_message).to match(/Topic name.*is invalid: .* contains one or more characters other than ASCII alphanumerics, '.', '_' and '-'/)
}
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/rdkafka/metadata_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
it "#brokers returns our single broker" do
expect(subject.brokers.length).to eq(1)
expect(subject.brokers[0][:broker_id]).to eq(1)
expect(subject.brokers[0][:broker_name]).to eq("localhost")
expect(subject.brokers[0][:broker_name]).to eq("127.0.0.1")
expect(subject.brokers[0][:broker_port]).to eq(9092)
end

Expand All @@ -54,7 +54,7 @@
it "#brokers returns our single broker" do
expect(subject.brokers.length).to eq(1)
expect(subject.brokers[0][:broker_id]).to eq(1)
expect(subject.brokers[0][:broker_name]).to eq("localhost")
expect(subject.brokers[0][:broker_name]).to eq("127.0.0.1")
expect(subject.brokers[0][:broker_port]).to eq(9092)
end

Expand Down

0 comments on commit ed8a10a

Please sign in to comment.