I have an Akka ActorEventBus
(reference https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/event/EventBus.scala#L70) that handles a lot of messages being passed around to different actors.
I've set up an Actor to subscribe to this Bus:
/**
* special actor that transports messages to the hive
*/
val hiveTalk = {
val subscriber = actorSystem.actorOf(Props(new HiveTransport))
Bus.subscribe( subscriber, "/app/browser/" )
Bus.subscribe( subscriber, "/app/mobile/" )
}
The MessageBus
class which is an implementation of the ActorEventBus
looks like the following:
/**
* message bus to route messages to their appropriate contexts
*/
class MessageBus extends ActorEventBus with LookupClassification {
type Event = MessageEvent
type Classifier = String
protected def mapSize(): Int = {
10
}
protected def classify(event: Event): Classifier = {
event.channel
}
protected def publish(event: Event, subscriber: Subscriber): Unit = {
subscriber ! event
}
}
The Problem
For some reason, messages sent to sub-channels that look like /app/browser/26
aren't being received by the hiveTalk
actor-subscriber.
Any ideas why?