@Override
        public void broadcast(String topic, Object msg) throws SubscriberUnAvailableException {
            List<Subscriber> subscribers;
            if (this.topicSubscribers.containsKey(topic) && !this.topicSubscribers.get(topic).isEmpty()) {
                subscribers = this.topicSubscribers.get(topic);
                for (Subscriber subscriber : subscribers) {
                    subscriber.onMessage(msg);
                }
            } else {
                throw new SubscriberUnAvailableException("Subscriber for topic '" + topic + "' is unavailable");
            }
        }
Subscriber interface to be implemented to subscribe to in-memory broker.
modules/siddhi-core/src/main/java/io/siddhi/core/util/transport/InMemoryBroker.java