update README.md
This commit is contained in:
parent
f2ac01de34
commit
883172368a
224
README.md
224
README.md
|
|
@ -1,117 +1,107 @@
|
||||||
[](https://travis-ci.org/mbroadst/qamqp)
|
[](https://travis-ci.org/mbroadst/qamqp)
|
||||||
[](https://coveralls.io/r/mbroadst/qamqp?branch=master)
|
[](https://coveralls.io/r/mbroadst/qamqp?branch=master)
|
||||||
|
|
||||||
QAMQP
|
QAMQP
|
||||||
=============
|
=============
|
||||||
Qt4/Qt5 implementation of AMQP 0.9.1.
|
A Qt4/Qt5 implementation of AMQP 0.9.1, focusing primarily on RabbitMQ support.
|
||||||
|
|
||||||
Implement
|
Usage
|
||||||
------------
|
------------
|
||||||
### Connection
|
* [hello world](https://github.com/mbroadst/qamqp/tree/master/tutorials/helloworld)
|
||||||
work with socket connections
|
* [pubsub](https://github.com/mbroadst/qamqp/tree/master/tutorials/pubsub)
|
||||||
|
* [routing](https://github.com/mbroadst/qamqp/tree/master/tutorials/routing)
|
||||||
* start - start connection negotiation
|
* [rpc](https://github.com/mbroadst/qamqp/tree/master/tutorials/rpc)
|
||||||
* startok - select security mechanism and locale
|
* [topics](https://github.com/mbroadst/qamqp/tree/master/tutorials/topics)
|
||||||
* tune - propose connection tuning parameters
|
* [work queues](https://github.com/mbroadst/qamqp/tree/master/tutorials/workqueues)
|
||||||
* tuneok - negotiate connection tuning parameters
|
|
||||||
* open - open connection to virtual host
|
Documentation
|
||||||
* openok - signal that connection is ready
|
------------
|
||||||
* close - request a connection close
|
Coming soon!
|
||||||
* closeok - confirm a connection close
|
|
||||||
|
|
||||||
### Channel
|
AMQP Support
|
||||||
work with channels
|
------------
|
||||||
|
|
||||||
* open - open a channel for use
|
#### connection
|
||||||
* openok - signal that the channel is ready
|
| method | supported |
|
||||||
* close - request a channel close
|
| --- | --- |
|
||||||
* closeok - confirm a channel close
|
| connection.start | ✓ |
|
||||||
|
| connection.start-ok | ✓ |
|
||||||
### Exchange
|
| connection.secure | ✓ |
|
||||||
work with exchanges
|
| connection.secure-ok | ✓ |
|
||||||
|
| connection.tune | ✓ |
|
||||||
* declare - verify exchange exists, create if needed
|
| connection.tune-ok | ✓ |
|
||||||
* declareok - confirm exchange declaration
|
| connection.open | ✓ |
|
||||||
* delete - delete an exchange
|
| connection.open-ok | ✓ |
|
||||||
* deleteok - confirm deletion of an exchange
|
| connection.close | ✓ |
|
||||||
|
| connection.close-ok | ✓ |
|
||||||
### Queue
|
|
||||||
work with queues
|
#### channel
|
||||||
|
| method | supported |
|
||||||
* declare - declare queue, create if needed
|
| ------ | --------- |
|
||||||
* declareok - confirms a queue definition
|
| channel.open | ✓ |
|
||||||
* bind - bind queue to an exchange
|
| channel.open-ok | ✓ |
|
||||||
* bindok - confirm bind successful
|
| channel.flow | ✓ |
|
||||||
* unbind - unbind a queue from an exchange
|
| channel.flow-ok | ✓ |
|
||||||
* unbindok - confirm unbind successful
|
| channel.close | ✓ |
|
||||||
* purge - purge a queue
|
| channel.close-ok | ✓ |
|
||||||
* purgeok - confirms a queue purge
|
|
||||||
* delete - delete a queue
|
#### exchange
|
||||||
* deleteok - confirm deletion of a queue
|
| method | supported |
|
||||||
|
| ------ | --------- |
|
||||||
### Basic
|
| exchange.declare | ✓ |
|
||||||
work with basic content
|
| exchange.declare-ok | ✓ |
|
||||||
|
| exchange.delete | ✓ |
|
||||||
* qos - specify quality of service
|
| exchange.delete-ok | ✓ |
|
||||||
* qosok - confirm the requested qos
|
|
||||||
* consume - start a queue consumer
|
#### queue
|
||||||
* consumeok - confirm a new consumer
|
| method | supported |
|
||||||
* publish - publish a message
|
| ------ | --------- |
|
||||||
* deliver - notify the client of a consumer message
|
| queue.declare | ✓ |
|
||||||
* get - direct access to a queue
|
| queue.declare-ok | ✓ |
|
||||||
* getok - provide client with a message
|
| queue.bind | ✓ |
|
||||||
* getempty - indicate no messages available
|
| queue.bind-ok | ✓ |
|
||||||
* ack - acknowledge one or more messages
|
| queue.unbind | ✓ |
|
||||||
|
| queue.unbind-ok | ✓ |
|
||||||
Usage
|
| queue.purge | ✓ |
|
||||||
------------
|
| queue.purge-ok | ✓ |
|
||||||
|
| queue.delete | ✓ |
|
||||||
Test::Test()
|
| queue.delete-ok | ✓ |
|
||||||
{
|
|
||||||
QUrl con(QString("amqp://guest:guest@localhost:5672/"));
|
#### basic
|
||||||
client_ = new QAMQP::Client(this);
|
| method | supported |
|
||||||
connect(client_, SIGNAL(connected()), this, SLOT(connected()));
|
| ------ | --------- |
|
||||||
client_->open(con);
|
| basic.qos | ✓ |
|
||||||
exchange_ = client_->createExchange("test.test2");
|
| basic.consume | ✓ |
|
||||||
queue_ = client_->createQueue("test.my_queue", exchange_->channelNumber());
|
| basic.consume-ok | ✓ |
|
||||||
|
| basic.cancel | ✓ |
|
||||||
connect(queue_, SIGNAL(declared()), this, SLOT(declared()));
|
| basic.cancel-ok | ✓ |
|
||||||
connect(queue_, SIGNAL(messageReceived(QAMQP::Queue * )), this, SLOT(newMessage(QAMQP::Queue *)));
|
| basic.publish | ✓ |
|
||||||
|
| basic.return | ✓ |
|
||||||
}
|
| basic.deliver | ✓ |
|
||||||
|
| basic.get | ✓ |
|
||||||
void Test::connected()
|
| basic.get-ok | ✓ |
|
||||||
{
|
| basic.get-empty | ✓ |
|
||||||
exchange_->declare("fanout");
|
| basic.ack | ✓ |
|
||||||
queue_->declare();
|
| basic.reject | ✓ |
|
||||||
exchange_->bind(queue_);
|
| basic.recover | ✓ |
|
||||||
}
|
|
||||||
|
#### tx
|
||||||
void Test::declared()
|
| method | supported |
|
||||||
{
|
| ------ | --------- |
|
||||||
exchange_->publish("Hello world", exchange_->name());
|
| tx.select | X |
|
||||||
queue_->setQOS(0,10);
|
| tx.select-ok | X |
|
||||||
queue_->setConsumerTag("qamqp-consumer");
|
| tx.commit | X |
|
||||||
queue_->consume(QAMQP::Queue::coNoAck);
|
| tx.commit-ok | X |
|
||||||
}
|
| tx.rollback | X |
|
||||||
|
| tx.rollback-ok | X |
|
||||||
void Test::newMessage(QAMQP::Queue * q)
|
|
||||||
{
|
#### confirm
|
||||||
while (q->hasMessage())
|
| method | supported |
|
||||||
{
|
| ------ | --------- |
|
||||||
QAMQP::MessagePtr message = q->getMessage();
|
| confirm.select | ✓ |
|
||||||
qDebug("+ RECEIVE MESSAGE");
|
| confirm.select-ok | ✓ |
|
||||||
qDebug("| Exchange-name: %s", qPrintable(message->exchangeName));
|
|
||||||
qDebug("| Routing-key: %s", qPrintable(message->routeKey));
|
Credits
|
||||||
qDebug("| Content-type: %s", qPrintable(message->property[QAMQP::Frame::Content::cpContentType].toString()));
|
------------
|
||||||
if(!q->noAck())
|
* Thank you to [@fuCtor](https://github.com/fuCtor) for the original implementation work.
|
||||||
{
|
|
||||||
q->ack(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Credits
|
|
||||||
================
|
|
||||||
Thank you [@mdhooge](https://github.com/mdhooge) for tutorials inspired by https://github.com/jonnydee/nzmqt
|
|
||||||
|
|
||||||
[](http://githalytics.com/fuCtor/QAMQP)
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue