Implementing BatchProducerApp

Finally, all we need to do is create an application that will call processRepeatedly with the right parameters.

Create a new class, coinyser.BatchProducerApp, in src/main/scala and type the following:

package coinyserimport java.io.{BufferedReader, InputStreamReader}import java.net.{URI, URL}import cats.effect.{ExitCode, IO, IOApp}import coinyser.BatchProducer.{httpToDomainTransactions, jsonToHttpTransactions}import com.typesafe.scalalogging.StrictLoggingimport org.apache.spark.sql.{Dataset, SparkSession}import scala.io.Sourceclass BatchProducerApp extends IOApp with StrictLogging {  implicit val spark: SparkSession =   SparkSession.builder.master("local[*]").getOrCreate()  implicit val appContext: AppContext 

Get Scala Programming Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.