Author: astitcher
Date: Tue Feb  6 06:21:02 2007
New Revision: 504152

URL: http://svn.apache.org/viewvc?view=rev&rev=504152
Log: (empty)

Modified:
    incubator/qpid/branches/qpid.0-9/   (props changed)
    incubator/qpid/branches/qpid.0-9/cpp/lib/broker/BrokerAdapter.cpp
    incubator/qpid/branches/qpid.0-9/cpp/tests/Makefile.am

Propchange: incubator/qpid/branches/qpid.0-9/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Tue Feb  6 06:21:02 2007
@@ -1 +1 @@
-8427bd24-ae5a-4eba-a324-d2fc9c9c6c77:/local/qpid.0-9.ams:827
+8427bd24-ae5a-4eba-a324-d2fc9c9c6c77:/local/qpid.0-9.ams:839

Modified: incubator/qpid/branches/qpid.0-9/cpp/lib/broker/BrokerAdapter.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/cpp/lib/broker/BrokerAdapter.cpp?view=diff&rev=504152&r1=504151&r2=504152
==============================================================================
--- incubator/qpid/branches/qpid.0-9/cpp/lib/broker/BrokerAdapter.cpp (original)
+++ incubator/qpid/branches/qpid.0-9/cpp/lib/broker/BrokerAdapter.cpp Tue Feb  
6 06:21:02 2007
@@ -479,6 +479,10 @@
         if(exclusive) throw ChannelException(403, "Exclusive access cannot be 
granted");
         else throw ChannelException(403, "Access would violate previously 
granted exclusivity");
     }
+
+    connection.getChannel(channel).cancel(destination);
+
+    connection.client->getMessageHandler()->ok(channel);
 }
 
 void
@@ -507,6 +511,25 @@
     connection.getChannel(channel).setPrefetchCount(prefetchCount);
     
     connection.client->getMessageHandler()->ok(channel);
+       
+    Queue::shared_ptr queue = connection.getQueue(queueName, channelId);    
+    Channel& channel = connection.getChannel(channelId);
+    if(!destination.empty() && channel.exists(destination)){
+        throw ConnectionException(530, "Consumer tags must be unique");
+    }
+
+    try{
+        string newTag = destination;
+        channel.consume(newTag, queue, !noAck, exclusive, noLocal ? 
&connection : 0, &filter);
+
+           connection.client->getMessageHandler()->ok(channelId);
+
+        //allow messages to be dispatched if required as there is now a 
consumer:
+        queue->dispatch();
+    }catch(ExclusiveAccessException& e){
+        if(exclusive) throw ChannelException(403, "Exclusive access cannot be 
granted");
+        else throw ChannelException(403, "Access would violate previously 
granted exclusivity");
+    }
 }
 
 void

Modified: incubator/qpid/branches/qpid.0-9/cpp/tests/Makefile.am
URL: 
http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/cpp/tests/Makefile.am?view=diff&rev=504152&r1=504151&r2=504152
==============================================================================
    (empty)


Reply via email to