Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
BaSyx / Documentation / Components / DataBridge / Features / Health Endpoint
Health Endpoint
User Story & Use Case
As BaSyx components administrator
I want a health endpoint for DataBridge component
so that I can easily check the healthiness of the used components
In various contexts, a health endpoint indicating the healthiness of the components is beneficial. For example, it can be utilized for waiting for a component startup. Additionally, it can be used in Kubernetes as container probes and thus automatically handle container failure.
Feature Overview
All BaSyx components expose the /health endpoint at their configured HTTP context. For example, if the DataBridge component is running at http://localhost:8085, the respective health endpoint can be accessed via http://localhost:8085/health. If the component is healthy, it will return the HTTP status code 200 OK with a response body containing the detailed status of context routes as a JSON.
Invalid language.
You need to specify a language like this: <source lang="html4strict">...</source>
Supported languages for syntax highlighting:
4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, otj, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic
[ { "message": "", "details": { "invocation.count": 2, "context.name": "camel-1", "success.count": 2, "invocation.time": "2023-01-30T11:02:54.119537Z[Etc/UTC]", "context.version": "3.14.0", "context.status": "Started", "failure.count": 0 }, "state": "UP" }, { "message": "", "details": { "route.id": "app.health.context", "invocation.count": 2, "route.context.name": "camel-1", "success.count": 2, "invocation.time": "2023-01-30T11:02:54.119709Z[Etc/UTC]", "route.status": "Started", "failure.count": 0 }, "state": "UP" }, { "message": "", "details": { "route.id": "route1", "invocation.count": 2, "route.context.name": "camel-1", "success.count": 2, "invocation.time": "2023-01-30T11:02:54.119845Z[Etc/UTC]", "route.status": "Started", "failure.count": 0 }, "state": "UP" } ]
Disclaimer: Below will only work with the images created from development branch of basyx-java-components due to missing wget installation in the 1.3.0 release
In the following, an excerpt of a compose.yml file is given where the 'examplecontainer' waits for the 'databridge' container startup indicated by the healthcheck using wget and the health endpoint.
version: '3.8' services: examplecontainer: # image etc. omitted depends_on: databridge: condition: service_healthy databridge: # image etc. omitted healthcheck: test: wget --no-verbose --tries=1 databridge:8085/health || exit 1 interval: 20s retries: 3 start_period: 10s timeout: 10s
Feature Configuration
The feature is enabled by default. No additional configuration is necessary.