From 11bf55b6a24a624ee17cee82d380db08f92a1e05 Mon Sep 17 00:00:00 2001 From: Bartosz Szreder Date: Sun, 29 Mar 2015 15:48:42 +0200 Subject: [PATCH 1/6] Fix compilation with CMake. --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4670b58..32d8455 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,9 +23,7 @@ endmacro() add_subdirectory(src) add_subdirectory(include) -add_subdirectory(amqp_boost_test) -include_directories(${CMAKE_SOURCE_DIR}/include) add_library(amqp-cpp STATIC ${SRCS}) target_include_directories(amqp-cpp SYSTEM PUBLIC ${PROJECT_SOURCE_DIR}) From 2dba897ed903815e6f904aa04a16abfbfeb02f7b Mon Sep 17 00:00:00 2001 From: Bartosz Szreder Date: Sun, 29 Mar 2015 20:25:12 +0200 Subject: [PATCH 2/6] Add install target to CMake. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32d8455..a57c02d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,9 @@ add_subdirectory(include) add_library(amqp-cpp STATIC ${SRCS}) target_include_directories(amqp-cpp SYSTEM PUBLIC ${PROJECT_SOURCE_DIR}) +install(TARGETS amqp-cpp + ARCHIVE DESTINATION lib +) set(AMQP-CPP_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) set(AMQP-CPP_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE) From 9443c4af83e955554414ce11c37835970faf0bf3 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Wed, 1 Apr 2015 12:31:20 +0200 Subject: [PATCH 3/6] Update README.md Added links to Copernica to the README file --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cbc6bf1..a7d62c6 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,16 @@ This library is created and maintained by Copernica (www.copernica.com), and is used inside the MailerQ (www.mailerq.com) application, MailerQ is a tool for sending large volumes of email, using AMQP message queues. +Do you appreciate our work and are you looking for high quality email solutions? +Please take a look at one or more of our commercial solutions to -HOW TO USE -========== +* Copernica Martkeing Suite (www.copernica.com) +* MailerQ MTA (www.mailerq.com) +* Responsive Email web service (www.responsiveemail.com) + + +HOW TO USE AMQP-CPP +=================== As we mentioned above, the library does not do any IO by itself, and you need to pass an object to the library that the library can use for that. So, before From 3d1c3c4218ab57bf343cd212d588a6098a0b524f Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Wed, 1 Apr 2015 12:32:27 +0200 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a7d62c6..3acfc71 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ used inside the MailerQ (www.mailerq.com) application, MailerQ is a tool for sending large volumes of email, using AMQP message queues. Do you appreciate our work and are you looking for high quality email solutions? -Please take a look at one or more of our commercial solutions to +Then check out our commercial solutions: * Copernica Martkeing Suite (www.copernica.com) * MailerQ MTA (www.mailerq.com) From bc3dc08e4aafdb50ca7b32da629bf9b1ebdee718 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Fri, 3 Apr 2015 09:04:46 +0200 Subject: [PATCH 5/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3acfc71..f8429cd 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ sending large volumes of email, using AMQP message queues. Do you appreciate our work and are you looking for high quality email solutions? Then check out our commercial solutions: -* Copernica Martkeing Suite (www.copernica.com) +* Copernica Marketing Suite (www.copernica.com) * MailerQ MTA (www.mailerq.com) * Responsive Email web service (www.responsiveemail.com) From 803ba6cc88fd39c0bc685098a9ebad3161fc943e Mon Sep 17 00:00:00 2001 From: Martijn Otto Date: Wed, 22 Apr 2015 14:24:00 +0200 Subject: [PATCH 6/6] Added publish method with r-value std::string --- include/channel.h | 1 + include/envelope.h | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/include/channel.h b/include/channel.h index 8024e0a..e5e85c3 100644 --- a/include/channel.h +++ b/include/channel.h @@ -338,6 +338,7 @@ public: */ bool publish(const std::string &exchange, const std::string &routingKey, const Envelope &envelope) { return _implementation->publish(exchange, routingKey, envelope); } bool publish(const std::string &exchange, const std::string &routingKey, const std::string &message) { return _implementation->publish(exchange, routingKey, Envelope(message)); } + bool publish(const std::string &exchange, const std::string &routingKey, std::string &&message) { return _implementation->publish(exchange, routingKey, Envelope(std::move(message))); } bool publish(const std::string &exchange, const std::string &routingKey, const char *message, size_t size) { return _implementation->publish(exchange, routingKey, Envelope(message, size)); } bool publish(const std::string &exchange, const std::string &routingKey, const char *message) { return _implementation->publish(exchange, routingKey, Envelope(message, strlen(message))); } diff --git a/include/envelope.h b/include/envelope.h index fbe646e..b1cdf6a 100644 --- a/include/envelope.h +++ b/include/envelope.h @@ -31,7 +31,7 @@ protected: * @var const char * */ const char *_body; - + /** * Size of the data * @var uint64_t @@ -41,26 +41,32 @@ protected: public: /** * Constructor - * + * * The data buffer that you pass to this constructor must be valid during * the lifetime of the Envelope object. - * + * * @param body * @param size */ Envelope(const char *body, uint64_t size) : MetaData(), _body(body), _bodySize(size) {} - + /** * Constructor based on a string * @param body */ Envelope(const std::string &body) : MetaData(), _str(body), _body(_str.data()), _bodySize(_str.size()) {} + /** + * Constructor based on a string + * @param body + */ + Envelope(std::string &&body) : MetaData(), _str(std::move(body)), _body(_str.data()), _bodySize(_str.size()) {} + /** * Destructor */ virtual ~Envelope() {} - + /** * Access to the full message data * @return buffer @@ -69,7 +75,7 @@ public: { return _body; } - + /** * Size of the body * @return uint64_t @@ -78,7 +84,7 @@ public: { return _bodySize; } - + /** * Body as a string * @return string