Skip to content

Instantly share code, notes, and snippets.

@KadekM
Created March 17, 2021 15:07
Show Gist options
  • Save KadekM/65bd68e94bae21403a383c0426046325 to your computer and use it in GitHub Desktop.
Save KadekM/65bd68e94bae21403a383c0426046325 to your computer and use it in GitHub Desktop.
// ... previous code
val consumerM = Consumer.make(consumerSettings)
for {
_ <- session.execute(Sql.partitionTableDdl)
_ <- session.execute(Sql.balanceTableDdl)
_ <- consumerM.use { consumer =>
consumer.subscribeAnd(Subscription.topics(TopicName))
.plainStream(Serde.int, CommandSerde)
.tap(x => log.info(x.value.toString))
.runDrain
}
} yield ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment