Websocket: [question] Help me choosing between Gorilla / RabbitMQ

Created on 29 Jul 2019  Â·  8Comments  Â·  Source: gorilla/websocket

Hi all,

I was searching for a solution that helps me implementing websockets on my project ... first I was thinking to use RabbitMQ but unfortunately not supporting do not pass autobahn test, sincerely I already integrated to my project a random one just to get some works done and not stucking on this.

Now that I have to get the better solution that feet my need, by the way my need is the PubSub system only ... I have to choose the fastest and low latency solution ... making a search on Google, I found out that you can handle 1Millions requests / second with only 1Go of RAM !

So I am really interested to know more about you and especially if using your solution will give better result than RabbitMQ ?

Another question, do Gorilla support multi threading ?

Thank you in advance for your help.

question

All 8 comments

Hi there -

It’s probably worth clarifying a few points:

• WebSockets are a protocol for streaming small messages over HTTP, but
provide no inherent “PubSub” capabilities. Buffering messages for clients,
replication, resending, authentication, fanning out to multiple subscribers

  • that’s on you to implement on top.

• RabbitMQ is a message bus designed for persisting and sending events
between systems. A lot of the application-level semantics (authentication,
replication, etc) are built-in, with the caveat that it doesn’t work in a
browser environment (which is why WebSockets exist). RabbitMQ does not pass
the autobahn tests as those tests are for validating standards support of
WebSockets.

What are you trying to build? Are your clients browser-based, IoT devices,
or ?

On Sun, Jul 28, 2019 at 7:43 PM bcashier notifications@github.com wrote:

Hi all,

I was searching for a solution that helps me implementing websockets on my
project ... first I was thinking to use RabbitMQ but unfortunately not
supporting do not pass autobahn test, sincerely I already integrated to my
project a random one just to get some works done and not stucking on this.

Now that I have to get the better solution that feet my need, by the way
my need is the PubSub system only ... I have to choose the fastest and low
latency solution ... making a search on Google, I found out that you can
handle 1Millions requests / second with only 1Go of RAM !

So I am really interested to know more about you and especially if using
your solution will give better result than RabbitMQ ?

Thank you in advance for your help.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/gorilla/websocket/issues/527?email_source=notifications&email_token=AAAEQ4DP2S6HEKJXTSHLDZ3QBZKOFA5CNFSM4IHOGJW2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HB57G7Q,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAEQ4BF2VIQOVII7EFKKQ3QBZKOFANCNFSM4IHOGJWQ
.

@elithrar Hi sir ! And thanks for your answer :)

My clients are browser based.

Clients subscribe to a specific topic from browser side using autobahn (javascript).

And publish message from the server to notify them about new changes, update datas on browser etc.

Waiting your answer and thanks in advance :)

If your clients are browser-based, then you can’t (easily) use RabbitMQ.

WebSockets will give you a path to streaming data between clients and
server, but the concepts of “topics”, changes, data schema, etc - is up to
you.

The other option would be to use a cloud provider service like GCP’s PubSub
or AWS Kinesis.

On Mon, Jul 29, 2019 at 11:27 AM bcashier notifications@github.com wrote:

@elithrar https://github.com/elithrar Hi sir ! And thanks for your
answer :)

My clients are browser based.

Clients subscribe to a specific topic from browser side using autobahn
(javascript).

And publish message from the server to notify them about new changes,
update datas on browser etc.

Waiting your answer and thanks in advance :)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/gorilla/websocket/issues/527?email_source=notifications&email_token=AAAEQ4F56X642OVBQ4ESQDDQB4ZBRA5CNFSM4IHOGJW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3BTBMY#issuecomment-516108467,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAEQ4FWIR3AUJP33VFCHL3QB4ZBRANCNFSM4IHOGJWQ
.

@elithrar

Is it possible to implement the concept of Publish / Subscribe to a TOPIC using Gorilla ?

If yes, do you have an example of code already done on this way ?

Thank you :)

Take a look at the chat example -
https://github.com/gorilla/websocket/tree/master/examples/chat - noting
that the concepts of rooms (topics, in your case) is up to you to implement.

On Mon, Jul 29, 2019 at 1:12 PM bcashier notifications@github.com wrote:

@elithrar https://github.com/elithrar

Is it possible to implement the concept of Publish / Subscribe to a TOPIC
using Gorilla ?

If yes, do you have an example of code already done on this way ?

Thank you :)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/gorilla/websocket/issues/527?email_source=notifications&email_token=AAAEQ4EBKCI2IXCJOFGJCPLQB5FJNA5CNFSM4IHOGJW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3B3XBQ#issuecomment-516144006,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAEQ4AIXUEMDIQTLCPZQB3QB5FJNANCNFSM4IHOGJWQ
.

@elithrar Do the performances will be same even while using rooms ?

I can't answer that - that's up to you to manage.

My recommendation is that you think about what you need to build first, and
what kind of scale it needs to achieve BEFORE focusing on performance
numbers. It sounds like you have a bit of learning to do (which is OK!)
around message queues & WebSockets before worrying about 1M+ clients.

On Mon, Jul 29, 2019 at 4:51 PM bcashier notifications@github.com wrote:

@elithrar https://github.com/elithrar Do the performances will be same
even while using rooms ?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/gorilla/websocket/issues/527?email_source=notifications&email_token=AAAEQ4DJE7MJU5QP3UGT5V3QB566ZA5CNFSM4IHOGJW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3CKPKI#issuecomment-516204457,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAEQ4CLQSE62KTKB2PPXFLQB566ZANCNFSM4IHOGJWQ
.

@elithrar Thank you for your answer :)

You are right about my knowledge on WebSockets, it's really limited ... Sincerely, I learned only what is needed for my project without taking in count the a close eye on how it works and even the basics.

My project need the concept of rooms since some details must be transmitted to a specific users after logged in (Sensitive informations) ... but others can be public and shared for the whole users/visitors.

My recommendation is that you think about what you need to build first

I already used to finish the project but with poor performances, so I am looking to switch to a better languages with low latency and especially choosing the best solutions that works + gives better performances than the existing one, and especially question of scalability.

worrying about 1M+ clients.

Worrying about +1M websockets sent per second is my goal actually and is the top priority before starting programming on it for a second time ... each day I am spending higher part of my time to gather the best existing open source technologies and building schema for a best combination of all modules etc.

Anyway many thanks for taking time to answer my question, appreciated.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fbens picture fbens  Â·  3Comments

prsolucoes picture prsolucoes  Â·  11Comments

weiyixuan picture weiyixuan  Â·  4Comments

melnikalex picture melnikalex  Â·  7Comments

lexansoft picture lexansoft  Â·  4Comments