Reputation: 7366
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?
Upvotes: 0
Views: 506
Reputation: 7229
As @DaoWen said, since you are using threads you don't have to bother with an MQ. BlockingQueue and ConcurrentLinkedQueue should be fine.
Upvotes: 1