Skip to content
Snippets Groups Projects
Commit 65dd973f authored by Jan Rinze Peterzon's avatar Jan Rinze Peterzon
Browse files

Task #7342: adapted MessageBus.cc to match MessageBus.h

parent 74df2eab
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ public:
void ack(qpid::messaging::Message &msg);
void reject(qpid::messaging::Message &msg);
void addQueue(const std::string &address="testqueue", const std::string &options="; {create: always}");
bool addQueue(const std::string &address="testqueue", const std::string &options="; {create: always}");
};
class ToBus
......@@ -72,5 +72,6 @@ public:
void send(const std::string &msg);
};
#endif
}
#endif
#include "lofar_config.h"
#include <MessageBus/MsgBus.h>
#include <Common/LofarLogger.h>
//#include <Common/LofarLogger.h>
#ifdef HAVE_QPID
#include <qpid/types/Exception.h>
#include <qpid/messaging/exceptions.h>
#include <qpid/messaging/Logger.h>
//#include <qpid/messaging/Logger.h>
using namespace qpid::messaging;
......@@ -38,14 +38,14 @@ namespace LOFAR {
FromBus::~FromBus(void)
{
if (itsNrMissingACKs)
LOG_ERROR_STR("Queue " << itsQueueName << " on broker " << itsBrokerName << " has " << itsNrMissingACKs << " messages not ACK'ed ");
// if (itsNrMissingACKs)
// LOG_ERROR_STR("Queue " << itsQueueName << " on broker " << itsBrokerName << " has " << itsNrMissingACKs << " messages not ACK'ed ");
}
bool FromBus::getMessage(Message &msg, double timeout) // timeout 0.0 means blocking
{
Receiver next;
if (session.nextReceiver(next,TimeOutDuration(timeout)))
if (itsSession.nextReceiver(next,TimeOutDuration(timeout)))
{
itsNrMissingACKs++;
return next.get(msg);
......@@ -91,7 +91,7 @@ namespace LOFAR {
itsConnection.open();
itsSession = itsConnection.createSession();
Address addr(address+options);
sender = itsSession.createSender(addr);
Sender itsSender = itsSession.createSender(addr);
} catch(const qpid::types::Exception &ex) {
THROW(MessageBusException, ex.what());
}
......@@ -102,7 +102,7 @@ namespace LOFAR {
void ToBus::send(const std::string &msg)
{
Message tosend(msg);
sender.send(tosend,true);
itsSender.send(tosend,true);
}
} // namespace LOFAR
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment