Service for handling pubsub pattern with dependecy injection