@@ -259,6 +259,37 @@ public void testRetrying_recoversFromInfrastructureIssues() throws Exception {
259
259
"select firstname,lastname,age from " + topicName + " where age = 49" );
260
260
}
261
261
262
+ @ Test
263
+ public void testEmptyCollection_wontFailTheConnector () {
264
+ connect .kafka ().createTopic (topicName , 1 );
265
+ Map <String , String > props = baseConnectorProps (topicName );
266
+ // filter out all message
267
+ props .put ("transforms" , "drop" );
268
+ props .put ("transforms.drop.type" , "org.apache.kafka.connect.transforms.Filter" );
269
+
270
+
271
+ connect .configureConnector (CONNECTOR_NAME , props );
272
+ assertConnectorTaskRunningEventually ();
273
+ Schema schema = SchemaBuilder .struct ().name ("com.example.Person" )
274
+ .field ("firstname" , Schema .STRING_SCHEMA )
275
+ .field ("lastname" , Schema .STRING_SCHEMA )
276
+ .field ("age" , Schema .INT8_SCHEMA )
277
+ .build ();
278
+
279
+ Struct struct = new Struct (schema )
280
+ .put ("firstname" , "John" )
281
+ .put ("lastname" , "Doe" )
282
+ .put ("age" , (byte ) 42 );
283
+
284
+ connect .kafka ().produce (topicName , "key" , new String (converter .fromConnectData (topicName , schema , struct )));
285
+
286
+ int durationMs = 10_000 ;
287
+ long deadline = System .currentTimeMillis () + durationMs ;
288
+ while (System .currentTimeMillis () < deadline ) {
289
+ assertConnectorTaskState (CONNECTOR_NAME , AbstractStatus .State .RUNNING );
290
+ }
291
+ }
292
+
262
293
@ Test
263
294
public void testSymbol_withAllOtherILPTypes () {
264
295
connect .kafka ().createTopic (topicName , 1 );
0 commit comments