diff options
| author | Ken Giusti <kgiusti@apache.org> | 2012-05-01 13:57:39 +0000 |
|---|---|---|
| committer | Ken Giusti <kgiusti@apache.org> | 2012-05-01 13:57:39 +0000 |
| commit | ed820c9a785098af71f44fc5daecf2fd2d62de19 (patch) | |
| tree | 8729edc67e93d28e7f1a110bc8f3be1214f1a497 /cpp/src/qpid/broker/Link.cpp | |
| parent | e8a9de8bd4c8b80e5c255d6dab7df903014388dc (diff) | |
| download | qpid-python-ed820c9a785098af71f44fc5daecf2fd2d62de19.tar.gz | |
QPID-3963: use unique name for created session and queue
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1332656 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Link.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Link.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/cpp/src/qpid/broker/Link.cpp b/cpp/src/qpid/broker/Link.cpp index 653601e7e4..d416789572 100644 --- a/cpp/src/qpid/broker/Link.cpp +++ b/cpp/src/qpid/broker/Link.cpp @@ -262,11 +262,6 @@ void Link::setUrl(const Url& u) { namespace { /** invoked when session used to subscribe to remote's amq.failover exchange detaches */ void sessionDetached(Link *link) { - // ??? really not sure what the right thing to do here, if anything... - // ??? Q: do I need to cancel the subscription and detached the session in the I/O thread (???) - // e.g: - //peer->getMessage().cancel(args.i_dest); - //peer->getSession().detach(name); QPID_LOG(debug, "detached from 'amq.failover' for link: " << link->getName()); } } @@ -290,12 +285,13 @@ void Link::opened() { // attempt to subscribe to failover exchange for updates from remote // - const std::string queueName = "qpid.link." + failoverExchange->getName(); + const std::string queueName = "qpid.link." + framing::Uuid(true).str(); failoverChannel = nextChannel(); SessionHandler& sessionHandler = connection->getChannel(failoverChannel); sessionHandler.setDetachedCallback( boost::bind(&sessionDetached, this) ); - sessionHandler.attachAs(failoverExchange->getName()); + failoverSession = queueName; + sessionHandler.attachAs(failoverSession); framing::AMQP_ServerProxy remoteBroker(sessionHandler.out); @@ -673,7 +669,7 @@ void Link::closeConnection( const std::string& reason) if (sessionHandler.getSession()) { framing::AMQP_ServerProxy remoteBroker(sessionHandler.out); remoteBroker.getMessage().cancel(failoverExchange->getName()); - remoteBroker.getSession().detach(failoverExchange->getName()); + remoteBroker.getSession().detach(failoverSession); } connection->close(CLOSE_CODE_CONNECTION_FORCED, reason); connection = 0; |
