Skip to main content
. 2021 Dec 9;21(24):8232. doi: 10.3390/s21248232
Algorithm 1 Bridging joint Publish event notifications among broker clusters.
Function: coordinateJointPublishTopic(tp_Id,brk_Id,pls_Tb,pd_Tb,cls_Tb):
  •   1:

    if (! tp_Idis inpls_Tb ) then

  •   2:

        addPublisher(tp_Id, brk_Id, pls_Tb);

  •   3:

        if (tp_Idis inpd_Tb ) then

  •   4:

             pd_Scr = findPendingSubscribers(tp_Id, pd_Tb);

  •   5:

             inform_to_subscribe(tp_Id, pd_Scr);

  •   6:

        end if

  •   7:

    else

  •   8:

        cls_Id, clsH_Id, rlCB_Id = findClusterInfo(tp_Id, brk_Id, pls_Tb, cls_Tb);

  •   9:

        if ( tp_Idis incls_Id’s pls_Tb ) then

  • 10:

             addPublisher(tp_Id, brk_Id, pls_Tb);

  • 11:

             p_Brk = findIntraBrokers(tp_Id, cls_Id, pls_Tb);

  • 12:

             inform_Bridging(tp_Id, p_Brk, p_Brk);

  • 13:

        else

  • 14:

             addPublisher(tp_Id, brk_Id, clsH_Id, pls_Tb);

  • 15:

             rl_Brk = findInterBrokers(tp_Id, pls_Tb, cls_Tb);

  • 16:

             inform_Bridging(tp_Id, brk_Id, clsH_Id);

  • 17:

             inform_Bridging(tp_Id, clsH_Id, rlCB_Id);

  • 18:

             inform_Bridging(tp_Id, rlCB_Id, rl_Brk);

  • 19:

        end if

  • 20:

    end if