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 – 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] ...

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