You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
I understand that each Function needs it's own connection to the MQTT-broker. But is there a way to reuse the same connection string?
I have a need for at least three functions subscribing to the same MQTT-broker, listening for different topics. It seems redundant to have to declare three identical connection strings just to make them understand that they need a new connection...
[FunctionName("TestReceiver")]
public static void TestReceiver([MqttTrigger("test/#")]IMqttMessage message, ILogger log)
{
log.LogInformation("TestReceiver function triggered!");
var body = message.GetMessage();
var bodyString = Encoding.UTF8.GetString(body);
log.LogInformation($"TestReceiver, topic {message.Topic}: {bodyString}");
}
[FunctionName("TestDeviceReceiver")]
public static void TestDeviceReceiver([MqttTrigger("device/#")] IMqttMessage message, ILogger log)
{
log.LogInformation("TestDeviceReceiver function triggered!");
var body = message.GetMessage();
var bodyString = Encoding.UTF8.GetString(body);
log.LogInformation($"TestDeviceReceiver, topic {message.Topic}: {bodyString}");
}
The text was updated successfully, but these errors were encountered:
Hey,
I understand that each Function needs it's own connection to the MQTT-broker. But is there a way to reuse the same connection string?
I have a need for at least three functions subscribing to the same MQTT-broker, listening for different topics. It seems redundant to have to declare three identical connection strings just to make them understand that they need a new connection...
The text was updated successfully, but these errors were encountered: