Skip to content

unable to establish QoS1 sessions #141

@dmitrym0

Description

@dmitrym0

Hey folks,

I'm trying to establish a non clean session on my "subscriber", but it doesn't seem to work. I've verified that QoS1 is on the publisher by using mosquito_sub tools. This is how I spin up my consumer:

#!ruby
require 'rubygems'
require 'mqtt'

# Subscribe example
c = MQTT::Client.connect(
  :host => 'localhost',
  :port => 1883,
  :ssl => false,
  :username => 'user',
  :password => 'password',
  :clean_session => false,
  :client_id => "consumer",
)
  puts c.clean_session
  puts c.client_id

  c.get('test') do |topic,message|
    puts "Recv: #{topic}: #{message}"
  end

If I use the above script to connect, then disconnect, the messages generated in the interim are lost.

If I use

mosquitto_sub -i subscriber -t test -h localhost -v -d -c -q 1

then I get queued up messages delivered.

I also tried this with paho.mqqt.ruby, and that works fine as well.

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