summaryrefslogtreecommitdiff
path: root/qpid/java/client/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2006-10-12 16:32:47 +0000
committerGordon Sim <gsim@apache.org>2006-10-12 16:32:47 +0000
commited053ced80d3d8997420fd4f95e7c9bfbb561f40 (patch)
tree146b812e055fce3259430ac9c6a147dfb3f03a54 /qpid/java/client/src
parent0fa9f4026bade25610d8dbb697a52ccb821aef16 (diff)
downloadqpid-python-ed053ced80d3d8997420fd4f95e7c9bfbb561f40.tar.gz
Fixed ack.RecoverTest and ack.DisconnectAndRedeliverTest. These were failing due to a race condition
where the consumers queue was not bound by the time the publisher sent messages. This is a result of the use of nowait=true for the declare/bind/consume cycle for a BasicMessageConsumer. To work around this in tests like these that have two connections, one consuming & one publishing, I added a declareExchangeSynch() method to AMQSession which allows a thread to block until the session it invokes that method on has processed all the commands up to that point. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@463309 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client/src')
-rw-r--r--qpid/java/client/src/org/apache/qpid/client/AMQSession.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/qpid/java/client/src/org/apache/qpid/client/AMQSession.java b/qpid/java/client/src/org/apache/qpid/client/AMQSession.java
index 3bc670e609..1f15c24cb2 100644
--- a/qpid/java/client/src/org/apache/qpid/client/AMQSession.java
+++ b/qpid/java/client/src/org/apache/qpid/client/AMQSession.java
@@ -785,6 +785,12 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi
declareExchange(name, type, _connection.getProtocolHandler());
}
+ public void declareExchangeSynch(String name, String type) throws AMQException
+ {
+ AMQFrame frame = ExchangeDeclareBody.createAMQFrame(_channelId, 0, name, type, false, false, false, false, false, null);
+ _connection.getProtocolHandler().syncWrite(frame, ExchangeDeclareOkBody.class);
+ }
+
private void declareExchange(AMQDestination amqd, AMQProtocolHandler protocolHandler)
{
declareExchange(amqd.getExchangeName(), amqd.getExchangeClass(), protocolHandler);