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
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.
- 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.
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.
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.
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.
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.
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
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.
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
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
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
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
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.
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
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.
When a socket error occurs the string version of the error is now
stored in QAmqpClient's internal errorString variable, providing
access to the string to users of the client.
This adds preliminary support for SSL connections to a RabbitMQ
server. Instead of providing two clients (QAmqpClient/QAmqpSslClient),
the SSL support was directly rolled into QAmqpClient itself, providing
signals/slots to deal with errors (sslErrors/ignoreSslErrors), and
the ability to assign a QSslConfiguration. Travis testing for ssl
support is currently disabled, pending a solution to a travis
limitation for starting ssl listeners
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
QAmqpQueue and QAmqpExchange both now have an isDeclared property,
and QAmqpChannel::isOpened was renamed to isOpen to more closely follow
Qt style/api guidelines