Commit Graph

47 Commits

Author SHA1 Message Date
Matt Broadstone 3b2a853707 Merge pull request #46 from johnzhanghua/master
timestamp in AMQP-0-9-1 should be seconds other than milliseconds
2016-05-26 08:26:47 -04:00
Stuart Longland 568dc6770a QAmqpQueue Tests: Wait for destroyed signal.
Same issue, maybe with the state machine the QAmqpQueue takes a little
longer to disappear.
2015-04-14 09:10:25 +10:00
Matt Broadstone 943180da27 fix(multiple-consume): only send consume message once
Previously if multiple attempts to call consume were made, then
QAmqpQueue would send a frame for each of them leading to multiple
consumer tags and general confusion. This guards from calling
consume multiple times.
2015-04-07 14:30:18 -04:00
Matt Broadstone 4640a9ad6a cleanup frame handlers on channel deletion
In cases where exchanges and queues are added and deleted during
an extended use of a QAmqpClient, the client should internally cleanup
the frame handlers registered for those objects. This patch does that
as well as providing two test cases verifying this behavior for both
QAmqpQueue and QAmqpExchange.
2015-02-06 16:12:58 -05:00
Matt Broadstone 10ab1423c2 remove QAMQP namespace
This is a very small library, so there is no real pressing need for
a library namespace. Further, the namespacing actually makes it rather
difficult to work with in some cases. Opting for a more "Qt" style
class naming scheme, using the QAmqp class prefix
2014-09-15 13:26:48 -04:00
Matt Broadstone 84746ff77c handle messages with empty payloads
If a message is delivered with an empty body, we were not previously
enqueuing the message. This fixes issue #43
2014-09-10 22:39:13 -04:00
Matt Broadstone 6a3d355de2 rename amqp_ files to qamqp
amqp_<filename> is used in at least two other C/C++ projects related
to amqp, so this commit changes all our source to use a qamqp header.
This avoids potential clashes, and is more in line with Qt style
2014-08-26 15:05:39 -04:00
Matt Broadstone bdd9bae8ea refactor ValueType
moved ValueType from the QAMQP namespace to QAMQP::MetaType namespace
to avoid clashes with very generic enum strings
2014-08-26 14:02:43 -04:00
Matt Broadstone 0ccb3035cd move QAMQP::Frame to private API
QAMQP::Frame used to be public API mostly for MessageProperties. There
is no longer a need to keep this API public, as it should all be wrapped
with the cleaner Message/Queue/Exchange/Client API set
2014-08-26 09:57:08 -04:00
Matt Broadstone 0bc1c32bd8 add test for sharing a channel
Though it's not necessarily recommended (per spec), Channels can be
shared by multiple Exchanges and Queues. I've added a test here showing
that's possible with QAMQP
2014-08-08 17:09:52 -04:00
Matt Broadstone 870af7b5d4 split channel tests into their own executable
Refactored tests specific to QAMQP::Channel into its own full test
case, as there are more on the way
2014-08-08 17:09:51 -04:00
Matt Broadstone baa5c1de3e refactor Channel::channelClose to just Channel::close 2014-08-08 17:09:51 -04:00
Matt Broadstone 1ebe3bd667 implement flow frame handling support
Fleshed out the previously unimplemented flow control frame handling,
added an auto test for it. Also refactored out the stateChanged ChannelPrivate
method, if we need proper state support in the future it will be added with
a better implementation
2014-08-07 13:52:09 -04:00
Matt Broadstone 6291bb7f42 add auto test for channel close
improve code coverage for tests by including a test for Channel::closeChannel
to both Exchange and Queue test suites
2014-08-06 22:35:46 -04:00
Matt Broadstone 9fbd0a852f add tests for non-delayed declaration
existing tests have been immediately declaring queues and exchanges, and
not testing non-delayed declaration (queue/exchange is OPEN when declaration
occurs). these new tests cover this case
2014-08-06 09:03:34 -04:00
Matt Broadstone 88e0d0827a add autotest for message properties
enhance test coverage around message properties, allowing for better
refactoring of the properties in general.
2014-08-05 14:34:12 -04:00
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
Matt Broadstone d9d2a677b9 remove queue in delayedBind
since the queue is not set to be consumed, it doesn't automatically
clean up.
2014-07-29 13:51:07 -04:00
Matt Broadstone a75307ae9f check standard message headers
improve code coverage by checking a few standard message headers
during queue autotests
2014-07-29 13:26:18 -04:00
Matt Broadstone fe7f9f09ef verify queue options
improve test coverage by validating queue options on declaration
2014-07-29 13:02:24 -04:00
Matt Broadstone 1083f4db3a test delayed queue bindings
improve code coverage by adding a test for delayed declaration and
bindings of queues. also uncovered a bug with disconnectFromHost in
Client
2014-07-29 12:57:15 -04:00
Matt Broadstone 254a0fbf54 test binding to Exchange objects
improve test coverage for binding using objects rather than strings
2014-07-29 12:47:26 -04:00
Matt Broadstone 75f7882d1c update flakey get test 2014-07-28 17:55:30 -04:00
Matt Broadstone 4a0fa8bf9c fix flakey qos test
the qos autotest required initially for us to wait for messages to
be added to the queue before running the test, and this was flakey
at best. these changes make it much more dependable
2014-07-28 12:58:37 -04:00
Matt Broadstone fa132d7c72 guarantee frames are written
wait for the END frame to be written, guaranteeing that data will
be written when you think it has been.
2014-07-28 11:36:52 -04:00
Matt Broadstone 5c6cd23e10 move property definition/access to Message
MessageProperties is currently defined in Frame::Content, which makes it
cumbersome to use when working directly with a Message itself. I attempted
to make this easier by using typedefs, but it's become pretty obvious that
it belongs in the Message class itself.
2014-07-21 16:54:12 -04:00
Matt Broadstone dec9ef72d3 added test for invalid routing keys
also added a debug message for attempts to write shortstr's greater
than acceptable length.
2014-06-30 18:42:39 -04:00
Matt Broadstone 12a03f959f add qos support to channel
AMQP Basic qos support added to Channel class. There is an option
for global qos which is currently not added. Also, added auto tests
for qos definition, proper qos operation and verifying that RabbitMQ
does not support prefetchSize.
2014-06-26 10:28:58 -04:00
Matt Broadstone 9bd5610ac7 added auto test for issue #33 2014-06-25 21:18:22 -04:00
Matt Broadstone 92384ce7cb add an auto test for synchronous get 2014-06-25 20:54:50 -04:00
Matt Broadstone 8879211c80 refactor queue auto tests
refactored queue declaration code to a single method
added a test for the synchronous Get AMQP api, emitting an empty signal
2014-06-24 21:10:54 -04:00
Matt Broadstone cab23c97cc add support for cancelling a consumer
cancel method and cancelled signal added to Queue, added auto tests
to guarantee conditions surrounding the cancel process
2014-06-24 11:09:19 -04:00
Matt Broadstone c43c2d6788 ensure consuming only occurs once per queue
a Queue can act as a consumer in QAMQP, but previously we did no checks
to ensure that a Queue sent a request to consume only once. This commit
adds API for checking and ensuring that this is the case. Also, I reverted
the changes to allow multiple consumer tags because this was incorrect.
Also included is a new signal "consuming" to notify when consumption occurs,
and auto tests have been updated to use this, as well as verify that it
can only occur once per-consumer
2014-06-24 10:30:05 -04:00
Matt Broadstone b5d77e17e3 revert reordering publish arguments
I originally changed the publishing arguments to take a routingKey first
which is pretty nonstandard across implementations. Reverting for
conformity.
2014-06-17 15:14:23 -04:00
Matt Broadstone 14f9b7e955 semi-complete tests around queue requirements 2014-06-11 16:14:33 -04:00
Matt Broadstone 496e00abb9 move error constants to global namespace 2014-06-11 13:44:30 -04:00
Matt Broadstone 8e2b66677d add roForce to Queue, replace forceRemove 2014-06-10 21:27:59 -04:00
Matt Broadstone 478597063c updated queue tests to include purge test, and reenable removeIfEmpty test 2014-06-10 13:03:52 -04:00
Matt Broadstone 4422924219 convert QAMQP::Queue to a proper QQueue subclass, move MessageProperties to QAMQP namespace 2014-06-10 09:05:42 -04:00
Matt Broadstone aff5fb70b7 added autotests for exclusive queues 2014-06-09 15:10:35 -04:00
Matt Broadstone 50a588e678 allow for creation of a queue with no name, added auto test for validation 2014-06-09 14:07:13 -04:00
Matt Broadstone f11caabb14 add auto test for unbinding from an exchange 2014-06-06 14:40:05 -04:00
Matt Broadstone 8599cec147 - added auto tests for binding to standard AMQP-defined exchanges
- removed name parameter from Queue::declare, reducing confusion. Updated manual test to reflect this change
2014-06-06 13:37:36 -04:00
Matt Broadstone 9b45f2ac58 - added auto tests for remove
- remove now takes flags rather than magical booleans
- fixed a bug delete -> deleteOk in QueuePrivate so we can listen for sync queue destruction
- added error signals to Client(Connection), and Channel
- removed automatic calls to remove a Queue when the channel is closed, or Queue is deleted
  this behavior is already handled by the AutoDelete declare option
2014-06-06 12:10:51 -04:00
Matt Broadstone d9d52e489a Queue::messageReceived no longer passes the queue as a parameter (use sender() if you need it)
fixed qamqp manual test to send key before message
2014-06-05 15:44:14 -04:00
Matt Broadstone 01d792f38d refactor Message to be explicitly shared class, rather than passing
shared pointers around directly
2014-06-05 15:37:41 -04:00
Matt Broadstone eaee35df12 add a test for a default exchange to tst_QAMQPQueue 2014-06-04 10:24:45 -04:00