I am importing a large amount of data from files to a Redis database. So I have two steps to perform: parsing the files, then importing them using jedis.

I want to parse and import at the same times using one thread for each task to speed up the process.

What would be a good approach to exchange the data between those two threads? I suppose I need some kind of lightweight Java message queue.

Would Java Message Service be a good solution? Or could I just use a concurrent Java List?

有帮助吗?

解决方案

As @DaoWen said, since you are using threads you don't have to bother with an MQ. BlockingQueue and ConcurrentLinkedQueue should be fine.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top