<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    the health endpoint is an HTTP server.<br>
    Regardless of what information the endpoint provides, HTTP status
    codes should reflect the state of the server itself.<br>
    A 500 error would mean that the health endpoint itself is unhealthy.<br>
    <br>
    My 2c.<br>
    <br>
    Ron<br>
    <br>
    <div class="moz-cite-prefix">On 7.7.2016 13:26, Matthias Wessendorf
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAAg5f2SKRQb6jfHhFKmTJuNQUYDvcShShrH=SmqHsm+bLA3anw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hi,<br>
        </div>
        <div><br>
        </div>
        <div>we have a /health endpoint:</div>
        <div><a moz-do-not-send="true"
href="https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/util/HealthCheck.java#L54-L69">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>* Or should we give a 500 if there is at least one problem
          ? </div>
        <div><br>
        </div>
        <div>Please report your desire :-)</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>-Matthias</div>
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature" data-smartmail="gmail_signature">
          <div dir="ltr">
            <div>Matthias Wessendorf <br>
              <br>
              blog: <a moz-do-not-send="true"
                href="http://matthiaswessendorf.wordpress.com/"
                target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
              twitter: <a moz-do-not-send="true"
                href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a></div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
aerogear-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="0">-- 
Ron Smeral
Technical Writer, RHMAP
Brno</pre>
  </body>
</html>