---
title: "Comment by Bigberm on \"Basic MQTT broker with C#\" | Hashnode"
description: "Hi, Sorry I want to know about this solution. 1) How to set username/password for c# MQTT Broker? 2) How to set retaining lastest published message on Broker fr"
url: "https://hashnode.com/posts/basic-mqtt-broker-with-c-sharp/61eb28425fbc177f9f3b3595/comment/62d230752f551b044bc1633b"
---

[Discussion](https://hashnode.com/posts/basic-mqtt-broker-with-c-sharp/61eb28425fbc177f9f3b3595)

Comment [Basic MQTT broker with C#](https://hashnode.com/posts/basic-mqtt-broker-with-c-sharp/61eb28425fbc177f9f3b3595)

[Bigberm](https://hashnode.com/@bigberm)

[Jul 16, 2022](https://hashnode.com/posts/basic-mqtt-broker-with-c-sharp/61eb28425fbc177f9f3b3595/comment/62d230752f551b044bc1633b)

Hi,

Sorry I want to know about this solution. 1) How to set username/password for c# MQTT Broker? 2) How to set retaining lastest published message on Broker from client's published message?

Thank you, Bigberm

[behrooz bozorgchamy](https://hashnode.com/@behroozbc)

[Jul 16, 2022](https://hashnode.com/posts/basic-mqtt-broker-with-c-sharp/61eb28425fbc177f9f3b3595/comment/62d230752f551b044bc1633b#reply-62d256de2f551b044bc16833)

Hi,

1) I am writing an article about it.

2) you can publish message with `MqttApplicationMessage` like

```
var message = new MqttApplicationMessage()
    {
        Topic = "",
        Payload = Encoding.UTF8.GetBytes("gg"),
        Retain = true
    };
```

[Bigberm](https://hashnode.com/@bigberm)

[Jul 17, 2022](https://hashnode.com/posts/basic-mqtt-broker-with-c-sharp/61eb28425fbc177f9f3b3595/comment/62d230752f551b044bc1633b#reply-62d394d1e52a5d129a0c1fcc)

[behrooz bozorg chami](https://hashnode.com/@behroozbc)

> 1) I am writing an article about it. Thank you and waiting for this article topic "How to set username/password for c# MQTT Broker".
