Commit Graph

290 Commits

Author SHA1 Message Date
Matt Broadstone 5d85db70de Merge pull request #36 from droidsyer/patch-1
arguments and qamqpInterface.pri
2016-02-29 12:05:32 -05:00
Ernesto De Stefano 61ddeb0ad5 Merge pull request #1 from droidsyer/patch-2
Added qamqpInterface.pri
2016-02-29 17:29:12 +01:00
Ernesto De Stefano d9dcf07723 Create qamqpInterface.pri
With this .pri file, you can import this library by setting the variable QAMQP_HOME

You need to put include and lib files into same directory of qamqpInterface.pri.

include($${QAMQP_HOME}/qamqpInterface.pri)
2016-02-29 17:22:51 +01:00
laboratorio 20c9d69875 QAmqpTable arguments derives from channel private. 2016-02-04 16:31:10 +01:00
Ernesto De Stefano 9d567c4aff Update qamqpqueue.h 2016-02-04 14:21:45 +01:00
Ernesto De Stefano cbfa5d4771 Update qamqpqueue.cpp 2016-02-04 14:17:42 +01:00
Ernesto De Stefano cbc2db02e6 Update qamqpqueue_p.h 2016-02-04 14:17:13 +01:00
Ernesto De Stefano 8a86c1350a Update qamqpqueue_p.h 2016-02-04 11:05:28 +01:00
Ernesto De Stefano 39d4b5e086 Update qamqpqueue.h 2016-02-04 10:59:09 +01:00
Ernesto De Stefano b1cd8e48c3 Update qamqpqueue.cpp 2016-02-03 22:59:42 +01:00
Matt Broadstone f6777e66df refactor(channels): move resetInternalState to private impls 2015-11-20 08:07:21 -05:00
Matt Broadstone 3781006a1e fix(QAmqpChannelHash): add missing include 2015-11-19 17:50:05 -05:00
Matt Broadstone b746f45af5 test(helloworld): enable autoReconnect in test to show off feature 2015-11-19 17:46:39 -05:00
Matt Broadstone a7f9a3a837 chore(version): bump version to 0.4.0 2015-11-19 17:46:23 -05:00
Matt Broadstone 0c96cfca52 refactor(QAmqpChannel): reset channel state on disconnect
We now track channels in QAmqpChannelHash for use across reconnects
however, the internal state of these channels was not being reset
when the connection was reestablished. This provides a way to do
that for not only channels, but both of its subclasses
2015-11-19 17:43:31 -05:00
Matt Broadstone c025333204 fix(QAmqpClient): enable autoReconnect after forced disconnect 2015-11-19 17:09:56 -05:00
Matt Broadstone c113611b05 fix(QAmqpClient): simulate closeOk on forced disconnect 2015-11-19 17:03:55 -05:00
Matt Broadstone 73d80de53a Merge pull request #27 from vrtsystems/state-machine-client
Add storage of Queues and Exchanges to QAmqpClient.
2015-06-08 09:27:11 -04:00
Stuart Longland fd1b19b3b6 QAmqpClient: Substitute static_cast for qobject_cast 2015-05-02 21:10:22 +10:00
Stuart Longland 60f680a4ef QAmqpChannelHash: Substitute static_cast for qobject_cast 2015-05-02 21:10:08 +10:00
Stuart Longland e43224877f QAmqpChannelHash: Store empty/null strings as null strings. 2015-05-02 21:02:50 +10:00
Stuart Longland c171b5c337 QAmqpChannelHash: Add contains function 2015-05-02 21:01:07 +10:00
Stuart Longland 3e5cf05256 QAmqpChannelHash: Coding style fixes. 2015-05-02 20:52:27 +10:00
Stuart Longland cd655d3f1d QAmqpExchange redeclaration test: Re-open a closed channel.
If the server closes the channel on us, re-open it before removing the
exchange.
2015-05-02 20:44:17 +10:00
Stuart Longland 2b707d53de QAmqpChannel: Emit closed signal when server closes.
When we initiate a Close, we get a CloseOk in response and on receipt of
the CloseOk, we mark the channel as closed and emit a signal to notify
everyone else.

Great.  Now what happens when the server closes the channel?  We emit a
CloseOk, then… nothing.  We do nothing.  This fixes this problem, moving
the notification/marking logic to a new function and calling that on
both Close (sent from server) and CloseOk.
2015-05-02 20:41:19 +10: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
Stuart Longland f79e96fae8 QAmqpExchange tests: Wait for destroyed signal.
Maybe my laptop is too quick, but it seems the exchange hangs around a
little too long for this test to pass.
2015-04-14 09:10:07 +10:00
Stuart Longland 31f90a17a0 QAmqpChannelHash: Tweak channelDestroyed.
- DON'T rely on sender()
- DON'T expect to be able to cast the QObject to a QAmqpChannel and have
  name() work.

