diff options
| author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-09-01 18:11:26 +0000 |
|---|---|---|
| committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-09-01 18:11:26 +0000 |
| commit | 0d8d94a588668bd651a02adec04c60fcd615c3ae (patch) | |
| tree | 7be439b148c11a1201e2b17b7cc80bd080ab5073 /cpp/src/qpid/management | |
| parent | 60a585f3bd0823aff820279ed87137797eb7c100 (diff) | |
| download | qpid-python-0d8d94a588668bd651a02adec04c60fcd615c3ae.tar.gz | |
QPID-2841: set the TTL in agent heartbeat messages.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@991630 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/management')
| -rw-r--r-- | cpp/src/qpid/management/ManagementAgent.cpp | 10 | ||||
| -rw-r--r-- | cpp/src/qpid/management/ManagementAgent.h | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/cpp/src/qpid/management/ManagementAgent.cpp b/cpp/src/qpid/management/ManagementAgent.cpp index 847f2b53ce..09494f1d8e 100644 --- a/cpp/src/qpid/management/ManagementAgent.cpp +++ b/cpp/src/qpid/management/ManagementAgent.cpp @@ -556,7 +556,8 @@ void ManagementAgent::sendBufferLH(const string& data, const Variant::Map& headers, const string& content_type, qpid::broker::Exchange::shared_ptr exchange, - const string& routingKey) + const string& routingKey, + uint64_t ttl_msec) { Variant::Map::const_iterator i; @@ -595,6 +596,8 @@ void ManagementAgent::sendBufferLH(const string& data, DeliveryProperties* dp = msg->getFrames().getHeaders()->get<DeliveryProperties>(true); dp->setRoutingKey(routingKey); + if (ttl_msec) + dp->setTtl(ttl_msec); msg->getFrames().append(content); @@ -843,7 +846,10 @@ void ManagementAgent::periodicProcessing (void) string content; MapCodec::encode(map, content); - sendBufferLH(content, "", headers, "amqp/map", v2Topic, addr_key.str()); + + // Set TTL (in msecs) on outgoing heartbeat indications based on the interval + // time to prevent stale heartbeats from getting to the consoles. + sendBufferLH(content, "", headers, "amqp/map", v2Topic, addr_key.str(), interval * 2 * 1000); QPID_LOG(trace, "SENT AgentHeartbeat name=" << name_address); } diff --git a/cpp/src/qpid/management/ManagementAgent.h b/cpp/src/qpid/management/ManagementAgent.h index d12b417820..f4d3c8c299 100644 --- a/cpp/src/qpid/management/ManagementAgent.h +++ b/cpp/src/qpid/management/ManagementAgent.h @@ -312,7 +312,8 @@ private: const qpid::types::Variant::Map& headers, const std::string& content_type, qpid::broker::Exchange::shared_ptr exchange, - const std::string& routingKey); + const std::string& routingKey, + uint64_t ttl_msec = 0); void moveNewObjectsLH(); bool authorizeAgentMessageLH(qpid::broker::Message& msg); |
