Android Question Is something like SyncLock necessary/ available in B4A

Discussion in 'Android Questions' started by RJB, Aug 13, 2019.

  1. RJB

    RJB Active Member Licensed User

  2. Peter Simpson

    Peter Simpson Expert Licensed User

    Hey @RJB,
    If you are using MQTT have you looked at using MQTT.QOS_2_EXACTLY_ONCE or better still MQTT.QOS_2_EXACTLY_ONCE?

    Multiple messages, where are these multiple messaging coming from, 1 device or more than 1 device???
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    No. Your code always run on the main thread. Message will arrive one after another.
     
  4. RJB

    RJB Active Member Licensed User

    Hi @Peter Simpson. I haven't look at it yet, Erel has just suggested that I do so in another thread.
    The messages will come from multiple 8266's at about 10 second intervals from each. I don't know what "MQTT.QOS_2_EXACTLY_ONCE or better still MQTT.QOS_2_EXACTLY_ONCE" are (I can't actually see the difference between the two?).
    @Erel, Probably best if I take a look at MQTT or MQTT.QOS_2_EXACTLY_ONCE, etc. so that I understand exactly how it works, thanks.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    You always seem to be ignoring my answers. You don't need to do anything special.
    I will write it again:

    No. Your code always run on the main thread. Messages will arrive one after another.
     
    Peter Simpson and DonManfred like this.
  6. Peter Simpson

    Peter Simpson Expert Licensed User

    @RJB,
    You should really try to read and understanding what Erel is saying, if you don't quite under his (or anyone else's) answers then just ask a followup question.

    Google as well as Bind are great services and guess what, they are 100% free to use as a normal user https://assetwolf.com/learn/mqtt-qos-understanding-quality-of-service.

    If a forum member has already answered your question in another thread, then you posting the same question (or a variant of it) in a new post really is just wasting your own time as you might just get the same answer again...
     
  7. RJB

    RJB Active Member Licensed User

    I'm sorry but I just said that I would read up on MQTT. I didn't say that I did didn't understand or believe the answer - just that I didn't know anything about MQTT and needed to read up on it! I think it's only fair that I do that before asking follow up questions that could be avoided by me doing some reading, don't you?

    Peter, thanks for the information, presumably you meant "QOS Level 1 - at least once or better still QOS Level 2 - exactly once" rather than "MQTT.QOS_2_EXACTLY_ONCE or better still MQTT.QOS_2_EXACTLY_ONCE" in #2.

    I wasn't aware anybody else had asked that question, If they have then I apologise for the duplication.
     
  8. RJB

    RJB Active Member Licensed User

    Just in case anybody reads this and is considering using B4R and MQTT for an App that requires reliable communication:
    Please read: https://www.b4x.com/android/forum/threads/mqtt-qos-and-errors.108862/ , it may save you wasted effort.
    B4R only allows publish as QOS 0, hence the comments above about QOS 1/2 are misleading and anything published by the B4R client will be sent at QOS 0
    Further information from https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels/
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice