Custom Upstream Discovery

You can implement your own Upstream Service Discovery mechanism. Write an actor class, make it available on the class path, and set the config to the fully qualified class name.

// Domain Object
{
  // The fully qualified class name of the actor to load
  upstream-watcher: "org.example.CustomUpstreamWatcherActor"
}

The class to be loaded must implement shield.actors.config.upstream.UpstreamWatcher, and have a constructor that takes one parameter of type com.typesafe.config.Config which will be the parsed Domain Object.

trait UpstreamWatcher { self: Actor =>
  val settings = Settings(context.system)
}

To send an updated list of upstream services to Shield, the actor must send a shield.actors.config.UpstreamAggregatorMsgs.DiscoveredUpstreams message to its parent actor.

case class DiscoveredUpstreams(services: Map[ServiceLocation, ServiceDetails])