/producer-consumer-problem

Java Concurrency programming - use producer-consumer-problem model to improve performance.

Primary LanguageJavaApache License 2.0Apache-2.0

Producer-Consumer-Problem sample

996.icu LICENSE

Java Concurrency programming - use producer-consumer-problem to improve performance.

Generically speaking, when setup a module in distributed system, we need to connect to the other modules through MQ middleware. For showing how the producer-consumer module works, this sample will use file system to replace the MQ middleware.

I integrate this sample with Spring framework, so you can just change the logic for consumer, producer and pipeline. Then use it in your company project easily.

There are still same reminder:

  1. Don't forget to backup your MESSAGE in producer(Producer.java line56).
  2. Don't forget to delete your temporary file when you have done your task in consumer(Consumer.java line34).
  3. Tune your thread size in applicationContext.xml.

Feel free to send email to me chenrulong0513.master@gmail.com if you have any questions. And welcome to my blog GeekerSquare.