<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"><<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>></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 '200' and a response like:</div><div>{"status":"ok","details":[{"description":"Database connection","result":"connected","runtime":191,"test_status":"ok"},{"description":"Google Cloud Messaging","result":"online","runtime":143,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":260,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":263,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":351,"test_status":"ok"}],"summary":"Everything is ok"}</div><div><br></div><div><br></div><div><br></div><div>If something, like DB, is not reachable, it also returns '200', and describes the problems in the JSON response:</div><div>{"status":"crit","details":[{"description":"Database connection","result":"org.hibernate.exception.JDBCConnectionException: could not extract ResultSet","runtime":26,"test_status":"crit"},{"description":"Google Cloud Messaging","result":"online","runtime":14,"test_status":"ok"},{"description":"Apple Push Network Sandbox","result":"online","runtime":32,"test_status":"ok"},{"description":"Apple Push Network Production","result":"online","runtime":211,"test_status":"ok"},{"description":"Windows Push Network","result":"online","runtime":149,"test_status":"ok"}],"summary":"There is 1 error found"}</div><div><br></div><div><br></div><div>Questions:</div><div>* do we continue to return '200' 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>