receiving messages, transacted and with auto-acknowledge-mode */
s_rec = qc.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
/* start the connection */
qc.start();
/* Create a receiver */
QueueReceiver qr = s_rec.createReceiver(q);
/* Create a sender for sending messages */
QueueSender qsender = s_send.createSender(q);
/* create a message for sending */
Message msg = s_send.createObjectMessage(new Integer(0));
msg.setStringProperty(PROP1, VAL1);
msg.setStringProperty(PROP2, VAL2);
msg.setStringProperty(PROP3, VAL3);
msg.setLongProperty(PROP4, VAL4);
msg.setFloatProperty(PROP5, VAL5);
msg.setShortProperty(PROP6, VAL6);
msg.setBooleanProperty(PROP7, VAL7);
msg.setIntProperty(PROP8, VAL8);
msg.setDoubleProperty(PROP9, VAL9);
/* Send the message */
qsender.send(msg);
/* Commit the sending session */
s_send.commit();
/* Receive the message */
msg = qr.receiveNoWait();
/* Commit the session to clear the queue */
s_rec.commit();
/* Check, if the headers are set */
Assert.assertEquals(PROP1, VAL1, msg.getStringProperty(PROP1));
Assert.assertEquals(PROP2, VAL2, msg.getStringProperty(PROP2));