You can implement your own listener builder. Write an actor class, make it available on the class path, and set the config to the fully qualified class name.
The class to be loaded must implement shield.actors.config.listener.ListenerBuilder
, and have a constructor that takes
two parameters:
id: String
- The id of the listener to be builtsettings: shield.config.DomainSettings
- The domain settings, which provides access to the settings for the listener to be builtTo register the listener with Shield, the builder actor must send a shield.actors.config.ConfigWatcherMsgs.ListenerUpdated
message to its parent actor. It can do this multiple times if it wants to change actors used by Shield. If you’re swapping
actors, you should wait for Spray’s global request timeout to elapse before killing the old listener actor, to allow any
in flight requests to be drained.
The actor that gets registered as a listener will receive shield.actors.RequestProcessorCompleted
messages. It is
then free to whatever it wants.