Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    HansM
    @SeppPenner
    @paolofulgoni Only the number of connected clients.
    vhking
    @vhking
    we ended up going with something similar to what @setamodius suggested. It should be sufficient :)
    Kuinox
    @Kuinox
    Hello there ~
    HansM
    @SeppPenner
    Hello :)
    Kuinox
    @Kuinox
    At my job we forked mqttnet, while trying to understand the whole codebase, i will anotate it with comments, you can expect a pull request adding a lot of comments soon.
    Christian
    @chkr1011
    @Kuinox Thanks for your support. What "kind" of comments do you want to add? Hopefully no "Gets or sets the ID". "Publishes a message" ones etc. :smile:
    Kuinox
    @Kuinox

    Hopefully no "Gets or sets the ID"

    I did somes of them when i was working too late in the night :p

    I will do comments on things that are not obvious or i believe is important.

    Christian
    @chkr1011
    That is perfect. Looking forward to your pull request.
    Kuinox
    @Kuinox
    For exemple: MqttTcpChannel constructors have different behavior.
    (I started to read a bit of the codebase, but i had other issues meanwhile)
    To what i can see in this class, calling the constructor with a stream implies that you should not call ConnectAsync later.
    IMO it should be at least document, or better, the constructor should be a Factory Method.
    Kuinox
    @Kuinox
    Is it normal that the CI fail a lot ? https://ci.appveyor.com/project/chkr1011/mqttnet/history
    Paolo Fulgoni
    @paolofulgoni
    @Kuinox just from curiosity, why a fork?
    Kuinox
    @Kuinox
    @paolofulgoni We wan't to use our own logger https://github.com/Invenietis/CK-ActivityMonitor
    One of my coworker will do extensive optimisations with the Spans
    We don't want to support net461 or UWP, we only need netcore.
    Kuinox
    @Kuinox
    ah, i can't edit my bad english here :p
    Christian
    @chkr1011
    @Kuinox This is not normal but we had a failing test which was not immediately fixed and thus some tests were failing. But there is still one tests which may has a race condition and may fails some times.
    Kuinox
    @Kuinox
    @chkr1011 On your AppVeyor i see something like 10-12 tests failing.
    On our AppVeyor CI, we seen one test failing multiple times, and found out the cause.
    It's a race condition that we will fix later.
    t03apt
    @t03apt
    Hi @chkr1011!
    I'd like to integrate the MQTTnet Client library to a project.
    Is there a best practice for how to handle reconnects?
    All I found is this example:
    mqttClient.UseDisconnectedHandler(async e =>
    {
        Console.WriteLine("### DISCONNECTED FROM SERVER ###");
        await Task.Delay(TimeSpan.FromSeconds(5));
    
        try
        {
            await mqttClient.ConnectAsync(options, CancellationToken.None); // Since 3.0.5 with CancellationToken
        }
        catch
        {
            Console.WriteLine("### RECONNECTING FAILED ###");
        }
    });
    Kerem Bilgiçer
    @setamodius
    Hi @t03apt you can use managedclient at MQTTnet.extensions. It handles reconnects.
    Szabolcs Siko
    @sikoszabolcs
    Hi
    Szabolcs Siko
    @sikoszabolcs
    I’m trying to send publish messages with QoS1 I’m seeing quite a bit of latency. So I’m trying to establish if there is something wrong in my code or is it because MQTTnet is always waiting for a PubAck before publishing the next item? I’m assuming that the message ordering guarantees come into play, however should that apply only on a per topic basis? Thanks.
    t03apt
    @t03apt
    @setamodius Thanks!
    Arnt Emmanuel Berge
    @ArntB
    Hi, I have been playing with the mqtt API. I have a mosquitto server. I was using standard MQTTnet and followed the examples. I switched to ManagedMqttClient because it diconnected every second. That didn't help. Stil disconnecting. Have any body experienced the same issues?
    Paolo Fulgoni
    @paolofulgoni
    No, it never happened to me. You could publish a minimal example on GitHub to reproduce your issue
    Paolo Fulgoni
    @paolofulgoni
    Hi everyone, I'm making some experiments with Blazor and MQTTnet and created a project for fun
    https://github.com/paolofulgoni/MQTTrace
    I must say that my main purpose is to learn Blazor a little bit.
    If anyone is interested, help is welcome!
    Beware: the project is really incomplete!!!
    Arnt Emmanuel Berge
    @ArntB
    I figured out what my problem was. I hade two clients with the same ClientId causing mosquitto to disconnect the clients.
    t03apt
    @t03apt
    @chkr1011, I'd like to use ManagedMqttClient with persisted sessions. I see that this PR has been merged already. Unfortunately 3.0.9-rc1 does not have it. Could you please publish an rc2 package?
    Christian
    @chkr1011
    Version 3.0.9-rc2 is now released.
    HansM
    @SeppPenner
    Version 3.0.9 is released. Just for information :)
    dF
    @mrNo0b
    Hello!
    is it possible to set TcpServer address in MqttClientOptions instead of MqttClientOptionsBuilder?
    Fichtelcoder
    @FrankenApps
    Hi, is it possible to set Username and Password on the Broker, to only allow connections with authentication?
    HansM
    @SeppPenner
    @FrankenApps Take a look at https://github.com/chkr1011/MQTTnet/wiki/Examples, please. There you can find some of my examples that contain authentication.

    @mrNo0b You can set the following options:

            public string ClientId { get; set; } = Guid.NewGuid().ToString("N");
            public bool CleanSession { get; set; } = true;
            public IMqttClientCredentials Credentials { get; set; }
            public IMqttExtendedAuthenticationExchangeHandler ExtendedAuthenticationExchangeHandler { get; set; }
            public MqttProtocolVersion ProtocolVersion { get; set; } = MqttProtocolVersion.V311;
            public IMqttClientChannelOptions ChannelOptions { get; set; }
            public TimeSpan CommunicationTimeout { get; set; } = TimeSpan.FromSeconds(10);
            public TimeSpan KeepAlivePeriod { get; set; } = TimeSpan.FromSeconds(15);
            public MqttApplicationMessage WillMessage { get; set; }
            public uint? WillDelayInterval { get; set; }
            public string AuthenticationMethod { get; set; }
            public byte[] AuthenticationData { get; set; }
            public uint? MaximumPacketSize { get; set; }
            public ushort? ReceiveMaximum { get; set; }
            public bool? RequestProblemInformation { get; set; }
            public bool? RequestResponseInformation { get; set; }
            public uint? SessionExpiryInterval { get; set; }
            public ushort? TopicAliasMaximum { get; set; }
            public List<MqttUserProperty> UserProperties { get; set; }

    So, I would say no, that's not possible.

    Fichtelcoder
    @FrankenApps

    Well, I used this

    serverOptions = new MqttServerOptionsBuilder()
                        .WithDefaultEndpoint()
                        .WithDefaultEndpointPort(mqttServer.Port)
                        .WithConnectionValidator(c =>
                        {
                            foreach (MqttUser user in mqttServer.Users)
                            {
                                if (user.Username == c.Username && user.Password == c.Password)
                                {
                                    c.ReasonCode = MqttConnectReasonCode.Success;
                                    return;
                                }
                            }
                            c.ReasonCode = MqttConnectReasonCode.BadUserNameOrPassword;
                        })
                        .WithSubscriptionInterceptor(c =>
                        {
                            c.AcceptSubscription = true;
                        })
                        .WithApplicationMessageInterceptor(c =>
                        {
                            c.AcceptPublish = true;
                        })
                        .Build();

    and it seems to work for me...
    However I honestly do not know if it is secure in any way, but it is fine for my use case.

    HansM
    @SeppPenner
    @FrankenApps If you don't mind that every user can read every topic, this should be fine :)
    deveshspraxa
    @deveshspraxa
    Anybody can help in getting client list on server on new version earlier i was able to get using GetClientSessionsStatus
    Fichtelcoder
    @FrankenApps
    https://github.com/FrankenApps/MqttDebugger
    Made a little Cross-Platform GUI in case anyone is interested. It still lacks a lot of features, but it could basically be viewed as a replacement of Arduino's Serial Monitor via MQTT.
    artistmonkey
    @artistmonkey
    Hi everyone, I'm using MqttNet in core 3.1 mvc and connect over 1000 clients and each publish around 200bytes of 7 messages every second. In MVC web, I'm using paho javascript to subscribe some topic and there was delay over and over. At first there is only 2/3 seconds and later go up to several minutes. Is there any way to set up the mqtt broker to send subscriber the last message and dump the old messages. I'd tested WithMaxPendingMessagesPerClient(3) and seem not working at all.
    amitdaalwal
    @amitdaalwal
    Hi i got docker compose with mosquitto broker, mosquitto exporter connected to grafana , prometheus. When i run docker compose up i can see by default one client is connected and some sample data is displayed in dashboard for mosquitto clients. Usually for two or three clients i login to docker mosquitto broker container and do mosquitto_subscribe to the topic manually. How to subscribe to multiple 100 clients in docker mosquitto broker. All my hubs/ clients are already publishing to the topic and mosqitto broker. If i dont subscribe to the data i dont have data in mosquittodb?. Usually a nodejs or other services consumes the topics. But as of now i dont have the setup i am looking for monitoring side. Any suggestions.
    amitdaalwal
    @amitdaalwal
    in my terminal i run for one client as mosquitto_sub -t topic -h ipaddress and then i get live data on my terminal for this one client. i am looking for one subscriber to subscribe to all 100 clients at one go. not using any application consuming it
    sander1116
    @sander1116
    Hello, can someone help me with intergration?
    victornor
    @victornor
    Has anyone been able to use the managed client within Blazor?
    I'm able to successfully subscribe and receive messages, but publishing is only possible immediately after the connection is established.
    If i attempt to send a message a few seconds later, i'm getting a success result, but the message is never actuallypublished.
    I am however able to keep receiving messages...
    The exact same setup works flawlessly from a console app.
    ChaoW86215
    @ChaoW86215
    Hi, I have a question for MQTTnet
    I use MQTTnet to do a MQTT Server, I want to Listen for heartbeats
    How can I do it?
    ??
    khaledbadiy
    @khaledbadiy
    @FrankenApps @paolofulgoni hi i wish you are fine i just want ask about the MQTTlinked with blazor if i can send and receive a message using mosquito so i can connect Node RED
    Panos Athanasiou
    @panoukos41
    Hey all, how would one get the list of connected clients from aspnetcore hosted server?
    Yarek T
    @YarekTyshchenko
    In Integration tests we use a port 0 to get it to automatically pick the next free port, but due to the socket being hidden behind several layers of abstractions, there's no way to get to it. ((IPEndPoint)_socket.LocalEndPoint).Port How would I go about this?
    fog
    @fogzot:matrix.org
    [m]
    Hi, I have what I hope is a simple question. I have a bug that can be explained by the library calling into the various interceptors multiple times in parallel. I always supposed that the interceptors return Task and library awaits for them to finish before going on processing connections and messages, but it does not seem to be case. So, how is this supposed to work? Can, for example, the connection validator be called a second time while still validating a previous connection?
    (obviously my interceptors are async and make use of await)