ClientMessage message = null;
int numberOfMessages = 0;
while (true)
{
message = session.createMessage(IS_DURABLE_MESSAGE);
message.getBodyBuffer().writeBytes(body);
message.putIntProperty("id", numberOfMessages);
message.putBooleanProperty("new", false);
// Stop sending message as soon as we start paging