Pergunta

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?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top