Merge branch 'master' of https://github.com/fuCtor/QAMQP
This commit is contained in:
commit
26e8614c27
14
README.md
14
README.md
|
|
@ -67,18 +67,22 @@ Usage
|
||||||
{
|
{
|
||||||
QUrl con(QString("amqp://guest:guest@localhost:5672/"));
|
QUrl con(QString("amqp://guest:guest@localhost:5672/"));
|
||||||
client_ = new QAMQP::Client(this);
|
client_ = new QAMQP::Client(this);
|
||||||
|
connect(client_, SIGNAL(connected()), this, SLOT(connected()));
|
||||||
client_->open(con);
|
client_->open(con);
|
||||||
exchange_ = client_->createExchange("test.test2");
|
exchange_ = client_->createExchange("test.test2");
|
||||||
exchange_->declare("fanout");
|
|
||||||
|
|
||||||
queue_ = client_->createQueue("test.my_queue", exchange_->channelNumber());
|
queue_ = client_->createQueue("test.my_queue", exchange_->channelNumber());
|
||||||
queue_->declare();
|
|
||||||
exchange_->bind(queue_);
|
|
||||||
|
|
||||||
connect(queue_, SIGNAL(declared()), this, SLOT(declared()));
|
connect(queue_, SIGNAL(declared()), this, SLOT(declared()));
|
||||||
connect(queue_, SIGNAL(messageRecieved()), this, SLOT(newMessage()));
|
connect(queue_, SIGNAL(messageRecieved()), this, SLOT(newMessage()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Test::connected()
|
||||||
|
{
|
||||||
|
exchange_->declare("fanout");
|
||||||
|
queue_->declare();
|
||||||
|
exchange_->bind(queue_);
|
||||||
|
}
|
||||||
|
|
||||||
void Test::declared()
|
void Test::declared()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue