Review Board 1.7.22


QPID-3963: have the Link monitor the remote broker's amq.failover exchange, and use this information during failover.

Review Request #4846 - Created April 23, 2012 and submitted

Kenneth Giusti
trunk
qpid-3963
Reviewers
qpid
aconway, gordon
qpid
Still a WIP, but I wanted early feedback as I'm not too experienced with the subscription management code involved (completely stolen from Alan).

This patch allows the Link to subscribe to the remote broker's amq.failover exchange - if it exists.  This allows the Link to be updated dynamically should the remote broker be part of a cluster, and the cluster membership changes.

Light testing against a cluster confirms that this patch fixes qpid-3963.  Testing against a non-cluster remote causes the remote to log the following error, but otherwise behaves ok:

2012-04-23 16:45:27 error Execution exception: not-found: Exchange not found: amq.failover (../../../qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp:101)
minimal.
/trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp
Revision 1329301 New Change
[20] 21 lines
[+20]
22
#include "qpid/broker/ExchangeRegistry.h"
22
#include "qpid/broker/ExchangeRegistry.h"
23
#include "qpid/broker/DirectExchange.h"
23
#include "qpid/broker/DirectExchange.h"
24
#include "qpid/broker/FanOutExchange.h"
24
#include "qpid/broker/FanOutExchange.h"
25
#include "qpid/broker/HeadersExchange.h"
25
#include "qpid/broker/HeadersExchange.h"
26
#include "qpid/broker/TopicExchange.h"
26
#include "qpid/broker/TopicExchange.h"

    
   
27
#include "qpid/broker/Link.h"
27
#include "qpid/management/ManagementDirectExchange.h"
28
#include "qpid/management/ManagementDirectExchange.h"
28
#include "qpid/management/ManagementTopicExchange.h"
29
#include "qpid/management/ManagementTopicExchange.h"
29
#include "qpid/framing/reply_exceptions.h"
30
#include "qpid/framing/reply_exceptions.h"
30

    
   
31

   
31
using namespace qpid::broker;
32
using namespace qpid::broker;
[+20] [20] 24 lines
[+20] [+] pair<Exchange::shared_ptr, bool> ExchangeRegistry::declare(const string& name, const string& type,
56
            exchange = Exchange::shared_ptr(new HeadersExchange(name, durable, args, parent, broker));
57
            exchange = Exchange::shared_ptr(new HeadersExchange(name, durable, args, parent, broker));
57
        }else if (type == ManagementDirectExchange::typeName) {
58
        }else if (type == ManagementDirectExchange::typeName) {
58
            exchange = Exchange::shared_ptr(new ManagementDirectExchange(name, durable, args, parent, broker));
59
            exchange = Exchange::shared_ptr(new ManagementDirectExchange(name, durable, args, parent, broker));
59
        }else if (type == ManagementTopicExchange::typeName) {
60
        }else if (type == ManagementTopicExchange::typeName) {
60
            exchange = Exchange::shared_ptr(new ManagementTopicExchange(name, durable, args, parent, broker));
61
            exchange = Exchange::shared_ptr(new ManagementTopicExchange(name, durable, args, parent, broker));

    
   
62
        }else if (type == Link::exchangeTypeName) {

    
   
63
            exchange = Link::linkExchangeFactory(name);
61
        }else{
64
        }else{
62
            FunctionMap::iterator i =  factory.find(type);
65
            FunctionMap::iterator i =  factory.find(type);
63
            if (i == factory.end()) {
66
            if (i == factory.end()) {
64
                throw UnknownExchangeTypeException();
67
                throw UnknownExchangeTypeException();
65
            } else {
68
            } else {
[+20] [20] 58 lines
/trunk/qpid/cpp/src/qpid/broker/Link.h
Revision 1329301 New Change
 
/trunk/qpid/cpp/src/qpid/broker/Link.cpp
Revision 1329301 New Change
 
/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp
Revision 1329301 New Change
 
/trunk/qpid/cpp/src/qpid/cluster/Connection.h
Revision 1329301 New Change
 
/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
Revision 1329301 New Change
 
/trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp
Revision 1329301 New Change
 
/trunk/qpid/cpp/xml/cluster.xml
Revision 1329301 New Change
 
  1. /trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp: Loading...
  2. /trunk/qpid/cpp/src/qpid/broker/Link.h: Loading...
  3. /trunk/qpid/cpp/src/qpid/broker/Link.cpp: Loading...
  4. /trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp: Loading...
  5. /trunk/qpid/cpp/src/qpid/cluster/Connection.h: Loading...
  6. /trunk/qpid/cpp/src/qpid/cluster/Connection.cpp: Loading...
  7. /trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp: Loading...
  8. /trunk/qpid/cpp/xml/cluster.xml: Loading...