class: integration_wiretap_module
[23:14] static extends: object
Module JAR loader class. Loads the bundled jar that backs the Wiretap before any extern class resolves.
Methods
- integration_wiretap_module ()
class: Wiretap
[48:14] (extern: com.lehman.aussom.Wiretap) extends: object
Wiretap is the classic EIP Wire Tap: as messages move through a flow, you hand each one to the Wiretap so it can be monitored, logged, audited, or debugged on the side, without slowing or changing the main flow. It is, in essence, an async queue with a handler. The app submits a message with a fast tap() call that only enqueues and returns; a background worker later drains the queue and calls the handler, which does the actual tap work. It is an Aussom Server client listener: register it with app.registerListener and the server runtime runs its background worker on a dedicated thread. Feed it messages with tap() from any thread. The Wiretap is standalone, generic, and minimal. It takes one message and nothing else, the message may be any Aussom value, and it never looks inside it. Any condition on what to tap lives in the caller's own code before it calls tap(). If the queue is full, tap() drops the new message rather than block, and counts it (getDroppedCount). The Wiretap does not copy the message, so the handler must treat it as read-only.
Methods
-
Wiretap (
string Name)Creates a new Wiretap.
- @p
Nameis the stable listener name used in logs and applications.yaml.
- @p
-
newWiretap (
string Name) -
setCapacity (
int N)Sets the maximum number of queued messages before tap() drops new ones to bound memory. Default 100000, high so the Wiretap absorbs bursty traffic without dropping.
- @p
Nis an int with the queue cap (> 0). - @r
thisobject
- @p
-
setOnTap (
callback Cb)Sets the tap handler, called as Cb(Message) for each tapped message, in order, on the worker thread. Required.
- @p
Cbis the tap handler callback. - @r
thisobject
- @p
-
tap (
Message)Enqueues one message for the handler and returns at once. If the queue is full the message is dropped and counted, so the call never blocks the main flow.
- @p
Messageis the message to tap, any Aussom value. - @r
thisobject
- @p
-
tapMsg (
Message) -
getDroppedCount ()
Gets the number of messages dropped because the queue was full.
- @r
Anint with the drop count.
- @r
-
startListener ()
Runs the worker loop on the calling thread, blocking until stopListener() is called. Under Aussom Server the runtime drives this after app.registerListener; called directly for plain-CLI use and tests.
- @r
thisobject
- @r
-
stopListener ()
Signals the worker loop to exit.
- @r
thisobject
- @r
-
pauseListener ()
Pauses delivery without dropping queued messages.
- @r
thisobject
- @r
-
resumeListener ()
Resumes delivery after pauseListener().
- @r
thisobject
- @r
-
getListenerName ()
Gets the wiretap (listener) name.
- @r
Astring with the name.
- @r
-
getIsRunning ()
Reports whether the worker loop is running.
- @r
Abool, true while running.
- @r
-
getIsPaused ()
Reports whether delivery is paused.
- @r
Abool, true while paused.
- @r