WF Reactive System – Consumer implementation

In this section, we will use the following steps to develop our Reactive System's Consumer implementation(wf-consumer-impl) microservice:

  1. Define the WF Consumer's Model, as shown here:
      case class WeatherForcasting(city:String, temperature:String) 
 
      object WeatherForcasting { 
        implicit val format: Format[WeatherForcasting] =          Json.format[WeatherForcasting] 
      } 
  1. Define the WF Consumer's command, as follows:
      sealed trait WFCommand [T] extends ReplyType[T] 
 
      case class SaveNewWF(city:String, temperature: String) extends       WFCommand[Done] 
 
      object SaveNewWF { 
        implicit val formatter = Json.format[SaveNewWF] 
      }
  1. Define the WF Consumer's EventTag, as depicted here:
 object WFEventTag { val INSTANCE = AggregateEventTag[WFEvent] ...

Get Scala Reactive Programming 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.