public void testRecoverResendsMsgsAckOnEarlier() throws Exception
{
AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
Session consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
Queue queue =
new AMQQueue(consumerSession.getDefaultQueueExchangeName(), new AMQShortString("someQ"),
new AMQShortString("someQ"), false, true);
MessageConsumer consumer = consumerSession.createConsumer(queue);
// force synch to ensure the consumer has resulted in a bound queue
// ((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.DIRECT_EXCHANGE_NAME, ExchangeDefaults.DIRECT_EXCHANGE_CLASS);
// This is the default now
AMQConnection con2 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "test");
Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
MessageProducer producer = producerSession.createProducer(queue);
_logger.info("Sending four messages");
producer.send(producerSession.createTextMessage("msg1"));
producer.send(producerSession.createTextMessage("msg2"));
producer.send(producerSession.createTextMessage("msg3"));
producer.send(producerSession.createTextMessage("msg4"));
con2.close();
_logger.info("Starting connection");
con.start();