O'Reilly logo

Scala Reactive Programming by Rambabu Posa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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]() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required