Service Bus Route Query











up vote
0
down vote

favorite












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?



Route










share|improve this question






















  • $body.Temperature.AlarmPrius doesn't match with your class ProbDATA. Try to use $body.Alarm_123 = 1
    – Roman Kiss
    Nov 12 at 12:10










  • update the Test/Message body with your body such as ProbDATA for testing purpose (Test route button).
    – Roman Kiss
    Nov 12 at 12:19












  • Hi Roman, what you have suggested has already been tried and still the issue is present, also there is a bug where the "1" in Alarm_123 enters in conflict with the 1 assigned number. That's why I renominated it AlarmPrius anyway I'll try futher tests
    – Lemon Pies
    Nov 12 at 13:11










  • I have just tested your payload ProbDATA and query $body.Alarm_123 = 1 and it's working well.
    – Roman Kiss
    Nov 12 at 13:44






  • 1




    for test purpose: set the query to true so, every message should be routed to your service bus queue. Also, add one more route for forwarding all messages (query is true) to the built-in endpoint (events) to see on the DeviceExplorer tool. Use also the Service Bus Explorer tool.
    – Roman Kiss
    Nov 12 at 14:25

















up vote
0
down vote

favorite












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?



Route










share|improve this question






















  • $body.Temperature.AlarmPrius doesn't match with your class ProbDATA. Try to use $body.Alarm_123 = 1
    – Roman Kiss
    Nov 12 at 12:10










  • update the Test/Message body with your body such as ProbDATA for testing purpose (Test route button).
    – Roman Kiss
    Nov 12 at 12:19












  • Hi Roman, what you have suggested has already been tried and still the issue is present, also there is a bug where the "1" in Alarm_123 enters in conflict with the 1 assigned number. That's why I renominated it AlarmPrius anyway I'll try futher tests
    – Lemon Pies
    Nov 12 at 13:11










  • I have just tested your payload ProbDATA and query $body.Alarm_123 = 1 and it's working well.
    – Roman Kiss
    Nov 12 at 13:44






  • 1




    for test purpose: set the query to true so, every message should be routed to your service bus queue. Also, add one more route for forwarding all messages (query is true) to the built-in endpoint (events) to see on the DeviceExplorer tool. Use also the Service Bus Explorer tool.
    – Roman Kiss
    Nov 12 at 14:25















up vote
0
down vote

favorite









up vote
0
down vote

favorite











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?



Route










share|improve this question













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?



Route







azure-iot-hub azure-servicebus-queues azure-queues






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 at 11:23









Lemon Pies

406




406












  • $body.Temperature.AlarmPrius doesn't match with your class ProbDATA. Try to use $body.Alarm_123 = 1
    – Roman Kiss
    Nov 12 at 12:10










  • update the Test/Message body with your body such as ProbDATA for testing purpose (Test route button).
    – Roman Kiss
    Nov 12 at 12:19












  • Hi Roman, what you have suggested has already been tried and still the issue is present, also there is a bug where the "1" in Alarm_123 enters in conflict with the 1 assigned number. That's why I renominated it AlarmPrius anyway I'll try futher tests
    – Lemon Pies
    Nov 12 at 13:11










  • I have just tested your payload ProbDATA and query $body.Alarm_123 = 1 and it's working well.
    – Roman Kiss
    Nov 12 at 13:44






  • 1




    for test purpose: set the query to true so, every message should be routed to your service bus queue. Also, add one more route for forwarding all messages (query is true) to the built-in endpoint (events) to see on the DeviceExplorer tool. Use also the Service Bus Explorer tool.
    – Roman Kiss
    Nov 12 at 14:25




















  • $body.Temperature.AlarmPrius doesn't match with your class ProbDATA. Try to use $body.Alarm_123 = 1
    – Roman Kiss
    Nov 12 at 12:10










  • update the Test/Message body with your body such as ProbDATA for testing purpose (Test route button).
    – Roman Kiss
    Nov 12 at 12:19












  • Hi Roman, what you have suggested has already been tried and still the issue is present, also there is a bug where the "1" in Alarm_123 enters in conflict with the 1 assigned number. That's why I renominated it AlarmPrius anyway I'll try futher tests
    – Lemon Pies
    Nov 12 at 13:11










  • I have just tested your payload ProbDATA and query $body.Alarm_123 = 1 and it's working well.
    – Roman Kiss
    Nov 12 at 13:44






  • 1




    for test purpose: set the query to true so, every message should be routed to your service bus queue. Also, add one more route for forwarding all messages (query is true) to the built-in endpoint (events) to see on the DeviceExplorer tool. Use also the Service Bus Explorer tool.
    – Roman Kiss
    Nov 12 at 14:25


















