Using EventBus for Chat Server

73 views
Skip to first unread message

PrimeSoftware

unread,
Jun 19, 2017, 9:37:37 PM6/19/17
to vert.x
Hi all,
I am planning on developing a chat server to interface with my MyBB forum. As such I plan to use the JDBC / Vertx business in the server to authenticate thus allowing only registered uses into the chat. The issue I am concerned about though is limiting how many users can enter the chat. I don't want 1,000,000 users in the chat slowing my server to a halt. Is there a way using the event bus configuration to limit how many client can subscribe to event bus? I know the event bus uses TCP under the hood, but I didn't see any options for limiting the number of folks that can connect to the server. Even if it is event driven (i.e. to persistent connection), having the server dole out 1,000,000 messages every time someone sends a "lol" to the server seems like asking for trouble to me.

Thanks!

Julien Viet

unread,
Jun 20, 2017, 2:28:06 AM6/20/17
to ve...@googlegroups.com
Hi,

you cannot limit the number of subscribers to the bus, however you can use the sockjs bridge events to achieve this result, this is explained here http://vertx.io/docs/vertx-web/java/#_handling_event_bus_bridge_events

using this you can maintain a counter of active registrations and reject above a threshold.

Julien

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/5ad8c36b-3af3-47f1-9e83-06bc1eb88572%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages