Skip to content

Instantly share code, notes, and snippets.

@stefanotroia
Created November 13, 2019 17:22
Show Gist options
  • Save stefanotroia/bf6f9d48c27bb062374100a38d1b468e to your computer and use it in GitHub Desktop.
Save stefanotroia/bf6f9d48c27bb062374100a38d1b468e to your computer and use it in GitHub Desktop.
Rabbit consume with threads
private ListeningExecutorService service = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(10));
@RabbitListener(queues = {DEMO})
public void consumeMessages(Message message) {
service.submit(()-> {this.consumeMessage(strMsg);});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment