Commit Graph

281 Commits

Author SHA1 Message Date
Matt Broadstone e6b69010e4 remove QAmqpSslClient
Since you can provide amqps endpoints, it makes no sense to have a
separate class for SSL client support. This functionality will be
merged directly into QAmqpClient
2015-01-31 12:57:26 -05:00
Matt Broadstone 009c3131f5 add two new properties, changed the name of one
QAmqpQueue and QAmqpExchange both now have an isDeclared property,
and QAmqpChannel::isOpened was renamed to isOpen to more closely follow
Qt style/api guidelines
2015-01-31 12:44:25 -05:00
Matt Broadstone bb13e2e830 initialize timeout to 0 for autoReconnect
Previously timeout was initialized to -1, which meant when it went
through delay loops it would always use a negative value. This closes
issue #9
2015-01-29 18:57:11 -05:00
Matt Broadstone 883172368a update README.md 2015-01-19 14:33:27 -05:00
Matt Broadstone f2ac01de34 add preliminary support for publisher acknowledgements
RabbitMQ supports publish confirms (Publisher Acknowledgements) on
a given channel. This enables the user to toggle this functionality
and ensure that published messages are in fact published.
2015-01-19 13:51:20 -05:00
Matt Broadstone 8be77044ef micro optimizations
These are paths that we can optimize for since they are unlikely
to occur.
2015-01-15 07:27:19 -05:00
Matt Broadstone ad19dc326d Don't install test cases
Qt5's testcase feature installs the tests by default, unless no_testcase_installs
is defined. This adds this, and closes issue #8
2014-09-30 08:06:30 -04:00
Matt Broadstone f35e939446 Add coveralls support to travis builds 2014-09-16 17:42:21 -04:00
Matt Broadstone 98f40f5589 Forward socket errors to user
Provide accessors and a signal for socket errors, so that the user
can react accordingly. This closes issue #6
2014-09-16 11:55:36 -04:00
Matt Broadstone 7242a64a2f clean up QAmqpFrame paths
- opt for QDataStream overloads instead of read ctor and toStream methods
- removed some unneccesary prefixes to Type and MethodClass enums
- removed documentation from header (this is coming back!)
- cleaned up some confusing code paths, removed unneccessary methods (like readHeader/writeHeader)
2014-09-15 15:45:20 -04: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 9887fa2333 rpath improvements
Improve on the previous commit adding QMAKE_RPATHDIR. We can now use
rpath for out-of-source builds, as well as on osx.
2014-09-13 18:28:05 -04:00
Adam Majer 1eea37cb6f cleanup frame processing and payload alignment
- remove a level of indentation making frame processing easier to read
- use qFromBigEndian(const uchar *src) to ensure alignment of payload size
2014-09-12 20:39:43 -04:00
Adam Majer 4ed42b74d5 Make sure we can find the library in unit tests 2014-09-12 20:28:58 -04:00
Adam Majer 7ff0dfab1b Use stack instead of broken usage of QByteBuffer
The internal buffer should not be used blindly when reading
Frame::HEADER_SIZE, as it is error prone and adds nothing over reading
on the stack (and it's only 7 bytes). There are places in this class
where buffer.clear() is called.
2014-09-12 13:15:52 -04:00
Matt Broadstone 4bfef5f81f initially reserve HEADER_SIZE for buffer 2014-09-12 08:22:04 -04:00
Matt Broadstone dab2cfe08f fix parsing of connection strings with default vhost
We should assume that a trailing slash at the end of a connection
URI means to use the default vhost of /. This fixes issue #2.
2014-09-12 08:15:34 -04:00
Matt Broadstone d7dbcb892c add swap and move support for QAMQP::Message
- declared typeinfo as Q_MOVABLE_TYPE
- declared message as shared
2014-09-11 16:29:34 -04:00
Matt Broadstone 7e151dfc7b fix windows build
- add equality operator to QAMQP::Message
- add qHash for QAMQP::Message... because MSVC
2014-09-11 15:37:46 -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 840efb037d refactor Frame::Content to use Message::Property 2014-08-26 14:45:50 -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 81cdb98c86 add script for generating test coverage with gcov/lcov
These lines are taken directly from the gcov.prf qmake feature file
2014-08-07 14:18:27 -04:00
Matt Broadstone 695f7d2997 complete close handshakes properly for Client and Channel
We had frame handlers for Close messages from the server, but were not
doing our due diligence and sending a corresponding CloseOk back to the
server after processing. It seems RabbitMQ is generous in this case, but
at least we're doing it the right way now
2014-08-07 14:12:28 -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 fb93bd8096 update build status tag to qamqp, from qamqp-ng 2014-08-06 22:38:36 -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 bb2e9881ea short strings are latin1 encoded not utf8 2014-08-05 15:45:25 -04:00
Matt Broadstone 3ce39c273f use compatible type max definitions
UINT8_MAX/UINT16_MAX only work on osx and glibc builds with certain
defines.
2014-08-05 15:28:19 -04:00
Matt Broadstone fdb8dddc14 initialize network variables
there were a number of variables copied over from the legacy Network
class that were not properly initialized.
2014-08-05 14:38:13 -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 4ea3bdb851 don't store content message in Content frame
the message was being needlessly duplicated into the Content frame,
now we only store the size there to be sent out, rather than the whole
message

remove QAMQP prefix in authenticator
2014-08-05 14:34:03 -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 a2c6af748b improve Client test coverage 2014-07-29 13:45:53 -04:00
Matt Broadstone 77134f0279 frame cleanup
removed crufty code, improve test coverage
2014-07-29 13:35:01 -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 a8feef7d82 update build badge
qamqp-ng => qamqp
2014-07-28 15:25:31 -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