public void test() throws Exception
{
AMQConnection connection = (AMQConnection) getConnection();
AMQSession_0_8 session = (AMQSession_0_8) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
// Set no wait true so that we block the connection
// Also set a different exchange class string so the attempt to declare
// the exchange causes an exchange.
ExchangeDeclareBody body = session.getMethodRegistry().createExchangeDeclareBody(session.getTicket(), new AMQShortString(EXCHANGE_NAME), null,
true, false, false, false, true, null);
AMQFrame exchangeDeclare = body.generateFrame(session.getChannelId());
try
{
// block our thread so that can times out
connection.getProtocolHandler().syncWrite(exchangeDeclare, ExchangeDeclareOkBody.class);