Commit Graph

97 Commits

Author SHA1 Message Date
Emiel Bruijntjes 84a87d8f93 many methods in the Channel class now take a std::string_view instead of a std::string parameter, and are thus a bit more efficient 2023-02-13 10:27:51 +01:00
Emiel Bruijntjes d1be1063a5 implemented "consumer cancel notifications" (see https://www.rabbitmq.com/consumer-cancel.html) 2022-11-23 22:09:15 +01:00
Peter Eisenlohr 060e42a6dd don't call moved-from callbacks 2022-03-25 16:08:50 +01:00
Peter Eisenlohr fa1181aa63 Added const-ref wrappers to make changes backward-compatible. 2022-03-18 23:53:44 +01:00
Peter Eisenlohr 9c4cfffab8 std::move callbacks 2022-03-15 14:10:45 +01:00
Tony Roussel 6fd0e8f1d5 fix wrong exchange type check in ChannelImpl::declareExchange 2021-11-23 16:00:02 +01:00
Tony Roussel c83708e9bd add x-message-deduplication exchange type
This exchange type exist on RabbitMQ server with the plugin rabbitmq_message_deduplication
This plugin code is available here: https://github.com/noxdafox/rabbitmq-message-deduplication
2021-11-23 14:13:55 +01:00
Raoul Wols 1d25f0acbc
Fixup sync handling for CopiedBuffer 2021-08-10 16:07:21 +02:00
Raoul Wols f0f17cdf18
Remove unused ConsumedMessage class 2021-07-28 12:14:50 +02:00
Emiel Bruijntjes 45775fefe8 avoid that multiple frames are sent by the channel-on-ready handler 2021-06-15 11:56:56 +02:00
Bas van Berckel 110706771a
Add missing recall implementation (#375)
* Add missing recall implementation
* create DeferredRecall if it doesn't exist

Co-authored-by: Bas van Berckel <bas.vanberckel@copernica.com>
2020-10-21 15:21:28 +02:00
Emiel Bruijntjes 31f2d78778 Breaking change: the channel.publish() method no longer returns a DeferredPublisher-object, because it was not logical that you had to reinstall the callbacks for bounce-methods after each individual publish() call, not was it logical that the callbacks were not always logically linked to the publish() operation that failed (they were always sent to the handler of the most recent publish() instead of to the handler of the failed publish()). At the same time we added a channel.recall() method that can be used to notify the library that user-space is prepared to recall/take-back/accept bounced messages 2020-10-19 08:52:50 +02:00
Michael van der Werve 94bf5fe74b initial implementation 2020-10-06 15:14:42 +02:00
Emiel Bruijntjes da26b1112e prevent crash when channelimpl unregistered from the connectionimpl, (hopefully) fixes #299 and fixes #326 2020-03-13 09:44:29 +01:00
Emiel Bruijntjes f3ba779e67 deferred-chain was in kept in scope by a consumer-operation, this fixes #323 2020-02-28 12:45:45 +01:00
LAD Martin 022bd87ac1 Adds channel callbacks checking 2019-11-05 13:39:45 +00:00
Emiel Bruijntjes 5a648fe2d8
Merge pull request #298 from CopernicaMarketingSoftware/synchronous-fix
fix for incorrect handling of synchronous flag
2019-06-19 10:56:52 +02:00
Michael van der Werve 7b79b7c6e2 now we always flush when a success is reported, and the funcction is renamed to flush 2019-06-19 10:54:50 +02:00
tilsche d3f35fb524 fix duplicate _connection->remove call on ConnectionImpl objects that were already destroyed, but didn't detach in case of errors 2019-03-04 16:53:31 +01:00
Youri Moll a92dc27653 Implemented custom heartbeats in Livev 2018-12-13 13:01:38 +01:00
Emiel Bruijntjes ee60aeb025 The Channel constructor now throws an exception if the max number of channels has been reached 2018-11-23 11:15:51 +01:00
Emiel Bruijntjes 888dc8c40b added channel::usable() to replace channel::connected() 2018-11-12 15:24:25 +01:00
Emiel Bruijntjes 11af8a7f6b
Merge pull request #218 from RZRCDR/fix_msvc_compiler_warnings
Fix msvc compiler warnings
2018-10-27 12:52:07 +02:00
Marcin Gibula cab0602dbf Forgot to set ChannelImpl::_confirm 2018-05-14 22:36:49 +02:00
Marcin Gibula 2aa55b83c7 Replace old API with DeferredConfirm class 2018-05-14 21:12:34 +02:00
Marcin Gibula eeee1c3c5f Rename setConfirmMode() to confirmSelect() 2018-05-14 12:59:20 +02:00
Marcin Gibula e0b04ad7e0 Remove messageCounter() 2018-05-14 12:55:15 +02:00
Dirkco du Plessis 1479922901 Fix MSVC compile warning C4800 for bitwise operation resulting in int to boolean assignment.
Fix MSVC compile warning C4244 possible loss of data. Possible data loss from uint64_t to uint32_t.
2018-04-22 15:53:52 +01:00
Marcin Gibula bfd91b6ab5 Merge with upstream 2018-04-10 10:30:01 +02:00
Emiel Bruijntjes 1ccd93cc5e final step (although untested) for handling returned messages 2018-03-01 22:27:27 +01:00
Emiel Bruijntjes 1f3500cee8 breaking changes:
channel.publish() now returns a DeferredConsumer object on which callbacks can be installed for handling returned messages,
channel.get().onSize() has a different behavior: it now reports the message size (and no longer the queue size),
channel.get().onCount() has been added: it reports the queue size (this used to be the onSize() method),
channel.consume().onSize() method has been added to find out the size of the upcoming message
2018-03-01 21:12:53 +01:00
Emiel Bruijntjes 520fe40201 refactored handling of incoming messages from consume and get operations, to prepare for future handling of returned messages and publisher confirms. this also implies a small change to the api: the begin-callback when a message is received now also gets the original exchange and routing key (which could be useful) 2018-03-01 17:34:27 +01:00
Emiel Bruijntjes e0feb17ecc renamed deferredconsumerbase into deferredreceiver, because it is not only a base class for the consumer, but also for other receiving operations: get requests and in the future also for returned messages 2018-02-27 05:08:21 +01:00
Emiel Bruijntjes ec327de396 less conservative caching of outgoing data. This fixes #184 2018-02-07 10:08:32 +01:00
Emiel Bruijntjes f5540e9af2 fixed autodelete flag for declaring an exchange and added support for internal exchange. this fixes #183 2018-02-06 21:54:56 +01:00
Aart Stuurman 001dfaa7e0 - Moved linux specific TCP implementation to a seperate folder and removed it from default build. Does not yet build correctly if you want that.
- Fixed conversion warnings from <some integer> type to uint32_t, which happens a lot around here. This is no functional change, just making it explicit so the compiler doesn't warn.
2018-01-23 16:47:53 +01:00
Emiel Bruijntjes a091921e88 added connection::heartbeat() method, userspace programs are responsible for calling this method once every 60 seconds 2017-06-16 10:14:42 +01:00
Marcin Gibula 3ab9eed268 Simplify message counter logic 2017-06-08 23:41:55 +02:00
Marcin Gibula 30e652c669 Add Channel::setConfirmMode() and Channel::messageCounter() methods 2017-06-08 22:19:55 +02:00
Emiel Bruijntjes 71eba4c5d3 prevent copying of buffers 2017-03-09 09:25:26 +01:00
Emiel Bruijntjes 1f5f641d8b we now use passthrough buffers, so we no longer have to dynamically allocate a buffer for each and every outgoing message 2017-03-09 00:18:53 +01:00
Emiel Bruijntjes 00b81949d3 the AMQP::Message and AMQP::Envelope objects can now longer be copied or moved, and the signatures for creating an envelope and publishing a message have been made much more strict. This could be a API breaking change, to the version number should be upped 2017-03-08 13:32:51 +01:00
Okke c6608cee0a Added even more debug code for the channelimpl class 2017-03-07 10:10:11 +01:00
Okke 055431de6e Fixed compilation issue due to recent changes in ChannelImpl 2017-03-03 12:56:54 +01:00
Martijn Otto 2c60151d31 Only allocate a message and its data when a consumer wants to and allow consumers to receive the individual parts 2016-06-23 14:42:50 +02:00
Emiel Bruijntjes 6320e2ae0e added consistent-hash exchange (same as pull request #68) 2016-06-15 11:20:31 -04:00
Emiel Bruijntjes d41423d5db Added TcpChannel class so that Connection and Channel class are once again completely protocol agnostic 2015-11-01 09:51:43 +01:00
Emiel Bruijntjes df801953a1 improvements to work directly with tcp connections 2015-10-31 21:13:41 +01:00
Martijn Otto a93b88697d Fix double ready bug for channel, fixes #25 2015-05-18 10:56:50 +02:00
Emiel Bruijntjes ad3b95741e various trics and changes so that windows compilers, and 32bit systems will not complain about stuff 2015-04-24 10:46:44 +02:00