diff --git a/include/amqpcpp/tagger.h b/include/amqpcpp/tagger.h index f591908..d534824 100644 --- a/include/amqpcpp/tagger.h +++ b/include/amqpcpp/tagger.h @@ -11,7 +11,7 @@ * - Reliable: to have throttle + notifications via callbacks * * @author Michael van der Werve - * @copyright 2020 Copernica BV + * @copyright 2020 - 2023 Copernica BV */ /** @@ -128,10 +128,10 @@ public: * @param flags optional flags * @return uint64_t */ - uint64_t publish(const std::string &exchange, const std::string &routingKey, const Envelope &envelope, int flags = 0); - uint64_t 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); } - uint64_t 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); } - uint64_t publish(const std::string &exchange, const std::string &routingKey, const char *message, int flags = 0) { return publish(exchange, routingKey, Envelope(message, strlen(message)), flags); } + uint64_t publish(const std::string_view &exchange, const std::string_view &routingKey, const Envelope &envelope, int flags = 0); + uint64_t 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); } + uint64_t 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); } + uint64_t 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); } /** * Close underlying channel diff --git a/src/tagger.cpp b/src/tagger.cpp index d85da09..ef261e6 100644 --- a/src/tagger.cpp +++ b/src/tagger.cpp @@ -131,7 +131,7 @@ void Tagger::reportError(const char *message) * @param flags optional flags * @return uint64_t */ -uint64_t Tagger::publish(const std::string &exchange, const std::string &routingKey, const Envelope &envelope, int flags) +uint64_t Tagger::publish(const std::string_view &exchange, const std::string_view &routingKey, const Envelope &envelope, int flags) { // @todo do not copy the entire buffer to individual frames