Code example for AtomicInteger

Methods: get, set, sleep

0
        ((AMQSession) producerSession).createQueue(new AMQShortString(queueName), true, false, false, arguments);
        queue = producerSession.createQueue("direct://amq.direct/"+queueName+"/"+queueName+"?durable='false'&autodelete='true'");
        ((AMQSession) producerSession).declareAndBind((AMQDestination)queue);
        producer = producerSession.createProducer(queue);
 
        _sentMessages.set(0);
 
        // try to send 5 messages (should block after 4) 
        sendMessagesAsync(producer, producerSession, 5, 50L);
 
        Thread.sleep(5000);
 
        assertEquals("Incorrect number of message sent before blocking", 4, _sentMessages.get());
 
        consumer = consumerSession.createConsumer(queue);
        consumerConnection.start();
 
 
        consumer.receive();
 
        Thread.sleep(1000);
 
        assertEquals("Message incorrectly sent after one message received", 5, _sentMessages.get());
         
 
    }