Dev News Daily ENDE

Quarkus Sonify plays a sound for each HTTP method and status code, in dev mode only

A new Quarkiverse extension, introduced on the Quarkus blog on 10 November, turns a running application in dev mode into something you can hear. Quarkus Sonify, written by Fouad Almalki and released as version 0.1.0, plays a short sound on the machine that runs the application whenever an HTTP request arrives, whenever a response goes out, and when the application starts or finishes a live reload.

The sounds carry information. Each HTTP method has its own pattern: a GET is a single tap, a POST two taps going up, a DELETE two taps going down. For responses, the class of the status code chooses the kind of sound and the exact code chooses the pitch, so a 200 is a clear note, a 404 a hollow one and a 500 a thud. The audio is synthesised inside the JVM, which means no browser tab has to stay open and no native library is needed.

Applications can add their own events. A method on a CDI bean annotated with @PlaySound and a name gets a sound whenever it runs, and an injected SoundPlayer can play a named sound from anywhere. Every sound can be swapped for a WAV file or switched off through application.properties, per named sound, per status code or per HTTP method; the post's examples map a 418 to a whistle and silence OPTIONS requests.

The part that matters for anyone tempted to try it is where the code ends up. According to the post, everything that produces sound lives in an artifact that Quarkus adds only in dev mode. In production and in tests the annotation and the SoundPlayer do nothing, and the audio code is not part of the built application, so nothing has to be removed before shipping.

The author calls the extension mostly a bit of fun. The repository includes a demo page with one link for each HTTP method and status code, and the issue tracker is open for sound ideas.

Quarkus Sonify plays a sound for each HTTP method and status code, in dev mode only
Quarkus Sonify plays a sound for each HTTP method and status code, in dev mode only — Dev News Daily

Why it matters

It is a small example of a pattern Quarkus supports well: a development-only dependency that cannot leak into a production build by construction, rather than by someone remembering to delete it.

Primary source
Quarkus blog
https://quarkus.io/blog/quarkus-sonify/