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

unable to establish QoS1 sessions #141

Open
dmitrym0 opened this issue Feb 24, 2022 · 0 comments
Open

unable to establish QoS1 sessions #141

dmitrym0 opened this issue Feb 24, 2022 · 0 comments

Comments

@dmitrym0
Copy link

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.

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