$body.Temperature.AlarmPrius doesn't match with your class ProbDATA. Try to use $body.Alarm_123 = 1
– Roman Kiss
Nov 12 at 12:10




$body.Temperature.AlarmPrius doesn't match with your class ProbDATA. Try to use $body.Alarm_123 = 1
– Roman Kiss
Nov 12 at 12:10












update the Test/Message body with your body such as ProbDATA for testing purpose (Test route button).
– Roman Kiss
Nov 12 at 12:19






update the Test/Message body with your body such as ProbDATA for testing purpose (Test route button).
– Roman Kiss
Nov 12 at 12:19














Hi Roman, what you have suggested has already been tried and still the issue is present, also there is a bug where the "1" in Alarm_123 enters in conflict with the 1 assigned number. That's why I renominated it AlarmPrius anyway I'll try futher tests
– Lemon Pies
Nov 12 at 13:11




Hi Roman, what you have suggested has already been tried and still the issue is present, also there is a bug where the "1" in Alarm_123 enters in conflict with the 1 assigned number. That's why I renominated it AlarmPrius anyway I'll try futher tests
– Lemon Pies
Nov 12 at 13:11












I have just tested your payload ProbDATA and query $body.Alarm_123 = 1 and it's working well.
– Roman Kiss
Nov 12 at 13:44




I have just tested your payload ProbDATA and query $body.Alarm_123 = 1 and it's working well.
– Roman Kiss
Nov 12 at 13:44




1




1




for test purpose: set the query to true so, every message should be routed to your service bus queue. Also, add one more route for forwarding all messages (query is true) to the built-in endpoint (events) to see on the DeviceExplorer tool. Use also the Service Bus Explorer tool.
– Roman Kiss
Nov 12 at 14:25






for test purpose: set the query to true so, every message should be routed to your service bus queue. Also, add one more route for forwarding all messages (query is true) to the built-in endpoint (events) to see on the DeviceExplorer tool. Use also the Service Bus Explorer tool.
– Roman Kiss
Nov 12 at 14:25














1 Answer
1






active

oldest

votes

















up vote
0
down vote













Thanks to @roman Kiss I solved the issue, wich was a wrong written query.



correct one was query $body.Alarm_123 = 1. thanks again!






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53261134%2fservice-bus-route-query%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Thanks to @roman Kiss I solved the issue, wich was a wrong written query.



    correct one was query $body.Alarm_123 = 1. thanks again!






    share|improve this answer

























      up vote
      0
      down vote













      Thanks to @roman Kiss I solved the issue, wich was a wrong written query.



      correct one was query $body.Alarm_123 = 1. thanks again!






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        Thanks to @roman Kiss I solved the issue, wich was a wrong written query.



        correct one was query $body.Alarm_123 = 1. thanks again!






        share|improve this answer












        Thanks to @roman Kiss I solved the issue, wich was a wrong written query.



        correct one was query $body.Alarm_123 = 1. thanks again!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 20 at 15:26









        Lemon Pies

        406




        406






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53261134%2fservice-bus-route-query%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to pass form data using jquery Ajax to insert data in database?

            National Museum of Racing and Hall of Fame

            Guess what letter conforming each word