zeromq / jeromq

Pure Java ZeroMQ
Mozilla Public License 2.0
2.34k stars 484 forks source link

Export own and subscription addresses for testing #960

Closed ppkarwasz closed 10 months ago

ppkarwasz commented 10 months ago

Recently we are experiencing some random test failures on our JeroMqAppenderTest.

Up until recently the test would:

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:

I can provide a PR if you point me in the right direction.

fbacchella commented 10 months ago

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.

ppkarwasz commented 10 months ago

@fbacchella,

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.

fbacchella commented 10 months ago

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