Merge branch 'master' of https://github.com/CopernicaMarketingSoftware/AMQP-CPP
This commit is contained in:
commit
4e09e54849
|
|
@ -23,11 +23,12 @@ endmacro()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(include)
|
add_subdirectory(include)
|
||||||
add_subdirectory(amqp_boost_test)
|
|
||||||
|
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/include)
|
|
||||||
add_library(amqp-cpp STATIC ${SRCS})
|
add_library(amqp-cpp STATIC ${SRCS})
|
||||||
target_include_directories(amqp-cpp SYSTEM PUBLIC ${PROJECT_SOURCE_DIR})
|
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})
|
||||||
set(AMQP-CPP_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
|
set(AMQP-CPP_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
|
||||||
|
|
|
||||||
11
README.md
11
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
|
used inside the MailerQ (www.mailerq.com) application, MailerQ is a tool for
|
||||||
sending large volumes of email, using AMQP message queues.
|
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:
|
||||||
|
|
||||||
HOW TO USE
|
* Copernica Marketing 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
|
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
|
to pass an object to the library that the library can use for that. So, before
|
||||||
|
|
|
||||||
|
|
@ -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 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, 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, 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))); }
|
bool publish(const std::string &exchange, const std::string &routingKey, const char *message) { return _implementation->publish(exchange, routingKey, Envelope(message, strlen(message))); }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ protected:
|
||||||
* @var const char *
|
* @var const char *
|
||||||
*/
|
*/
|
||||||
const char *_body;
|
const char *_body;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Size of the data
|
* Size of the data
|
||||||
* @var uint64_t
|
* @var uint64_t
|
||||||
|
|
@ -41,26 +41,32 @@ protected:
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* The data buffer that you pass to this constructor must be valid during
|
* The data buffer that you pass to this constructor must be valid during
|
||||||
* the lifetime of the Envelope object.
|
* the lifetime of the Envelope object.
|
||||||
*
|
*
|
||||||
* @param body
|
* @param body
|
||||||
* @param size
|
* @param size
|
||||||
*/
|
*/
|
||||||
Envelope(const char *body, uint64_t size) : MetaData(), _body(body), _bodySize(size) {}
|
Envelope(const char *body, uint64_t size) : MetaData(), _body(body), _bodySize(size) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor based on a string
|
* Constructor based on a string
|
||||||
* @param body
|
* @param body
|
||||||
*/
|
*/
|
||||||
Envelope(const std::string &body) : MetaData(), _str(body), _body(_str.data()), _bodySize(_str.size()) {}
|
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
|
* Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~Envelope() {}
|
virtual ~Envelope() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access to the full message data
|
* Access to the full message data
|
||||||
* @return buffer
|
* @return buffer
|
||||||
|
|
@ -69,7 +75,7 @@ public:
|
||||||
{
|
{
|
||||||
return _body;
|
return _body;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Size of the body
|
* Size of the body
|
||||||
* @return uint64_t
|
* @return uint64_t
|
||||||
|
|
@ -78,7 +84,7 @@ public:
|
||||||
{
|
{
|
||||||
return _bodySize;
|
return _bodySize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Body as a string
|
* Body as a string
|
||||||
* @return string
|
* @return string
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue