- Maven
- OpenJDK 11
mvn test
- provide interruptable
ReentrantLock
instead of intristic lock inProducerAPIImpl
and propagate theInterruptedException
inProducerAPI
in each method to the caller
- concurrent access is possible for the
ConsumerAPI
- the lookup in
ConsumerAPI.getLatestPrice
is aHashMap
lookup, which isO(1)
with high probability. - concurrent access is possible for the
ProducerAPI
commitBatch
is blocking and only one thread is able to access it concurrentlyuploadBatch
is blocking for the samebatchId
, but multiple threads are able to execute it concurrently with differentbatchId
s