Skip to content

Instantly share code, notes, and snippets.

@clebertsuconic
Created December 3, 2014 20:15
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 clebertsuconic/5a2852b6c5850fce7b94 to your computer and use it in GitHub Desktop.
Save clebertsuconic/5a2852b6c5850fce7b94 to your computer and use it in GitHub Desktop.
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