I have set a endpoint and a route on service bus with this criteria in query:
$body.Temperature.AlarmPrius = 1
where the format of message I set is like
public async void InvioDati(ProbDATA msgRicevuto)
{
var messageString = JsonConvert.SerializeObject(msgRicevuto);
var message = new Message(Encoding.UTF8.GetBytes(messageString));
message.ContentType = "application/json";
message.ContentEncoding = "utf-8";
await dispositivo.SendEventAsync(message);
}
}
ProbDATA is set as:
public class ProbDATA
{
public int ID { get; set; }
public int Funzione { get; set; }
/******/
public int Registro_1 { get; set; }
/******/
public int Registro_2 { get; set; }
/******/
public int Registro_3 { get; set; }
/******/
public int Alarm_123 { get; set; }
/******/
public int Registro_4 { get; set; }
/******/
public int Alarm_4 { get; set; }
/******/
public DateTime _TimeStamp { get; set; }
/******/
public override string ToString()
{
return $"Temperature ::ID {ID.ToString()}, Funzione {Funzione.ToString()}, Registro_1 {Registro_1.ToString()}, Registro_2 {Registro_2.ToString()}, Registro_3 {Registro_3.ToString()}, AlarmPrius {Alarm_123.ToString()}, Registro_4 {Registro_4.ToString()}, Alarm_4 {Alarm_4.ToString()}, _TimeStamp {_TimeStamp.ToString("yyyy-MM-dd HH:mm:ss")}";
}
}
but no message enters the service bus queue... I'm aware of other topics similar to mine (I use MQTT connection) and they suggest, like here, to use devices/{yourDeviceId}/messages/events/$.ct=application%2Fjson&$.ce=utf-8
but how can I implement this? any example?