AtherEnergy / rumqtt

Pure rust mqtt cilent
The Unlicense
202 stars 71 forks source link

Unable to receive messages #114

Closed manifest closed 5 years ago

manifest commented 5 years ago

I've written a simple application using rumqtt creating a subscription on a topic, then I used mosquitto client to publish a message to the same topic. The message was delivered to another mosquitto client, but I've got nothing in my application.

fn main() {
    let mqtt_options = MqttOptions::new("test-id", "127.0.0.1", 1883).set_keep_alive(30);
    let (mut tx, rx) = MqttClient::start(mqtt_options).unwrap();
    tx.subscribe("foo", QoS::AtLeastOnce).unwrap();

    for message in rx {
        println!("{:?}", message)
    }
}
$ brew services start mosquitto
$ mosquitto_sub -t 'foo'
bar
$ mosquitto_pub -t 'foo' -m 'bar'

rumqtt version: master branch (a67c3ab7b36a29afb6252746c62088bbc3d0b7ae) OS: macOS Mojave

tekjar commented 5 years ago

@manifest Thanks for the report :). I fixed it. Can you pull and retry?

manifest commented 5 years ago

@tekjar I still receive no messages as for fa98d02f72b8806e974b1cc974ca0511023b8929.

tekjar commented 5 years ago

@manifest Can you clean build. I copied your example and it seems to be working for me

manifest commented 5 years ago

@tekjar I cleaned before running the example yesterday. Did you try sending message from mosquitto client (or any other external), since sending it from the same application seem to work (as in tests).

tekjar commented 5 years ago

Did you do cargo update? Is your code hosted in github? I tried publishing with mosquito_pub and I'm receiving the messages after the fix

manifest commented 5 years ago

My fault. I mistakenly thought that cargo will get a new version of dependency if it's specified by its commit hash, after performing cargo clean. Thanks!