summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorNuno Santos <nsantos@apache.org>2008-05-16 01:33:21 +0000
committerNuno Santos <nsantos@apache.org>2008-05-16 01:33:21 +0000
commit652be6b00e5b02deca44e291de640762b26a66e3 (patch)
tree5058e7500a79a983c41df9a70d63c0b11f50af39 /cpp
parent9a3d8ad1695d1b7f2cb42d77c6106245c521566c (diff)
downloadqpid-python-652be6b00e5b02deca44e291de640762b26a66e3.tar.gz
QPID-1061: Management heartbeat message from broker -- applied patch supplied by Ted Ross
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@656918 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/management/ManagementBroker.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpp/src/qpid/management/ManagementBroker.cpp b/cpp/src/qpid/management/ManagementBroker.cpp
index 6466028c00..da6a6fd742 100644
--- a/cpp/src/qpid/management/ManagementBroker.cpp
+++ b/cpp/src/qpid/management/ManagementBroker.cpp
@@ -25,6 +25,7 @@
#include <qpid/broker/Message.h>
#include <qpid/broker/MessageDelivery.h>
#include "qpid/framing/MessageTransferBody.h"
+#include "qpid/sys/Time.h"
#include <list>
#include <iostream>
#include <fstream>
@@ -246,6 +247,17 @@ void ManagementBroker::PeriodicProcessing (void)
string routingKey;
std::list<uint64_t> deleteList;
+ {
+ Buffer msgBuffer(msgChars, BUFSIZE);
+ EncodeHeader(msgBuffer, 'h');
+ msgBuffer.putLongLong(uint64_t(Duration(now())));
+
+ contentSize = BUFSIZE - msgBuffer.available ();
+ msgBuffer.reset ();
+ routingKey = "mgmt." + uuid.str() + ".heartbeat";
+ SendBuffer (msgBuffer, contentSize, mExchange, routingKey);
+ }
+
if (managementObjects.empty ())
return;