September 2018
Intermediate to advanced
398 pages
9h 43m
English
We are able to listen to live transactions and deserialize them to objects of type WebsocketTransaction. The next steps are:
Convert these WebsocketTransaction objects into the same case class, Transaction, that we defined in the previous chapter.
Send these Transaction objects to a Kafka topic. But for this, they need to be serialized first. The simplest way is to serialize to JSON.
As usual, we start by writing tests. Add the following tests to StreamingProducerSpec:
class StreamingProducerSpec extends WordSpec with Matchers with TypeCheckedTripleEquals { "StreamingProducer.deserializeWebsocketTransaction" should {...} "StreamingProducer.convertTransaction" should { "convert a WebSocketTransaction ...
Read now
Unlock full access