This isn't as efficient as I'd like, but it doesn't crash either.
2015-04-13 08:28:09 +10:00
Stuart Longland ae4f1b336e QAmqpClient: Re-factor using QAmqpChannelHash. 2015-04-13 08:28:04 +10:00
Stuart Longland beb89b30b8 QAmqpChannelHash: Container for storing channels. 2015-04-13 08:27:57 +10:00
Stuart Longland 673274345c QAmqpClient: Fix 'does not have class type' error.
Something in the back of my mind had me thinking iterator.value was a
field not a function.  No idea why.  Fixed now.
2015-04-13 08:27:47 +10:00
Stuart Longland 6599fdbc63 QAmqpClient: Add garbage collection slot.
On 'destroyed', do a clean up of our exchanges and queues.
2015-04-13 08:27:41 +10:00
Stuart Longland bca3f5f8bd QAmqpClient: Fix attempt to assign const QString
How on earth did I expect that to work?  Morning cup of tea hasn't
kicked in yet, of course I can't assign a const QString passed by
reference.

Fix egregious PEBKAC-caused compile error.
2015-04-13 08:27:31 +10:00
Stuart Longland 2622a482b4 QAmqpClient: Store the nameless exchange too.
Since there will be probably many requests for that one.  If we're
passed in QString() instead of QString(""), we overwrite that with the
latter to ensure the name field is never NULL.
2015-04-13 08:27:02 +10:00
Stuart Longland fd4eaef364 QAmqpClient: Use QPointer to store exchanges and queues.
Just discovered you *CAN* delete them yourself safely, and one of the
tests does.  So best to not assume they'll get deleted by other parties.

QPointer takes care of this problem for us.
2015-04-13 08:26:37 +10:00
Stuart Longland ae77ff56e0 QAmqpClientPrivate: Store pointers to named queues and exchanges. 2015-04-13 08:26:20 +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 5c7eca5f07 Merge pull request #20 from TaDaweb/frame_write_timeout
Configurable writeTimeout
2015-03-17 22:14:54 -04:00
Gauthier Brion b27ba8cb64 Calling writeFrame with its static form 2015-03-16 16:27:23 +01:00
Gauthier Brion 2c330566e5 Allowing to configure the write timeout of AMQP frames 2015-03-16 15:03:23 +01:00
Matt Broadstone 9b3288ca9d only attempt to close socket if its open
On socket errors we always close the socket per amqp specification,
however there is no need to do so if the connection has already been
forcibly closed from the server side. This causes recursive loops
when using SSL connections
2015-03-05 15:18:03 -05:00
Matt Broadstone 6cc9ee7457 allow access to socket state, enable low latency options
Provides an accessor and change signal for the state of QAmqpClients
internal ssl socket. This also defaults the internal socket to low
latency mode, as well as keep alive.
2015-03-04 17:55:04 -05:00
Matt Broadstone a4bc1b5f4e show example of queued calls on QAmqpExchange
This gives an example of how you can use QMetaObject::invokeMethod to
call a QAmqpExchange from another thread. Also, moved the qRegisterMetaType
for QAmqpMessage::PropertyHash to the ctor of QAmqpClientPrivate
2015-02-27 09:13:17 -05:00
Matt Broadstone 4379e991c6 properly tune heartbeat delay
tuneOk was only properly tuning the heartbeat delay value for values
larger than the default delay sent by the server. This changes that
behavior to send back the requested heartbeat delay if one was provided
2015-02-27 08:16:22 -05:00
Matt Broadstone 07ad9d8e4f implement rpc example
This is a bit of a contrived example, since I explcitly have left
out a synchronous API for QAMQP, however, it still shows how one can
use the CorrelationID and ReplyTo properties to implement RPC behavior
2015-02-15 16:38:12 -05:00
Matt Broadstone 3c2a039c08 convert methods to actions where it makes sense
QAmqpExchange and QAmqpQueue both have a number of actions associated
with them that should be defined as slots (especially for a potential
future where they are exported as QML objects). This is a step in the
direction of fully making these classes scriptable
2015-02-15 16:36:16 -05:00
Matt Broadstone d45f5b09d6 Merge pull request #11 from mem/master
Fix issues with channelNumber's type and nextChannelNumber
2015-02-11 17:23:01 -05:00
Marcelo E. Magallon 2652206d18 Increment nextChannelNumber only once
nextChannelNumber is being incremented twice. When the counter wraps
around it starts declaring already existing channels and the AMQP server
disconnects the client. This patch doubles the number of channels that
can be created before this happens.
2015-02-11 16:13:27 -06:00
Marcelo E. Magallon 79226ccb35 Change channel id type to quint16
My reading of the spec is that channel numbers are unsigned.
2015-02-11 16:12:36 -06:00
Matt Broadstone 99b0d32f3f use sslConfiguration on socket
A public accessor and mutator was provided for using a QSslConfiguration
with a QAmqpClient, however the configuration was never actually assigned
to the internal socket. This patch fixes that, and removes the needless
storage of a copy of the QSslConfiguration as well
2015-02-09 21:30:23 -05:00