I have RoR based web application that pushes notifications to a message queue.
Users get notified with the help of AutobahnJS(PubSub), connected to an AutobahnPython backend.
The notifications are being dequeued by my ApplicationSession and published to everyone
My problem is selective publishing.
WAMP contains eligible and exclude in the protocol to publish by WAMP session IDs.
But what I want is to publish to my users by their user IDs(stored in my database).
I’ve managed to implement my WampWebSocketServerProtocol and modify onConnect to authenticate the user(by his Rails session cookie) and store his ID in the protocol object.
I’ve not sure how to proceed from here, do I need to hack the publish method in the broker, or maybe the router is more relevent?
From what I’ve read routers should not contain application specific code, so I’m kinda confused.
It’s worth mentioning I’m currently using a modified version of ApplicationRunner to host my ApplicationSession with my modified server protocol.
I’m read about Crossbar.io and I’m considering using it, can it assist me in this case?