yeah thanks for this :)<br><div class="gmail_quote"><div dir="ltr">Lukas Krejci &lt;<a href="mailto:lkrejci@redhat.com">lkrejci@redhat.com</a>&gt;於 2016年6月23日 週四,21:59寫道:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thursday, June 23, 2016 10:27:12 AM Thomas Segismont wrote:<br>
&gt; Hey Lukas,<br>
&gt;<br>
&gt; Thank you for pointing us in the sync endpoint. Austin will look into<br>
&gt; this and will certainly come back with more questions.<br>
&gt;<br>
&gt; With respect to the user creating resources question, the difference<br>
&gt; between Vert.x and Wildfly is that the user creates resources<br>
&gt; grammatically. So in version 1 of the application, there might be two<br>
&gt; HTTP servers as well as 7 event bus handlers, but only 1 http server in<br>
&gt; version 2. And a named worker pool in version 3.<br>
&gt;<br>
&gt; In the end, I believe it doesn&#39;t matter if it&#39;s container which creates<br>
&gt; resources or if it&#39;s the user himself. Does it?<br>
&gt;<br>
<br>
It does not really (inventory has just a single API, so it does not really<br>
know who is talking to it - if a feed or if a user) - but resources inside and<br>
outside feeds have slightly different semantics.<br>
<br>
Right now the logic is this:<br>
<br>
Feeds are &quot;agents&quot; that don&#39;t care about anything else but their own little<br>
&quot;world&quot;. That&#39;s why they can create their own resource types, metric types and<br>
they also declare resources and metrics of those types. Feed does not need to<br>
look &quot;outside&quot; of its own data and is in full charge of it.<br>
<br>
Hence the /sync endpoint applies to a feed nicely - since it is in charge, it<br>
merely declares what is the view it has currently of the &quot;world&quot; it sees and<br>
inventory will make sure it has the same picture - under that feed.<br>
<br>
Now if you have an application that spans multiple vms/machines and is<br>
composed of multiple processes, there is no such clear distinction of<br>
&quot;ownership&quot;.<br>
<br>
While indeed a &quot;real&quot; user can just act like a feed, the envisioned workflow<br>
is that the user operates directly in environments and at the top level. I.e.<br>
a user assigns feeds to environments (i.e. this feed reports on my server in<br>
staging environment, etc) and the user creates &quot;logical&quot; resources in the<br>
environment (i.e. &quot;My App&quot; resource in staging env is composed of a load<br>
balancer managed by this feed, mongodb managed by another feed there and<br>
clustered wflys there, there and there).<br>
<br>
To model this, inventory supports 2 kinds of tree hierarchies - 1 created<br>
using the &quot;contains&quot; relationship, which expresses existential ownership -<br>
i.e. a feed contains its resources and if a feed disappears, so do the<br>
resources, because no one else can report on them. The entities bound by the<br>
contains relationship form a tree - no loops or diamonds in it (this is<br>
enforced by inventory). But there can also be a hierarchy created using an<br>
&quot;isParentOf&quot; relationship (which represents &quot;logical&quot; ownership). Resources<br>
bound by &quot;isParentOf&quot; can form an acyclic graph - i.e. 1 resource can have<br>
multiple parents as well as many children (isParentOf is applicable only to<br>
resources, not other types of entities).<br>
<br>
The hierarchies formed by &quot;contains&quot; and &quot;isParentOf&quot; are independent. So you<br>
can create a resource &quot;My App&quot; in the staging environment and declare it a<br>
parent (using &quot;isParentOf&quot;) of the resources declared by feeds that manage the<br>
machines where the constituent servers live.<br>
<br>
That is the envisaged workflow for &quot;apps&quot;. Now the downside to that is that<br>
(currently) there is no &quot;sync&quot; for that. The reason is that the application<br>
really is a logical concept and the underlying servers can be repurposed to<br>
serve different applications (so if app stops using it, it shouldn&#39;t really<br>
disappear from inventory, as is the case with /sync - because if a feed<br>
doesn&#39;t &quot;see&quot; a resource, then it really is just gone, because the feed is<br>
solely responsible for reporting on it).<br>
<br>
We can think about how to somehow help clients with &quot;App sync&quot; but I&#39;m not<br>
sure if having a feed for vertx is the right thing to do. On the other hand I<br>
very well may not be seeing some obvious problems of the above or parallels<br>
that make the 2 approaches really the same because the above model is just<br>
ingrained in my brain after so many hours thinking about it ;)<br>
<br>
&gt; As for the feed question, the Vert.x feed will be the Metrics SPI<br>
&gt; implementation (vertx-hawkular-metrics project). Again I guess it&#39;s not<br>
&gt; much different than the Hawkular Agent.<br>
&gt;<br>
<br>
A feed would only be appropriate if vertx app never reported on something that<br>
would also be reported by other agents. I.e. if a part of a vertx application<br>
is also reported on by a wfly agent, because that part is running in a wfly<br>
server managed by us, then that will not work - 1 resource cannot be<br>
&quot;contained&quot; in 2 different feeds (not just API wise, but logically, too).<br>
<br>
&gt; Maybe the wording around user creating resources was confusing? Did you<br>
&gt; thought he would do so from application code? In this case, the answer<br>
&gt; is no.<br>
&gt;<br>
<br>
Yeah, we should probably get together and discuss what your plans are to get<br>
on the same page with everything.<br>
<br>
&gt; Regards,<br>
&gt; Thomas<br>
&gt;<br>
&gt; Le 23/06/2016 à 10:01, Austin Kuo a écrit :<br>
&gt; &gt; Yes, I’m gonna build the inventory for vertx applications.<br>
&gt; &gt; So I have to create a feed for it.<br>
&gt; &gt;<br>
&gt; &gt; Thanks!<br>
&gt; &gt;<br>
&gt; &gt; On Tue, Jun 21, 2016 at 7:55 PM Lukas Krejci &lt;<a href="mailto:lkrejci@redhat.com" target="_blank">lkrejci@redhat.com</a><br>
&gt; &gt;<br>
&gt; &gt; &lt;mailto:<a href="mailto:lkrejci@redhat.com" target="_blank">lkrejci@redhat.com</a>&gt;&gt; wrote:<br>
&gt; &gt;     Hi Austin,<br>
&gt; &gt;<br>
&gt; &gt;     Inventory offers a /hawkular/inventory/sync endpoint that is used to<br>
&gt; &gt;     synchronize the &quot;world view&quot; of feeds (feed being something that<br>
&gt; &gt;     pushes data<br>
&gt; &gt;     into inventory).<br>
&gt; &gt;<br>
&gt; &gt;     You said though that a &quot;user creates&quot; the resources, so I am not<br>
&gt; &gt;     sure if /sync<br>
&gt; &gt;     would be applicable to your scenario. Would you please elaborate<br>
&gt; &gt;     more on where<br>
&gt; &gt;     in the inventory hierarchy you create your resources and how? I.e.<br>
&gt; &gt;     are you<br>
&gt; &gt;     using some sort of feed akin to Hawkular&#39;s Wildfly Agent or are you<br>
&gt; &gt;     just<br>
&gt; &gt;     creating your resources &quot;manually&quot; under environments?<br>
&gt; &gt;<br>
&gt; &gt;     On Tuesday, June 21, 2016 02:20:33 AM Austin Kuo wrote:<br>
&gt; &gt;     &gt; Hi all,<br>
&gt; &gt;     &gt;<br>
&gt; &gt;     &gt; I’m currently investigating how to sync with inventory server.<br>
&gt; &gt;     &gt; Here’s the example scenario:<br>
&gt; &gt;     &gt; Consider the following problem. A user creates version 1 of the<br>
&gt; &gt;<br>
&gt; &gt;     app with<br>
&gt; &gt;<br>
&gt; &gt;     &gt; two http servers, one listening on port 8080, the other on port<br>
&gt; &gt;<br>
&gt; &gt;     8181. In<br>
&gt; &gt;<br>
&gt; &gt;     &gt; version 2, the http server listening on port 8181 is no longer<br>
&gt; &gt;     &gt; needed.<br>
&gt; &gt;     &gt; When the old version is stopped and the new version started, there<br>
&gt; &gt;<br>
&gt; &gt;     will be<br>
&gt; &gt;<br>
&gt; &gt;     &gt; just one http server listening. The application is not aware of the<br>
&gt; &gt;     &gt; previous state. What should we do so that the second http server<br>
&gt; &gt;<br>
&gt; &gt;     is removed<br>
&gt; &gt;<br>
&gt; &gt;     &gt; from Inventory?<br>
&gt; &gt;     &gt;<br>
&gt; &gt;     &gt; Thanks in advance.<br>
&gt; &gt;<br>
&gt; &gt;     --<br>
&gt; &gt;     Lukas Krejci<br>
&gt; &gt;<br>
&gt; &gt;     _______________________________________________<br>
&gt; &gt;     hawkular-dev mailing list<br>
&gt; &gt;     <a href="mailto:hawkular-dev@lists.jboss.org" target="_blank">hawkular-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:hawkular-dev@lists.jboss.org" target="_blank">hawkular-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt;     <a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a><br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; hawkular-dev mailing list<br>
&gt; &gt; <a href="mailto:hawkular-dev@lists.jboss.org" target="_blank">hawkular-dev@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a><br>
<br>
--<br>
Lukas Krejci<br>
<br>
_______________________________________________<br>
hawkular-dev mailing list<br>
<a href="mailto:hawkular-dev@lists.jboss.org" target="_blank">hawkular-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/hawkular-dev</a><br>
</blockquote></div>