99 * throttling at the same time.
1010 *
1111 * @author Michael van der Werve <[email protected] > 12- * @copyright 2020 - 2022 Copernica BV
12+ * @copyright 2020 - 2023 Copernica BV
1313 */
1414
1515/* *
@@ -239,9 +239,9 @@ class Reliable : public BASE
239239 * @param flags optional flags
240240 * @return bool
241241 */
242- DeferredPublish &publish (const std::string &exchange, const std::string &routingKey, const std::string &message, int flags = 0 ) { return publish (exchange, routingKey, Envelope (message.data (), message.size ()), flags); }
243- DeferredPublish &publish (const std::string &exchange, const std::string &routingKey, const char *message, size_t size, int flags = 0 ) { return publish (exchange, routingKey, Envelope (message, size), flags); }
244- DeferredPublish &publish (const std::string &exchange, const std::string &routingKey, const char *message, int flags = 0 ) { return publish (exchange, routingKey, Envelope (message, strlen (message)), flags); }
242+ DeferredPublish &publish (const std::string_view &exchange, const std::string_view &routingKey, const std::string_view &message, int flags = 0 ) { return publish (exchange, routingKey, Envelope (message.data (), message.size ()), flags); }
243+ DeferredPublish &publish (const std::string_view &exchange, const std::string_view &routingKey, const char *message, size_t size, int flags = 0 ) { return publish (exchange, routingKey, Envelope (message, size), flags); }
244+ DeferredPublish &publish (const std::string_view &exchange, const std::string_view &routingKey, const char *message, int flags = 0 ) { return publish (exchange, routingKey, Envelope (message, strlen (message)), flags); }
245245
246246 /* *
247247 * Publish a message to an exchange. See amqpcpp/channel.h for more details on the flags.
@@ -254,7 +254,7 @@ class Reliable : public BASE
254254 * @param size size of the message
255255 * @param flags optional flags
256256 */
257- DeferredPublish &publish (const std::string &exchange, const std::string &routingKey, const Envelope &envelope, int flags = 0 )
257+ DeferredPublish &publish (const std::string_view &exchange, const std::string_view &routingKey, const Envelope &envelope, int flags = 0 )
258258 {
259259 // publish the entire thing, and remember if it failed at any point
260260 uint64_t tag = BASE::publish (exchange, routingKey, envelope, flags);
0 commit comments