Hi, I’ve noticed that all the Github async examples for the Java client use two synchronized methods: waitTillComplete() and notifyComplete().
For my application, I’ve created a Spring repository with a method that creates new command object instances, within each of which I replicate this usage from the examples. However, under load (e.g. 200 tps w/ records in the 1 MB range), I am seeing this method – which is more-or-less a basic async client.get(policy, listener, key) call – averaging around 20-30 ms response time, and about 20 ms for the wait() method.
This seems a lot higher than I expected to see, particularly for the wait() call. I suspect this is due to the use of the synchronized methods, and I am wondering if it is both safe and faster to refactor my code to avoid their use, probably by instead implementing an RxJava reactive adapter to the Aerospike listeners.
I am still wrapping my head around multithreading with Java as well as familiarizing myself with the nuances of the Aerospike client, so I am I thinking about this correctly? Has anyone tried this?