Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is using a connection Pool Recommended? #157

Open
coderhs opened this issue Mar 2, 2023 · 0 comments
Open

Is using a connection Pool Recommended? #157

coderhs opened this issue Mar 2, 2023 · 0 comments

Comments

@coderhs
Copy link

coderhs commented Mar 2, 2023

Sorry this is not an issue but a question. If I am wrong to do it here my apologies, kindly point me in the right direction.

I am working with a ruby on rails application, that communicates using MQTT to manage devices. When ever we want to send a message we are pretty much using the below code.

    MQTT::Client.connect(host: ENV['MOSQUITTO_HOST'],
                         port: 1883,
                         username: ENV['MOSQUITTO_USERNAME'],
                         password: ENV['MOSQUITTO_PASSWORD']) do |c|
      c.publish(channel, msg)
    end

So they are connection and then pretty much finishing it, after its done.

I recently started upgrading our app to Rails 6, and found that redis gem recommends using connection pool rather than having a single connection or multiple connection.

Is that recommended for MQTT connections as well? Has anyone done this? and if so how was your experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant