@@ -451,22 +451,32 @@ def each_message(topic:, start_from_beginning: true, max_wait_time: 5, min_bytes
451451
452452 # Creates a topic in the cluster.
453453 #
454+ # @example Creating a topic with log compaction
455+ # # Enable log compaction:
456+ # config = { "cleanup.policy" => "compact" }
457+ #
458+ # # Create the topic:
459+ # kafka.create_topic("dns-mappings", config: config)
460+ #
454461 # @param name [String] the name of the topic.
455462 # @param num_partitions [Integer] the number of partitions that should be created
456463 # in the topic.
457464 # @param replication_factor [Integer] the replication factor of the topic.
458465 # @param timeout [Integer] a duration of time to wait for the topic to be
459466 # completely created.
460- # @param config_entries [Hash] topic-level configs to use for the topic.
461- # See https://kafka.apache.org/documentation/#topicconfigs.
467+ # @param config [Hash] topic configuration entries. See
468+ # [the Kafka documentation](https://kafka.apache.org/documentation/#topicconfigs)
469+ # for more information.
462470 # @raise [Kafka::TopicAlreadyExists] if the topic already exists.
463471 # @return [nil]
464- def create_topic ( name , num_partitions : 1 , replication_factor : 1 , timeout : 30 , config_entries : { } )
465- @cluster . create_topic ( name ,
466- num_partitions : num_partitions ,
467- replication_factor : replication_factor ,
468- timeout : timeout ,
469- config_entries : config_entries )
472+ def create_topic ( name , num_partitions : 1 , replication_factor : 1 , timeout : 30 , config : { } )
473+ @cluster . create_topic (
474+ name ,
475+ num_partitions : num_partitions ,
476+ replication_factor : replication_factor ,
477+ timeout : timeout ,
478+ config : config ,
479+ )
470480 end
471481
472482 # Delete a topic in the cluster.
0 commit comments