Last active
June 27, 2017 04:54
-
-
Save calvincodes/bff89ae368b73d6921b0b59b87ea6fc8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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