You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@samza.apache.org by GitBox <gi...@apache.org> on 2019/03/20 23:14:00 UTC

[GitHub] [samza] mynameborat commented on a change in pull request #951: SAMZA-2127: Upgrade to Kafka 2.0

mynameborat commented on a change in pull request #951: SAMZA-2127: Upgrade to Kafka 2.0
URL: https://github.com/apache/samza/pull/951#discussion_r267582422
 
 

 ##########
 File path: samza-kafka/src/test/scala/org/apache/samza/system/kafka/TestKafkaSystemAdmin.scala
 ##########
 @@ -257,17 +211,22 @@ class TestKafkaSystemAdmin {
     assertEquals("2", sspMetadata.get(new Partition(48)).getUpcomingOffset)
 
     // Validate that a fetch will return the message.
-    val connector = getConsumerConnector
-    var stream = connector.createMessageStreams(Map(TOPIC -> 1))(TOPIC).head.iterator
-    var message = stream.next
-    var text = new String(message.message, "UTF-8")
-    connector.shutdown
+    val consumer = getKafkaConsumer
+    consumer.subscribe(JavaConverters.setAsJavaSetConverter(Set(TOPIC)).asJava)
+    val records = consumer.poll(Duration.ofMillis(1000))
+    consumer.close()
+
+    assertTrue(records.count() > 2)
 
 Review comment:
   Forgot to push the local change.
   Fixed it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services