dongnuo123 commented on code in PR #18989:
URL: https://github.com/apache/kafka/pull/18989#discussion_r1971754326
##########
core/src/test/scala/integration/kafka/api/EndToEndAuthorizationTest.scala:
##########
@@ -561,5 +568,17 @@ abstract class EndToEndAuthorizationTest extends
IntegrationTestHarness with Sas
case _: TopicAuthorizationException => consumeRecords(consumer,
numRecords, startingOffset, topic)
}
}
+
+ // Consume records, ignoring TopicAuthorization exception from previously
sent request.
+ private def consumeRecordsIgnoreAuthorizationException(consumer:
Consumer[Array[Byte], Array[Byte]],
+ numRecords: Int = 1,
+ startingOffset: Int = 0,
+ topic: String = topic): Unit = {
+ try {
+ consumeRecords(consumer, numRecords, startingOffset, topic)
+ } catch {
+ case _: TopicAuthorizationException =>
consumeRecordsIgnoreAuthorizationException(consumer, numRecords,
startingOffset, topic)
Review Comment:
Yes agree. This is simpler
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]