Skip to content

Is using a connection Pool Recommended?Β #157

@coderhs

Description

@coderhs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions