WF Reactive System – Producer implementation

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

  1. Create the Producer command(s), as shown here:
      sealed trait WFCommand[R] extends ReplyType[R] 
 
      case class UseWFMessage(city: String, temperature: String)       extends WFCommand[Done] 
 
      object UseWFMessage { 
        implicit val format: Format[UseWFMessage] =         Json.format[UseWFMessage] 
      } 
 
      case class WF(city: String, temperature: String) extends       WFCommand[String] 
 
      object WF { 
        implicit val format: Format[WF] = Json.format[WF] 
      }
  1. Define an EventTag for our System Element(s), as follows:
      object WFEventTag { 
        val instance: AggregateEventTag[WFEvent] = 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.