File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -679,6 +679,25 @@ def call(_, handle)
679679 end
680680 end
681681
682+ context "when topic does not exist and allow.auto.create.topics is false" do
683+ let ( :producer ) do
684+ rdkafka_producer_config (
685+ "bootstrap.servers" : "localhost:9092" ,
686+ "message.timeout.ms" : 100 ,
687+ "allow.auto.create.topics" : false
688+ ) . producer
689+ end
690+
691+ it "should contain the error in the response when not deliverable" do
692+ handler = producer . produce ( topic : "it-#{ SecureRandom . uuid } " , payload : nil , label : 'na' )
693+ # Wait for the async callbacks and delivery registry to update
694+ sleep ( 2 )
695+ expect ( handler . create_result . error ) . to be_a ( Rdkafka ::RdkafkaError )
696+ expect ( handler . create_result . error . code ) . to eq ( :msg_timed_out )
697+ expect ( handler . create_result . label ) . to eq ( 'na' )
698+ end
699+ end
700+
682701 describe '#partition_count' do
683702 it { expect ( producer . partition_count ( 'consume_test_topic' ) ) . to eq ( 3 ) }
684703
You can’t perform that action at this time.
0 commit comments