Go to file
Matt Broadstone d5cc6258c6 refactor type handling in QAMQP
There are two distinctive type sets in AMQP, the basic AMQP types
and then the superset of Table value types. This commit attempts to
make that distinction more clear by the addition of a Table class.
Basically, AMQP value type read/write support is left in Frame for the
time being, while table value field read/write support has been moved
to the Table class. Also, a number of type differences exist between
the spec and rabbitmq's binary parser (noted in the errata page) which
were not previously honored.
2014-08-05 14:34:12 -04:00
src refactor type handling in QAMQP 2014-08-05 14:34:12 -04:00
tests refactor type handling in QAMQP 2014-08-05 14:34:12 -04:00
tutorials ensure consuming only occurs once per queue 2014-06-24 10:30:05 -04:00
.gitignore correct byte-order for integer read 2012-09-30 16:12:20 +06:00
.travis.yml update travis config for qt5 builds, add build status to README.md 2014-06-03 22:16:57 -04:00
Doxyfile [+] Start write documentation 2012-07-18 09:18:04 -07:00
LICENSE.html 2012-01-29 07:43:56 -08:00
README.md update build badge 2014-07-28 15:25:31 -04:00
qamqp.pri export it all! this may be unnecessary, more investigation needed 2014-05-28 15:33:15 -04:00
qamqp.pro begin to add rabbitmq tutorials 2014-06-18 10:31:28 -04:00

README.md

Build Status

QAMQP

Qt4/Qt5 implementation of AMQP 0.9.1.

Implement

Connection

work with socket connections

  • start - start connection negotiation
  • startok - select security mechanism and locale
  • tune - propose connection tuning parameters
  • tuneok - negotiate connection tuning parameters
  • open - open connection to virtual host
  • openok - signal that connection is ready
  • close - request a connection close
  • closeok - confirm a connection close

Channel

work with channels

  • open - open a channel for use
  • openok - signal that the channel is ready
  • close - request a channel close
  • closeok - confirm a channel close

Exchange

work with exchanges

  • declare - verify exchange exists, create if needed
  • declareok - confirm exchange declaration
  • delete - delete an exchange
  • deleteok - confirm deletion of an exchange

Queue

work with queues

  • declare - declare queue, create if needed
  • declareok - confirms a queue definition
  • bind - bind queue to an exchange
  • bindok - confirm bind successful
  • unbind - unbind a queue from an exchange
  • unbindok - confirm unbind successful
  • purge - purge a queue
  • purgeok - confirms a queue purge
  • delete - delete a queue
  • deleteok - confirm deletion of a queue

Basic

work with basic content

  • qos - specify quality of service
  • qosok - confirm the requested qos
  • consume - start a queue consumer
  • consumeok - confirm a new consumer
  • publish - publish a message
  • deliver - notify the client of a consumer message
  • get - direct access to a queue
  • getok - provide client with a message
  • getempty - indicate no messages available
  • ack - acknowledge one or more messages

Usage

Test::Test()	
{
	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");
	queue_ = client_->createQueue("test.my_queue", exchange_->channelNumber());
		
	connect(queue_, SIGNAL(declared()), this, SLOT(declared()));
	connect(queue_, SIGNAL(messageReceived(QAMQP::Queue * )), this, SLOT(newMessage(QAMQP::Queue *)));	

}

void Test::connected()
{
	exchange_->declare("fanout");		
	queue_->declare();
	exchange_->bind(queue_);
}

void Test::declared()
{
	exchange_->publish("Hello world", exchange_->name());
	queue_->setQOS(0,10);
	queue_->setConsumerTag("qamqp-consumer");
	queue_->consume(QAMQP::Queue::coNoAck);
}

void Test::newMessage(QAMQP::Queue * q)
{
	while (q->hasMessage())
	{
		QAMQP::MessagePtr message = q->getMessage();
		qDebug("+ RECEIVE MESSAGE");
		qDebug("| Exchange-name: %s", qPrintable(message->exchangeName));
		qDebug("| Routing-key: %s", qPrintable(message->routeKey));
		qDebug("| Content-type: %s", qPrintable(message->property[QAMQP::Frame::Content::cpContentType].toString()));
		if(!q->noAck())
		{
			q->ack(message);
		}
	}
}

Credits

Thank you @mdhooge for tutorials inspired by https://github.com/jonnydee/nzmqt

githalytics.com alpha