update Readme

Rewrite usage code.
This commit is contained in:
Alexey Shcherbakov 2013-03-31 11:31:49 +06:00
parent 13fa6ec71a
commit ac8190b4a0
1 changed files with 9 additions and 5 deletions

View File

@ -67,18 +67,22 @@ Usage
{
QUrl con(QString("amqp://guest:guest@localhost:5672/"));
client_ = new QAMQP::Client(this);
connect(client_, SIGNAL(connected()), this, SLOT(connected()));
client_->open(con);
exchange_ = client_->createExchange("test.test2");
exchange_->declare("fanout");
queue_ = client_->createQueue("test.my_queue", exchange_->channelNumber());
queue_->declare();
exchange_->bind(queue_);
connect(queue_, SIGNAL(declared()), this, SLOT(declared()));
connect(queue_, SIGNAL(messageRecieved()), this, SLOT(newMessage()));
}
void Test::connected()
{
exchange_->declare("fanout");
queue_->declare();
exchange_->bind(queue_);
}
void Test::declared()
{