Export own and subscription addresses for testing
ppkarwasz opened this issue · 3 comments
Recently we are experiencing some random test failures on our JeroMqAppenderTest
.
Up until recently the test would:
- bind a
PUB
socket to a specific port, - connect a
SUB
socket, - wait an arbitrary amount of time for the subscription to propagate.
The specific port and arbitrary amount of time have a tendency to fail on slow shared workers like Github Actions. Right now we are binding the PUB
socket to tcp://*:0
and we use reflection to retrieve the actual port used by the socket and the list of its current subscribers (cf. source code).
Would it possible to export through a public API:
- the list of addresses a socket is using (which might be different from the list of addresses it was bound, if ephemerous ports are used),
- the list of addresses of a socket's peers.
I can provide a PR if you point me in the right direction.
In the incoming Jeromq 0.6, a monitor can be any implementation of ZMQ.EventConsummer. I wonder if it might do the job ? I use it to log Jeromq events in my application.
I have tested ZMonitor
in the current release and it allows us to extract the information we need. Thank You very much.
BTW: JeroMqAppender
is now in maintenance mode, since no one from the core developer team uses JeroMq. I notice that there are a lot of cool features we could exploit. If you have any suggestions feel free to submit a feature request or PR.
My own version of a JeroMQ appender delegate sending to a Publisher using it’s own thread.
https://github.com/fbacchella/loghublog4j2/tree/master/src/main/java/fr/loghub/log4j2/appender/zmq
https://github.com/fbacchella/loghublog4j2/tree/master/src/main/java/fr/loghub/logservices/zmq