-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Producer creates a single RawLink object that is similar to our link class then wraps this in a message (Event) and the enters a loop to repeatedly push this message to the Reactor. This tests only the publish rate, not the time to create or serialize the object.
The Receiver implements the accept() method and then is connected to the Reactor in the RunTest class. When it receives a message it simply logs to the file. Hopefully it is logging using the Log4j2 AsyncLoggers as these also use a ring buffer to enable very fast writes. (but is is not clear to me that I have my Log4j2 configured correctly).
Prototype is based on this example: http://spring.io/guides/gs/messaging-reactor/
There is also a more efficient, annotated approach for wiring class into the Reactor that is describer in this article: https://github.com/reactor/reactor/wiki/Spring but was not able to get this running.
This project also demonstrates using a configuration class to set up beans versus an xml config file. The main class bootstraps the configuration class then other classes can use the Autowire annotation. There is some information on these annotations here: http://docs.spring.io/spring-javaconfig/docs/1.0.0.m3/reference/html/creating-bean-definitions.html and https://blog.codecentric.de/en/2012/07/spring-dependency-injection-styles-why-i-love-java-based-configuration/
Some initial numbers:
Publish 1M links publish time: 8228/8417ms write time: ~9 seconds
Publish 10M links** publish time: 87711ms
Still to do:
- tune the ring buffer
- Use direct Disruptor classes: http://nitschinger.at/Using-the-Reactor-Processor-for-High-Performance-TCP
Quick test show producer
Interesting article on Log4j2 using a ring buffer for new logger type: AsyncLoggers. To set up the Log4j 2 to use these logger see this article. Simple approach is to set all Log4j2 loggers to use this logger type by setting a system variable: Log4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector