Kafka scaladsl possible test fix

(Ido Shamun) #1

I noticed that in the keep track of the read-side offset when publishing events that CountDownLatch is initialized to 3 although only one message should be sent after setting the offset to 1.
I am working on my own implementation of Google Pub/Sub Message Broker and would like to copy some of the tests.

(Tim Moore) #2

Thanks for pointing this out, @idoshamun. It took me a little while to work out what was going on here :smile:

The count-down latch value isn’t wrong: the problem is that the offset is loaded by the topic producer when the application starts up, before the offsetDao.saveOffset(Sequence(1)) line even runs. So it does publish all three messages.

After looking through the test again, I don’t think that setting the offset there is really applicable to what this test is actually testing, so I’ve submitted a pull request that just deletes that line: https://github.com/lagom/lagom/pull/1316

(Ido Shamun) #3

@TimMoore thanks for the fix, the Kafka Message Broker servers as an excellent reference for my Google Pub/Sub Message Broker implementation. Hoping to have a stable version soon :slight_smile: