Skip to content

Instantly share code, notes, and snippets.

@calvincodes
Last active June 27, 2017 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calvincodes/bff89ae368b73d6921b0b59b87ea6fc8 to your computer and use it in GitHub Desktop.
Save calvincodes/bff89ae368b73d6921b0b59b87ea6fc8 to your computer and use it in GitHub Desktop.
IMessagePublisher messagePublisher = MessagePublisherFactory.getPublisher(CacheType.CONNECTION_CACHE);
ExecutorService threadPool = Executors.newFixedThreadPool(5, factory);
for (int i = 1; i <= 1000000; i++) {
int finalI = i;
threadPool.submit(new Runnable() {
@Override
public void run() {
messagePublisher.publishMessage("testExchange", "testRoutingKey1", message + String.valueOf(finalI));
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment