@@ -575,7 +575,7 @@ public void onPartitionsAssigned(Collection<TopicPartition> partitions) {
575575 public void testMaxFailures () throws Exception {
576576 logger .info ("Start testMaxFailures" );
577577 Map <String , Object > props = KafkaTestUtils .consumerProps ("txTestMaxFailures" , "false" , embeddedKafka );
578- props .put (ConsumerConfig .GROUP_ID_CONFIG , "group " );
578+ props .put (ConsumerConfig .GROUP_ID_CONFIG , "groupInARBP " );
579579 props .put (ConsumerConfig .ISOLATION_LEVEL_CONFIG , "read_committed" );
580580 DefaultKafkaConsumerFactory <Integer , String > cf = new DefaultKafkaConsumerFactory <>(props );
581581 ContainerProperties containerProps = new ContainerProperties (topic3 );
@@ -650,9 +650,10 @@ public void accept(ConsumerRecord<?, ?> record, Exception exception) {
650650 Map <String , Object > map = new HashMap <>();
651651 mapper .toHeaders (dltRecord .headers (), map );
652652 MessageHeaders headers = new MessageHeaders (map );
653- assertThat (new String (headers .get (KafkaHeaders .DLT_EXCEPTION_FQCN , byte [].class ))).contains ("RuntimeException" );
653+ assertThat (new String (headers .get (KafkaHeaders .DLT_EXCEPTION_FQCN , byte [].class )))
654+ .contains ("ListenerExecutionFailedException" );
654655 assertThat (headers .get (KafkaHeaders .DLT_EXCEPTION_MESSAGE , byte [].class ))
655- .isEqualTo ("fail for max failures" .getBytes ());
656+ .contains ("fail for max failures" .getBytes ());
656657 assertThat (headers .get (KafkaHeaders .DLT_EXCEPTION_STACKTRACE )).isNotNull ();
657658 assertThat (headers .get (KafkaHeaders .DLT_ORIGINAL_OFFSET , byte [].class )[3 ]).isEqualTo ((byte ) 0 );
658659 assertThat (headers .get (KafkaHeaders .DLT_ORIGINAL_PARTITION , byte [].class )[3 ]).isEqualTo ((byte ) 0 );
@@ -663,7 +664,11 @@ public void accept(ConsumerRecord<?, ?> record, Exception exception) {
663664 pf .destroy ();
664665 assertThat (stopLatch .await (10 , TimeUnit .SECONDS )).isTrue ();
665666 verify (afterRollbackProcessor , times (4 )).isProcessInTransaction ();
666- verify (afterRollbackProcessor , times (4 )).process (any (), any (), any (), anyBoolean ());
667+ ArgumentCaptor <Exception > captor = ArgumentCaptor .forClass (Exception .class );
668+ verify (afterRollbackProcessor , times (4 )).process (any (), any (), captor .capture (), anyBoolean ());
669+ assertThat (captor .getValue ()).isInstanceOf (ListenerExecutionFailedException .class )
670+ .extracting (ex -> ((ListenerExecutionFailedException ) ex ).getGroupId ())
671+ .isEqualTo ("groupInARBP" );
667672 verify (afterRollbackProcessor ).clearThreadState ();
668673 verify (dlTemplate ).send (any (ProducerRecord .class ));
669674 verify (dlTemplate ).sendOffsetsToTransaction (
0 commit comments