You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For load-testing scenarios where retaining all messages in the buffer may be too memory-intensive, handler spies provide lightweight counters that track how many messages were processed with each status:
657
+
658
+
```ts
659
+
const counts =myConsumer.handlerSpy.counts
660
+
// {
661
+
// consumed: 150,
662
+
// published: 0,
663
+
// retryLater: 3,
664
+
// error: 1,
665
+
// }
666
+
```
667
+
668
+
Counters are incremented for every processed message regardless of `bufferSize`, so you get accurate statistics even when older messages have been evicted from the buffer. Calling `clear()` resets both the buffer and the counters.
669
+
654
670
## Message Logging
655
671
656
672
When `logMessages` is enabled, processed messages are logged at the `debug` level with structured metadata. For privacy reasons, the full message payload is **not logged by default** to avoid exposing sensitive data.
0 commit comments