{
TopicConnection conn = getTopicConnectionFactory().createTopicConnection();
try
{
TopicSession s = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
TopicPublisher publisher = s.createPublisher(HornetQServerTestCase.topic1);
TopicSubscriber sub = s.createSubscriber(HornetQServerTestCase.topic1);
conn.start();
// Create 3 object messages with different bodies
TestObject to1 = new TestObject();
to1.text = "hello1";
TestObject to2 = new TestObject();
to1.text = "hello2";
TestObject to3 = new TestObject();
to1.text = "hello3";
ObjectMessage om1 = s.createObjectMessage();
om1.setObject(to1);
ObjectMessage om2 = s.createObjectMessage();
om2.setObject(to2);
ObjectMessage om3 = s.createObjectMessage();
om3.setObject(to3);
// send to topic
publisher.send(om1);