60 lines
2.3 KiB
C++
60 lines
2.3 KiB
C++
#include <common/L2Event.h>
|
|
#include <glob/ConfigMag.h>
|
|
#include <zmqc/ZmqcICEI.h>
|
|
#include <zlib/MemVar.h>
|
|
#include <activemq/library/ActiveMQCPP.h>
|
|
|
|
ZmqcICEI::ZmqcICEI() {
|
|
LOG d("ZmqcICEI::ZmqcICEI()");
|
|
|
|
d.Info() << "start!" << endl;
|
|
ConfigMag configmag("CRGS");
|
|
string server = configmag.ReadProperty("activemq", "server");
|
|
d.Info() << "server:" << server << endl;
|
|
activemq::library::ActiveMQCPP::initializeLibrary();
|
|
// Handle<ConsumerMQ> tHDL = new
|
|
// ConsumerMQ("failover:(tcp://10.10.67.237:61616)","/queue/reAlarm",0,"baosight/zinit");
|
|
|
|
// Handle<ConsumerMQ> tHDL3 =
|
|
// new ConsumerMQ(server, "/queue/"+string(CMemVar::Const()->UnitNo)+"_staParams", 0, "baosight/eqpstats");
|
|
// IceUtil::ThreadControl tTC3 = tHDL3->start();
|
|
|
|
// Handle<ConsumerMQ> tHDL =
|
|
// new ConsumerMQ(server, "/queue/"+string(CMemVar::Const()->UnitNo)+"_timeset", 0, "baosight/zinit");
|
|
// IceUtil::ThreadControl tTC = tHDL->start();
|
|
|
|
Handle<ConsumerMQ> tHDL4 =
|
|
new ConsumerMQ(server, "/queue/"+string(CMemVar::Const()->UnitNo)+"_invokeModel", 0, "baosight/eqpalg-task");
|
|
IceUtil::ThreadControl tTC4 = tHDL4->start();
|
|
|
|
Handle<ConsumerMQ> tHDL2 =
|
|
new ConsumerMQ(server, "/queue/"+string(CMemVar::Const()->UnitNo)+"_eqpalg", 0, "baosight/eqpalg-mon");
|
|
IceUtil::ThreadControl tTC2 = tHDL2->start();
|
|
|
|
Handle<ConsumerMQ> tHDL1 =
|
|
new ConsumerMQ(server, "/queue/"+string(CMemVar::Const()->UnitNo)+"_repair", false, "baosight/eqpm");
|
|
IceUtil::ThreadControl tTC1 = tHDL1->start();
|
|
}
|
|
|
|
ZmqcICEI::~ZmqcICEI() { LOG d("ZmqcICEI::~ZmqcICEI()");
|
|
activemq::library::ActiveMQCPP::shutdownLibrary();
|
|
}
|
|
|
|
void ZmqcICEI::SendDataShort(::Ice::Int eventNo, const ::Ice::ByteSeq &seq,
|
|
::Ice::Int length, const Ice::Current ¤t) {
|
|
LOG d("ZmqcICEI::SendDataShort()");
|
|
d.Info() << "eventNo:" << eventNo << " message" << endl;
|
|
;
|
|
}
|
|
|
|
void ZmqcICEI::SendDataLong(::Ice::Int eventNo, const ::Ice::ByteSeq &seq,
|
|
::Ice::Int length, const ::std::string &sender,
|
|
const ::std::string &reciver,
|
|
const ::std::string &aditional,
|
|
const Ice::Current ¤t) {}
|
|
|
|
void ZmqcICEI::TimeNotify(::Ice::Int eventNo, const ::Ice::ByteSeq &seq,
|
|
const Ice::Current ¤t) {
|
|
LOG d("ZmqcICEI::TimeNotify()");
|
|
}
|