<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    &gt; First, remember the MiQ UI is connected to Hawkular-Services
    server via websocket.<br>
    <br>
    <font face="Calibri">One small nit, the MIQ UI websocket connection
      is via our ruby gem, so really any user of the rubly client could,
      I think, utilize the cmdgw stuff.<br>
      <br>
      &gt;  </font>... HOWEVER, I believe Jay added some code that does
    interact with Inventory to do things like create relationships in
    inventory when new cluster entities are added.<br>
    <br>
    There is no code in cmdgw doing any interaction with inventory.  In
    cmdgw we only declare the supported request/responses.  There are
    two aspects of hServices that interact with inventory.<br>
    <br>
    The InventoryEventListener listens for JMS events publish by
    Inventory and is responsible for:<br>
    <ul>
      <li>generating Added/Removed Server events to be consumed by MIQ</li>
      <ul>
        <li>using events for various server types<br>
        </li>
      </ul>
      <li>generating "isClusteredWith" relationships for clustered
        servers</li>
      <ul>
        <li>using events for JGroups Channels</li>
      </ul>
    </ul>
    <p>Inventory will no longer be generating these events and this
      listener will likely have to go away.  Either the agent will need
      to start generating the events or we'll need a new component to
      drive off of the persisted inventory data in metrics.<br>
    </p>
    <p><br>
      The Feed BackFill mechanism:<br>
    </p>
    <ul>
      <li>Needs to get and set the avail metrics for a feed's resources
        when the feed goes down (detected either by lack of avail
        heartbeat, or via broken websocket).</li>
    </ul>
    <p>We will need to replace the inventory traversal query with
      something based on the new metrics impl.<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 3/7/2017 9:26 AM, Joel Takvorian
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAJo5TF=NJ9fzL4s5wQKqb_f59q58-KbrdmzOdFcwLejsDQZOcA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Nice explanation, thanks!</div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Tue, Mar 7, 2017 at 3:12 PM, John
          Mazzitelli <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:mazz@redhat.com" target="_blank">mazz@redhat.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex"><span
              class="">&gt; Can you explain to me what's the big picture
              of the command gateway? What's<br>
              &gt; the chain of calls when, for instance, there's a new
              deployment in Wildfly?<br>
              <br>
            </span>Joel asked this question - I figured it is good to
            post to h-dev, too, since I'm sure others don't know this.<br>
            <br>
            The "big picture" is:<br>
            <br>
            First, remember the MiQ UI is connected to Hawkular-Services
            server via websocket. The agents all connect to some
            Hawkular-Services server via a websocket. There can be more
            than one Hawkular-Services server running and the UI may be
            talking to a server that is different than the server the
            agent is talking to:<br>
            <br>
            UI &lt;---websocket---&gt; Server A<br>
                                     ^<br>
                                     |<br>
                               (message bus)<br>
                                     |<br>
                                     V<br>
                                 Server B &lt;---websocket---&gt; agent<br>
            <br>
            <br>
            1) MiQ sends a JSON message over the websocket to a
            Hawkular-Services server (Server A in the diagram above).<br>
            2) Hawkular-Services server A looks at the ResourcePath in
            the message to determine what agent is responsible for
            managing that resource.<br>
            3) Hawkular-Services server A addresses the message to the
            proper agent and puts the JSON message on the agent's queue
            on the message bus.<br>
            3b) At this point the Hawkular-Services server A sends back
            a JSON message to the UI over the websocket that says
            "message forwarded to the bus".<br>
            4) The Hawkular-Services server that has a websocket
            connection to the targeted agent picks off that message from
            the bus (Server B in the diagram)<br>
            5) That Hawkular-Services server B forwards the message to
            the agent via its websocket connection.<br>
            6) Agent looks the the message's ResourcePath and the rest
            of the JSON to determine what it needs to do. It does the
            action.<br>
            <br>
            // now the process goes in reverse<br>
            <br>
            7) Agent sends back a response to the server B over
            websocket (either a success or fail message)<br>
            8) Server B takes response, figures out which UI the
            response should go to, and puts it on message bus addressed
            to the correct UI<br>
            9) The Server A takes the response message off the bus<br>
            10) Server A sends the response message to the UI over its
            websocket connection.<br>
            <span class=""><br>
              <br>
              &gt; Tell me if I'm correct, for what I've seen it's MIQ
              which, though the ruby<br>
              &gt; client, sends a websocket event, caught by the WF
              agent through the command<br>
              &gt; gateway. In the end, the WF agent will perform a full
              sync of affected root<br>
              &gt; resources in inventory. Is that correct?<br>
              <br>
            </span>In the case of a "Deployment" JSON message, yes, the
            agent will trigger a full discovery scan so it can quickly
            discover the new deployment you just added to WildFly.<br>
            <span class=""><br>
              &gt; If that's correct, there's no direct interaction
              between inventory and the<br>
              &gt; command gateway. I'm asking because I hope we can
              keep the command gateway<br>
              &gt; messages unchanged, and change only places where
              there's direct calls to<br>
              &gt; the inventory rest api.<br>
              <br>
            </span>Most of the time, its just using ResourcePath API
            (just that simple inventory POJO). HOWEVER, I believe Jay
            added some code that does interact with Inventory to do
            things like create relationships in inventory when new
            cluster entities are added. That is why (I think) he did
            this commit. Though I can't remember where this code is that
            builds inventory relationships - he'll have to point that
            out. But I'm pretty sure there is some inventory stuff going
            on under the covers for that stuff - more than just using
            the canonical ResourcePath stuff.<br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
hawkular-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/hawkular-dev">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>