Created
December 3, 2014 20:15
-
-
Save clebertsuconic/5a2852b6c5850fce7b94 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
ClientMessage msg = null; | |
for (int i = 0; i < 100; i++) | |
{ | |
msg = session.createMessage(true); | |
msg.putStringProperty("color", "red"); | |
msg.putIntProperty("count", i); | |
prod.send(msg); | |
if (i > 0 && i % 10 == 0) | |
{ | |
store.startPaging(); | |
store.forceAnotherPage(); | |
} | |
} | |
for (int i = 0; i < 100; i++) | |
{ | |
msg = session.createMessage(true); | |
msg.putStringProperty("color", "green"); | |
msg.putIntProperty("count", i); | |
prod.send(msg); | |
if (i > 0 && i % 10 == 0) | |
{ | |
store.startPaging(); | |
store.forceAnotherPage(); | |
} | |
} | |
session.start(); | |
ClientConsumer cons1 = session.createConsumer("Q1", "color='red'"); | |
for (int i = 0; i < 100; i++) | |
{ | |
msg = cons1.receive(5000); | |
System.out.println("Received " + msg); | |
assertNotNull(msg); | |
msg.acknowledge(); | |
} | |
session.commit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment