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