@@ -575,7 +575,7 @@ public void onPartitionsAssigned(Collection<TopicPartition> partitions) {
575
575
public void testMaxFailures () throws Exception {
576
576
logger .info ("Start testMaxFailures" );
577
577
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 " );
579
579
props .put (ConsumerConfig .ISOLATION_LEVEL_CONFIG , "read_committed" );
580
580
DefaultKafkaConsumerFactory <Integer , String > cf = new DefaultKafkaConsumerFactory <>(props );
581
581
ContainerProperties containerProps = new ContainerProperties (topic3 );
@@ -650,9 +650,10 @@ public void accept(ConsumerRecord<?, ?> record, Exception exception) {
650
650
Map <String , Object > map = new HashMap <>();
651
651
mapper .toHeaders (dltRecord .headers (), map );
652
652
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" );
654
655
assertThat (headers .get (KafkaHeaders .DLT_EXCEPTION_MESSAGE , byte [].class ))
655
- .isEqualTo ("fail for max failures" .getBytes ());
656
+ .contains ("fail for max failures" .getBytes ());
656
657
assertThat (headers .get (KafkaHeaders .DLT_EXCEPTION_STACKTRACE )).isNotNull ();
657
658
assertThat (headers .get (KafkaHeaders .DLT_ORIGINAL_OFFSET , byte [].class )[3 ]).isEqualTo ((byte ) 0 );
658
659
assertThat (headers .get (KafkaHeaders .DLT_ORIGINAL_PARTITION , byte [].class )[3 ]).isEqualTo ((byte ) 0 );
@@ -663,7 +664,11 @@ public void accept(ConsumerRecord<?, ?> record, Exception exception) {
663
664
pf .destroy ();
664
665
assertThat (stopLatch .await (10 , TimeUnit .SECONDS )).isTrue ();
665
666
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" );
667
672
verify (afterRollbackProcessor ).clearThreadState ();
668
673
verify (dlTemplate ).send (any (ProducerRecord .class ));
669
674
verify (dlTemplate ).sendOffsetsToTransaction (
0 commit comments