<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 7, 2016 at 7:26 AM, Matthias Wessendorf <span dir="ltr">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br></div><div><br></div><div>we have a /health endpoint:</div><div><a href="https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/util/HealthCheck.java#L54-L69" target="_blank">https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/util/HealthCheck.java#L54-L69</a></div><div><br></div><div>that gives indication if the DB and the supported push-networks are reachable.</div><div><br></div><div>If all goes well, it returns &#39;200&#39; and a response like:</div><div>{&quot;status&quot;:&quot;ok&quot;,&quot;details&quot;:[{&quot;description&quot;:&quot;Database connection&quot;,&quot;result&quot;:&quot;connected&quot;,&quot;runtime&quot;:191,&quot;test_status&quot;:&quot;ok&quot;},{&quot;description&quot;:&quot;Google Cloud Messaging&quot;,&quot;result&quot;:&quot;online&quot;,&quot;runtime&quot;:143,&quot;test_status&quot;:&quot;ok&quot;},{&quot;description&quot;:&quot;Apple Push Network Sandbox&quot;,&quot;result&quot;:&quot;online&quot;,&quot;runtime&quot;:260,&quot;test_status&quot;:&quot;ok&quot;},{&quot;description&quot;:&quot;Apple Push Network Production&quot;,&quot;result&quot;:&quot;online&quot;,&quot;runtime&quot;:263,&quot;test_status&quot;:&quot;ok&quot;},{&quot;description&quot;:&quot;Windows Push Network&quot;,&quot;result&quot;:&quot;online&quot;,&quot;runtime&quot;:351,&quot;test_status&quot;:&quot;ok&quot;}],&quot;summary&quot;:&quot;Everything is ok&quot;}</div><div><br></div><div><br></div><div><br></div><div>If something, like DB, is not reachable, it also returns &#39;200&#39;, and describes the problems in the JSON response:</div><div>{&quot;status&quot;:&quot;crit&quot;,&quot;details&quot;:[{&quot;description&quot;:&quot;Database connection&quot;,&quot;result&quot;:&quot;org.hibernate.exception.JDBCConnectionException: could not extract ResultSet&quot;,&quot;runtime&quot;:26,&quot;test_status&quot;:&quot;crit&quot;},{&quot;description&quot;:&quot;Google Cloud Messaging&quot;,&quot;result&quot;:&quot;online&quot;,&quot;runtime&quot;:14,&quot;test_status&quot;:&quot;ok&quot;},{&quot;description&quot;:&quot;Apple Push Network Sandbox&quot;,&quot;result&quot;:&quot;online&quot;,&quot;runtime&quot;:32,&quot;test_status&quot;:&quot;ok&quot;},{&quot;description&quot;:&quot;Apple Push Network Production&quot;,&quot;result&quot;:&quot;online&quot;,&quot;runtime&quot;:211,&quot;test_status&quot;:&quot;ok&quot;},{&quot;description&quot;:&quot;Windows Push Network&quot;,&quot;result&quot;:&quot;online&quot;,&quot;runtime&quot;:149,&quot;test_status&quot;:&quot;ok&quot;}],&quot;summary&quot;:&quot;There is 1 error found&quot;}</div><div><br></div><div><br></div><div>Questions:</div><div>* do we continue to return &#39;200&#39; in the later case?</div></div></blockquote><div>Yes </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>* Or should we give a 500 if there is at least one problem ? </div></div></blockquote><div>No, unless the server is unable to fufll the health request.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Please report your desire :-)</div></div></blockquote><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div>-Matthias</div><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a></div></div></div>
</font></span></div>
<br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br></div></div>