我试图为N Servicebus创立一个javascript活动用户,我想知道,我的想法是否有效,这一设计是否有共同的陷阱。
I m purposing the following components:
ASP. NET MVC BusController(ASyncController)
- receives subscriptions from the javaster客户s and returns some sort of sessionId for the client to use in further communication.
- async ActionMethod Receive which will return a json serialized EventMessage.
- has a generic messagehandler, which will filter and queue up events for clients who subscribed for it.
javaster客户
- can subscribe to 1 or more events using the subscribe action method of the BusController
- can Receive events by long-polling the Receive method of the BusController with the received sessionId.
有几个问题:
- How to detect when a client disconnects?
- I ve thought about a simple timout system, which tells the client to re-initiate the connection with the Receive Action Method
- I m worried about the performance of a generic messagehandler in the buscontroller, handling all messages in my system. Has anyone else had experience with this?