{
ClientProducer producer = session.createProducer(inQueue);
for (int i = 0; i < numberOfMessages; i++)
{
HornetQTextMessage txt = new HornetQTextMessage(session);
txt.setIntProperty("msg", i);
txt.setText("Message Number (" + i + ")");
txt.doBeforeSend();
producer.send(txt.getCoreMessage());
}
session.commit();
}