You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2013/09/20 20:59:50 UTC
svn commit: r1525101 [2/21] - in /qpid/branches/linearstore/qpid: ./ bin/
cpp/ cpp/bindings/ cpp/bindings/qmf/ cpp/bindings/qmf/python/
cpp/bindings/qmf/ruby/ cpp/bindings/qmf/tests/ cpp/bindings/qmf2/
cpp/bindings/qmf2/examples/cpp/ cpp/bindings/qmf2/...
Propchange: qpid/branches/linearstore/qpid/
------------------------------------------------------------------------------
Merged /qpid/trunk/qpid:r1501885-1525056
Modified: qpid/branches/linearstore/qpid/QPID_VERSION.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/QPID_VERSION.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/QPID_VERSION.txt (original)
+++ qpid/branches/linearstore/qpid/QPID_VERSION.txt Fri Sep 20 18:59:30 2013
@@ -1 +1 @@
-0.23
+0.25
Modified: qpid/branches/linearstore/qpid/bin/release.sh
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/bin/release.sh?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/bin/release.sh (original)
+++ qpid/branches/linearstore/qpid/bin/release.sh Fri Sep 20 18:59:30 2013
@@ -211,13 +211,15 @@ if [ "PYTHON" == "$PYTHON" ] ; then
# create the swigged python sources
mkdir qpid-${VER}/python-qpid_messaging-${VER}
+ mkdir qpid-${VER}/python-qpid_messaging-${VER}/examples
cp qpid-${VER}/cpp/bindings/qpid/python/python.i \
qpid-${VER}/cpp/bindings/qpid/python/LICENSE \
qpid-${VER}/cpp/bindings/qpid/python/README \
qpid-${VER}/cpp/bindings/qpid/python/ChangeLog \
qpid-${VER}/cpp/bindings/qpid/python/extra_dist/CMakeLists.txt \
qpid-${VER}/python-qpid_messaging-${VER}
- # TODO: copy python examples into the directory as well
+ cp qpid-${VER}/cpp/bindings/qpid/examples/python/* \
+ qpid-${VER}/python-qpid_messaging-${VER}/examples
pushd qpid-${VER}
tar -czf ../artifacts/python-qpid_messaging-${VER}.tar.gz \
python-qpid_messaging-${VER}
@@ -248,8 +250,8 @@ if [ "JAVA" == "$JAVA" ] ; then
# now generate the binary packages, with the glue for optional features
pushd qpid-${VER}/java
- ant build release-bin -Dsvnversion.output=${REV} -Dmodules.opt="bdbstore,bdbstore/jmx" -Ddownload-bdb=true
- ant release-mvn -Dsvnversion.output=${REV} -Dmodules.opt="bdbstore,bdbstore/jmx" -Dmaven.snapshot=false
+ ant build release-bin -Dsvnversion.output=${REV} -Doptional=true
+ ant release-mvn -Dsvnversion.output=${REV} -Doptional=true -Dmaven.snapshot=false
popd
cp qpid-${VER}/java/broker/release/*.tar.gz artifacts/qpid-java-broker-${VER}.tar.gz
@@ -268,8 +270,18 @@ if [ "JAVA" == "$JAVA" ] ; then
cp -a qpid-${VER}/java/management/common/release/maven artifacts/
cp -a qpid-${VER}/java/amqp-1-0-common/release/maven artifacts/
cp -a qpid-${VER}/java/broker-plugins/access-control/release/maven artifacts/
- cp -a qpid-${VER}/java/broker-plugins/management-jmx/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/amqp-0-8-protocol/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/amqp-0-10-protocol/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/amqp-1-0-protocol/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/amqp-msg-conv-0-8-to-0-10/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/amqp-msg-conv-0-8-to-1-0/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/amqp-msg-conv-0-10-to-1-0/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/derby-store/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/jdbc-provider-bone/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/jdbc-store/release/maven artifacts/
cp -a qpid-${VER}/java/broker-plugins/management-http/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/management-jmx/release/maven artifacts/
+ cp -a qpid-${VER}/java/broker-plugins/memory-store/release/maven artifacts/
cp -a qpid-${VER}/java/bdbstore/jmx/release/maven artifacts/
fi
Modified: qpid/branches/linearstore/qpid/cpp/BuildInstallSettings.cmake
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/BuildInstallSettings.cmake?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/BuildInstallSettings.cmake (original)
+++ qpid/branches/linearstore/qpid/cpp/BuildInstallSettings.cmake Fri Sep 20 18:59:30 2013
@@ -93,7 +93,7 @@ if (WIN32)
"Directory to install SASL configuration files")
set (QPID_INSTALL_DATADIR conf CACHE STRING
"Directory to install read-only arch.-independent data root")
- set (QPID_INSTALL_EXAMPLESDIR qpid/examples CACHE STRING
+ set (QPID_INSTALL_EXAMPLESDIR examples CACHE STRING
"Directory to install programming examples in")
set (QPID_INSTALL_DOCDIR docs CACHE STRING
"Directory to install documentation")
Modified: qpid/branches/linearstore/qpid/cpp/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/CMakeLists.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/CMakeLists.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/CMakeLists.txt Fri Sep 20 18:59:30 2013
@@ -64,8 +64,7 @@ set_absolute_install_path (QPIDC_CONF_FI
set_absolute_install_path (QPIDD_CONF_FILE ${QPID_INSTALL_CONFDIR}/qpidd.conf)
install(FILES LICENSE NOTICE DESTINATION ${QPID_INSTALL_DOCDIR})
-install(FILES include/qmf/qmfengine.i
- include/qmf/qmf2.i
+install(FILES include/qmf/qmf2.i
DESTINATION ${QPID_INSTALL_INCLUDEDIR}/qmf)
if (WIN32)
Modified: qpid/branches/linearstore/qpid/cpp/INSTALL
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/INSTALL?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/INSTALL (original)
+++ qpid/branches/linearstore/qpid/cpp/INSTALL Fri Sep 20 18:59:30 2013
@@ -150,10 +150,13 @@ all of the above plus:
* doxygen <ftp://ftp.stack.nl/pub/users/dimitri/> (1.5.1)
* graphviz <http://www.graphviz.org/> (2.12)
* ruby 1.8 <http://www.ruby-lang.org> (1.8.4)
-
+ * python 2.x <http://www.python.org> (2.4.3)
NOTE: make sure to install the related '-devel' packages also!!!!
+NOTE: Python 3.x is know to NOT work - please use 2.7 or earlier.
+Ruby should be prior to version 2.
+
To build the QMF (Qpid Management Framework) bindings for Ruby and Python,
the following must also be installed:
Modified: qpid/branches/linearstore/qpid/cpp/INSTALL-WINDOWS
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/INSTALL-WINDOWS?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/INSTALL-WINDOWS (original)
+++ qpid/branches/linearstore/qpid/cpp/INSTALL-WINDOWS Fri Sep 20 18:59:30 2013
@@ -41,9 +41,7 @@ Take these as a recommended minimum vers
The following libraries and header files must be installed to build
from either a source checkout or a source distribution:
- * boost <http://www.boost.org> (1.35)(*)
-
-earlier versions of boost e.g. 1.33 also work
+ * boost <http://www.boost.org> (1.35)
To build from a source repository (SVN) checkout you will need boost plus:
@@ -51,6 +49,9 @@ To build from a source repository (SVN)
* python <http://www.python.org> (2.5.2)
* ruby <http://www.ruby-lang.org> (1.8.4)
+NOTE: Python 3.x is known to NOT work - please use 2.7 or earlier.
+Ruby should be prior to version 2.
+
Regardless of which type of build you perform, if you wish to run the full
test suite, you will need to have python, listed above, installed.
Modified: qpid/branches/linearstore/qpid/cpp/README-HA.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/README-HA.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/README-HA.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/README-HA.txt Fri Sep 20 18:59:30 2013
@@ -136,4 +136,4 @@ The queue state replication mechanism im
[ha-virtual-ip]: http://qpid.apache.org/books/0.22/AMQP-Messaging-Broker-CPP-Book/html/chapter-ha.html#ha-virtual-ip
[ha-replicate-values]: http://qpid.apache.org/books/0.22/AMQP-Messaging-Broker-CPP-Book/html/chapter-ha.html#ha-replicate-values
[ha-rm-config]: http://qpid.apache.org/books/0.22/AMQP-Messaging-Broker-CPP-Book/html/chapter-ha.html#ha-rm-config
-[ha-queue-replication]: http://qpid.apache.org/books/0.22/AMQP-Messaging-Broker-CPP-Book/html/chapter-ha.html#ha-queue-replication
+[ha-queue-replication]: http://qpid.apache.org/releases/qpid-0.22/cpp-broker/book/ha-queue-replication.html
Modified: qpid/branches/linearstore/qpid/cpp/README-winsdk.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/README-winsdk.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/README-winsdk.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/README-winsdk.txt Fri Sep 20 18:59:30 2013
@@ -82,7 +82,7 @@ The kit directories hold the content des
A python scripting code set for generating QMF data structures.
For more information on Qpid QMF go to:
- https://cwiki.apache.org/qpid/qpid-management-framework.html
+ http://qpid.apache.org/components/qmf/index.html
The architectural relationships of the components in this SDK are
illustrated here.
Modified: qpid/branches/linearstore/qpid/cpp/SSL
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/SSL?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/SSL (original)
+++ qpid/branches/linearstore/qpid/cpp/SSL Fri Sep 20 18:59:30 2013
@@ -7,15 +7,11 @@ on Windows.
Linux
=====
-SSL support for Qpid-C++, based on Mozilla's Network Security Services
-library, is provided as two loadable modules: one for the client
-(sslconnector.so), one for the broker (ssl.so). Either these libraries
-should be present in the relevant module directory or the
-'load-module' option (or QPID_LOAD_MODULE environment variable) is
-used to ensure they are loaded.
+SSL support for Qpid-C++ is based on Mozilla's Network Security Services
+library. SSL support will be built automatically providing this library
+and include files are found at build time.
-Broker side SSL Settings (note you can get these by qpidd --help
-providing the ssl.so module is loaded):
+Broker side SSL Settings (note you can get these by qpidd --help)
SSL Settings:
--ssl-use-export-policy Use NSS export policy
@@ -57,14 +53,13 @@ for accessing the created db.
The daemon can then be started with something like the following:
-./src/qpidd --auth no --load-module src/.libs/ssl.so \
+./src/qpidd --auth no \
--ssl-cert-db ./test_cert_db \
--ssl-cert-password-file ./cert.password \
--ssl-cert-name myhost.mydomain
then for client set:
-QPID_LOAD_MODULE=./src/.libs/sslconnector.so
QPID_SSL_CERT_DB=./test_cert_db
and run e.g.
Modified: qpid/branches/linearstore/qpid/cpp/bindings/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/CMakeLists.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/CMakeLists.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/CMakeLists.txt Fri Sep 20 18:59:30 2013
@@ -73,7 +73,7 @@ if (SWIG_FOUND)
set(CMAKE_SWIG_FLAGS "-w361,362,401,467,503")
if (PYTHONLIBS_FOUND)
- message("Building Python bindings")
+ message(STATUS "Building Python bindings")
execute_process(COMMAND ${PYTHON_EXECUTABLE}
-c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}')"
OUTPUT_VARIABLE PYTHON_SITEARCH_PACKAGES
@@ -81,11 +81,10 @@ if (SWIG_FOUND)
add_subdirectory(qpid/python)
add_subdirectory(qmf2/python)
- add_subdirectory(qmf/python)
endif (PYTHONLIBS_FOUND)
if (RUBY_FOUND)
- message("Building Ruby bindings")
+ message(STATUS "Building Ruby bindings")
execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG['prefix']"
OUTPUT_VARIABLE RUBY_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -93,11 +92,10 @@ if (SWIG_FOUND)
# string(REPLACE ${RUBY_PREFIX} ${CMAKE_INSTALL_PREFIX} RUBY_PFX_ARCH_DIR ${RUBY_ARCH_DIR})
add_subdirectory(qpid/ruby)
add_subdirectory(qmf2/ruby)
- add_subdirectory(qmf/ruby)
endif (RUBY_FOUND)
if (PERLLIBS_FOUND)
- message("Building Perl bindings")
+ message(STATUS "Building Perl bindings")
execute_process(COMMAND ${PERL_EXECUTABLE} "-V::prefix:"
OUTPUT_VARIABLE QPERL_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)
Modified: qpid/branches/linearstore/qpid/cpp/bindings/qmf2/examples/cpp/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/qmf2/examples/cpp/CMakeLists.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/qmf2/examples/cpp/CMakeLists.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/qmf2/examples/cpp/CMakeLists.txt Fri Sep 20 18:59:30 2013
@@ -57,10 +57,10 @@ macro(add_example subdir example)
add_executable(${subdir}_${example} ${example}.cpp)
set_target_properties(${subdir}_${example} PROPERTIES OUTPUT_NAME ${example})
if (${ARGC} GREATER 2)
- target_link_libraries(${subdir}_${example} ${ARGN} qpidclient
+ target_link_libraries(${subdir}_${example} ${ARGN} qpidmessaging qpidtypes
${_boost_libs_needed})
else (${ARGC} GREATER 2)
- target_link_libraries(${subdir}_${example} qpidclient
+ target_link_libraries(${subdir}_${example} qpidmessaging qpidtypes
${_boost_libs_needed})
endif (${ARGC} GREATER 2)
endmacro(add_example)
@@ -73,22 +73,11 @@ macro(add_installed_example subdir examp
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${example}.cpp
DESTINATION ${QPID_INSTALL_EXAMPLESDIR}/${subdir}
COMPONENT ${QPID_COMPONENT_EXAMPLES})
- if (MSVC)
- install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}_${example}.vcproj
- DESTINATION ${QPID_INSTALL_EXAMPLESDIR}/${subdir}
- COMPONENT ${QPID_COMPONENT_EXAMPLES})
- endif (MSVC)
-
endmacro(add_installed_example)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.txt
DESTINATION ${QPID_INSTALL_EXAMPLESDIR}
COMPONENT ${QPID_COMPONENT_EXAMPLES})
-if (MSVC)
- install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/examples.sln
- DESTINATION ${QPID_INSTALL_EXAMPLESDIR}
- COMPONENT ${QPID_COMPONENT_EXAMPLES})
-endif (MSVC)
add_installed_example(qmf2 agent qmf2)
if (NOT WIN32)
Modified: qpid/branches/linearstore/qpid/cpp/bindings/qpid/examples/perl/spout.pl
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/qpid/examples/perl/spout.pl?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/qpid/examples/perl/spout.pl (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/qpid/examples/perl/spout.pl Fri Sep 20 18:59:30 2013
@@ -28,6 +28,7 @@ use Time::Local;
my $url = "127.0.0.1";
my $timeout = 0;
my $count = 1;
+my $durable = 0;
my $id = "";
my $replyto = "";
my @properties;
@@ -41,6 +42,7 @@ my $result = GetOptions(
"broker|b=s" => \$url,
"timeout|t=i" => \$timeout,
"count|c=i" => \$count,
+ "durable|d" => \$durable,
"id|i=s" => \$id,
"replyto=s" => \$replyto,
"property|p=s@" => \@properties,
@@ -96,6 +98,9 @@ eval {
$message->set_content_type("text/plain");
}
+ # set durable flag
+ $message->set_durable($durable);
+
# if a reply-to address was supplied, then create a receiver from the
# session and wait for a response to be sent
my $receiver;
Modified: qpid/branches/linearstore/qpid/cpp/bindings/qpid/perl/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/qpid/perl/CMakeLists.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/qpid/perl/CMakeLists.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/qpid/perl/CMakeLists.txt Fri Sep 20 18:59:30 2013
@@ -24,6 +24,10 @@ set_source_files_properties(${CMAKE_CURR
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/perl.i
PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include;-I${qpid-cpp_SOURCE_DIR}/include;-I${qpid-cpp_SOURCE_DIR}/bindings")
+list(APPEND SWIG_MODULE_cqpid_perl_EXTRA_DEPS
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/qpid/qpid.i
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/qpid/swig_perl_typemaps.i
+)
swig_add_module(cqpid_perl perl ${CMAKE_CURRENT_SOURCE_DIR}/perl.i)
swig_link_libraries(cqpid_perl qpidmessaging qpidtypes qmf2 ${PERL_LIBRARY})
Modified: qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/CMakeLists.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/CMakeLists.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/CMakeLists.txt Fri Sep 20 18:59:30 2013
@@ -24,8 +24,12 @@ set_source_files_properties(${CMAKE_CURR
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i
PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include;-I${qpid-cpp_SOURCE_DIR}/bindings")
-swig_add_module(cqpid_python python ${CMAKE_CURRENT_SOURCE_DIR}/python.i)
-swig_link_libraries(cqpid_python qpidmessaging qpidtypes qmf2 ${PYTHON_LIBRARIES})
+list(APPEND SWIG_MODULE_qpid_messaging_python_EXTRA_DEPS
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/qpid/qpid.i
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/qpid/swig_python_typemaps.i
+)
+swig_add_module(qpid_messaging python ${CMAKE_CURRENT_SOURCE_DIR}/python.i)
+swig_link_libraries(qpid_messaging qpidmessaging qpidtypes ${PYTHON_LIBRARIES})
set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing")
include_directories(${PYTHON_INCLUDE_PATH}
@@ -35,18 +39,17 @@ include_directories(${PYTHON_INCLUDE_PAT
##------------------------------------
## Install the complete Python binding
##------------------------------------
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cqpid.py
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qpid_messaging.py
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cqpid.py
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qpid_messaging.py
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqpid.py
- ${CMAKE_CURRENT_BINARY_DIR}/cqpid.pyc
- ${CMAKE_CURRENT_BINARY_DIR}/cqpid.pyo
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qpid_messaging.py
+ ${CMAKE_CURRENT_BINARY_DIR}/qpid_messaging.pyc
+ ${CMAKE_CURRENT_BINARY_DIR}/qpid_messaging.pyo
DESTINATION ${PYTHON_SITEARCH_PACKAGES}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_cqpid_python.so
- RENAME _cqpid.so
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_qpid_messaging.so
DESTINATION ${PYTHON_SITEARCH_PACKAGES}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
Modified: qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/ChangeLog
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/ChangeLog?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/ChangeLog (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/ChangeLog Fri Sep 20 18:59:30 2013
@@ -1 +1,5 @@
-Version 0.24:
+Version 0.26:
+ * QPID-4952: Changed the module name to qpid_messaging.
+ * QPID-5140: Added get/set method to MessageProperties.
+ * QPID-4924: Added examples from pure Python libraries.
+ * QPID-4924: Added the console example to interact with server.
Modified: qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/extra_dist/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/extra_dist/CMakeLists.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/extra_dist/CMakeLists.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/extra_dist/CMakeLists.txt Fri Sep 20 18:59:30 2013
@@ -49,10 +49,10 @@ SET_SOURCE_FILES_PROPERTIES (${CMAKE_CUR
SET_SOURCE_FILES_PROPERTIES (${CMAKE_CURRENT_SOURCE_DIR}/python.i
PROPERTIES SWIG_FLAGS "-I${QPID_INCLUDE_DIR}")
-SWIG_ADD_MODULE (cqpid_python python
+SWIG_ADD_MODULE (qpid_messaging_python python
${CMAKE_CURRENT_SOURCE_DIR}/python.i)
-SWIG_LINK_LIBRARIES (cqpid_python
+SWIG_LINK_LIBRARIES (qpid_messaging_python
qpidmessaging
qpidtypes
${PYTHON_LIBRARIES})
@@ -61,9 +61,9 @@ SWIG_LINK_LIBRARIES (cqpid_python
## Install the bindings
## --------------------
-INSTALL (CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cqpid.py
+INSTALL (CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qpid_messaging.py
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-INSTALL (CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cqpid.py
+INSTALL (CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qpid_messaging.py
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
SET_SOURCE_FILES_PROPERTIES (${swig_generated_file_fullname}
@@ -75,12 +75,12 @@ INCLUDE_DIRECTORIES (
${CMAKE_CURRENT_SOURCE_DIR}
)
-INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/cqpid.py
- ${CMAKE_CURRENT_BINARY_DIR}/cqpid.pyc
- ${CMAKE_CURRENT_BINARY_DIR}/cqpid.pyo
+INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/qpid_messaging.py
+ ${CMAKE_CURRENT_BINARY_DIR}/qpid_messaging.pyc
+ ${CMAKE_CURRENT_BINARY_DIR}/qpid_messaging.pyo
DESTINATION ${PYTHON_SITEARCH_PACKAGES})
-INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/_cqpid_python.so
- RENAME _cqpid.so
+INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/_qpid_messaging_python.so
+ RENAME _qpid_messaging.so
DESTINATION ${PYTHON_SITEARCH_PACKAGES})
Modified: qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/python.i
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/python.i?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/python.i (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/qpid/python/python.i Fri Sep 20 18:59:30 2013
@@ -17,7 +17,8 @@
* under the License.
*/
-%module cqpid
+%module qpid_messaging
+
%include "std_string.i"
%include "qpid/swig_python_typemaps.i"
@@ -29,7 +30,7 @@
/*
* Exceptions
*
- * The convention below is that exceptions in _cqpid.so have the same
+ * The convention below is that exceptions in _qpid_messaging.so have the same
* names as in the C++ library. They get renamed to their Python
* equivalents when brought into the Python wrapping
*/
@@ -39,12 +40,12 @@ static PyObject* exception;
%}
%init %{
exception = PyErr_NewException(
- (char *) ("_cqpid." #exception), parent, NULL);
+ (char *) ("_qpid_messaging." #exception), parent, NULL);
Py_INCREF(exception);
PyModule_AddObject(m, #exception, exception);
%}
%pythoncode %{
- exception = _cqpid. ## exception
+ exception = _qpid_messaging. ## exception
%}
%enddef
@@ -139,8 +140,9 @@ QPID_EXCEPTION(UnauthorizedAccess, Sessi
/* This only renames the non-const version (I believe). Then again, I
* don't even know why there is a non-const version of the method. */
%rename(opened) qpid::messaging::Connection::isOpen();
+%rename(_close) qpid::messaging::Connection::close();
%rename(receiver) qpid::messaging::Session::createReceiver;
-%rename(sender) qpid::messaging::Session::createSender;
+%rename(_sender) qpid::messaging::Session::createSender;
%rename(_acknowledge_all) qpid::messaging::Session::acknowledge(bool);
%rename(_acknowledge_msg) qpid::messaging::Session::acknowledge(
Message &, bool);
@@ -163,26 +165,28 @@ QPID_EXCEPTION(UnauthorizedAccess, Sessi
%extend qpid::messaging::Connection {
%pythoncode %{
- # Handle the different options by converting underscores to hyphens.
- # Also, the sasl_mechanisms option in Python has no direct
- # equivalent in C++, so we will translate them to sasl_mechanism
- # when possible.
def __init__(self, url=None, **options):
if url:
- args = [url]
+ args = [str(url)]
else:
args = []
- if options :
- if "sasl_mechanisms" in options :
- if ' ' in options.get("sasl_mechanisms",'') :
- raise Exception(
- "C++ Connection objects are unable to handle "
- "multiple sasl-mechanisms")
- options["sasl_mechanism"] = options.pop("sasl_mechanisms")
- args.append(options)
- this = _cqpid.new_Connection(*args)
+ if options:
+ # remove null valued options
+ clean_opts = {}
+ for k, v in options.iteritems():
+ if v:
+ clean_opts[k] = v
+ args.append(clean_opts)
+ this = _qpid_messaging.new_Connection(*args)
try: self.this.append(this)
except: self.this = this
+
+ def attached(self):
+ return self.opened()
+
+ def close(self, timeout=None):
+ #timeout not supported in c++
+ self._close()
%}
/* Return a pre-existing session with the given name, if one
@@ -236,18 +240,29 @@ QPID_EXCEPTION(UnauthorizedAccess, Sessi
__swig_getmethods__["connection"] = getConnection
if _newclass: connection = property(getConnection)
+
+ def sender(self, target, **options) :
+ s = self._sender(target)
+ s._setDurable(options.get("durable"))
+ return s
%}
}
%extend qpid::messaging::Receiver {
%pythoncode %{
+ def _get_source(self):
+ return self.getAddress().str()
+
__swig_getmethods__["capacity"] = getCapacity
__swig_setmethods__["capacity"] = setCapacity
if _newclass: capacity = property(getCapacity, setCapacity)
__swig_getmethods__["session"] = getSession
if _newclass: session = property(getSession)
+
+ __swig_getmethods__["source"] = _get_source
+ if _newclass: source = property(_get_source)
%}
%pythoncode %{
@@ -263,25 +278,68 @@ QPID_EXCEPTION(UnauthorizedAccess, Sessi
%extend qpid::messaging::Sender {
%pythoncode %{
+ def _get_target(self):
+ return self.getAddress().str()
+
+ def _setDurable(self, d):
+ self.durable = d
+
def send(self, object, sync=True) :
if isinstance(object, Message):
message = object
else:
message = Message(object)
+ if self.durable and message.durable is None:
+ message.durable = self.durable
return self._send(message, sync)
-
+
__swig_getmethods__["capacity"] = getCapacity
__swig_setmethods__["capacity"] = setCapacity
if _newclass: capacity = property(getCapacity, setCapacity)
__swig_getmethods__["session"] = getSession
if _newclass: session = property(getSession)
+
+ __swig_getmethods__["target"] = _get_target
+ if _newclass: source = property(_get_target)
+
%}
}
%extend qpid::messaging::Message {
%pythoncode %{
+ class MessageProperties:
+ def __init__(self, msg):
+ self.msg = msg
+ self.properties = self.msg.getProperties()
+
+ def __len__(self):
+ return self.properties.__len__()
+
+ def __getitem__(self, key):
+ return self.properties[key];
+
+ def get(self, key):
+ return self.__getitem__(key)
+
+ def __setitem__(self, key, value):
+ self.properties[key] = value
+ self.msg.setProperty(key, value)
+
+ def set(self, key, value):
+ self.__setitem__(key, value)
+
+ def __delitem__(self, key):
+ del self.properties[key]
+ self.msg.setProperties(self.properties)
+
+ def __iter__(self):
+ return self.properties.iteritems()
+
+ def __repr__(self):
+ return str(self.properties)
+
# UNSPECIFIED was module level before, but I do not
# know how to insert python code at the top of the module.
# (A bare "%pythoncode" inserts at the end.
@@ -290,10 +348,10 @@ QPID_EXCEPTION(UnauthorizedAccess, Sessi
subject=None, user_id=None, reply_to=None,
correlation_id=None, durable=None, priority=None,
ttl=None, properties=None):
- this = _cqpid.new_Message('')
+ this = _qpid_messaging.new_Message('')
try: self.this.append(this)
except: self.this = this
- if content :
+ if not content is None:
self.content = content
if content_type != UNSPECIFIED :
self.content_type = content_type
@@ -314,34 +372,46 @@ QPID_EXCEPTION(UnauthorizedAccess, Sessi
if ttl is not None :
self.ttl = ttl
if properties is not None :
- # Can't set properties via (inst).getProperties, because
- # the typemaps make a copy of the underlying properties.
- # Instead, set via setProperty for the time-being
- for k, v in properties.iteritems() :
- self.setProperty(k, v)
+ self.setProperties(properties)
+
+ def _get_msg_props(self):
+ try:
+ return self._msg_props
+ except AttributeError:
+ self._msg_props = Message.MessageProperties(self)
+ return self._msg_props
def _get_content(self) :
+ obj = self.getContentObject()
+ if obj:
+ return obj
if self.content_type == "amqp/list" :
return decodeList(self)
if self.content_type == "amqp/map" :
return decodeMap(self)
return self.getContent()
def _set_content(self, content) :
- if isinstance(content, basestring) :
+ if isinstance(content, str) :
self.setContent(content)
+ elif isinstance(content, unicode) :
+ if not self.content_type: self.content_type = "text/plain"
+ self.setContent(str(content))
elif isinstance(content, list) or isinstance(content, dict) :
encode(content, self)
else :
- # Not a type we can handle. Try setting it anyway,
- # although this will probably lead to a swig error
- self.setContent(content)
+ self.setContentObject(content)
__swig_getmethods__["content"] = _get_content
__swig_setmethods__["content"] = _set_content
if _newclass: content = property(_get_content, _set_content)
- __swig_getmethods__["content_type"] = getContentType
+ def _get_content_type(self) :
+ ct = self.getContentType()
+ if ct == "": return None
+ else: return ct
+
+ __swig_getmethods__["content_type"] = _get_content_type
__swig_setmethods__["content_type"] = setContentType
- if _newclass: content_type = property(getContentType, setContentType)
+ if _newclass: content_type = property(_get_content_type, setContentType)
__swig_getmethods__["id"] = getMessageId
__swig_setmethods__["id"] = setMessageId
@@ -379,8 +449,8 @@ QPID_EXCEPTION(UnauthorizedAccess, Sessi
__swig_setmethods__["durable"] = setDurable
if _newclass: durable = property(getDurable, setDurable)
- __swig_getmethods__["properties"] = getProperties
- if _newclass: properties = property(getProperties)
+ __swig_getmethods__["properties"] = _get_msg_props
+ if _newclass: properties = property(_get_msg_props)
def getReplyTo(self) :
return self._getReplyTo().str()
@@ -389,7 +459,7 @@ QPID_EXCEPTION(UnauthorizedAccess, Sessi
__swig_getmethods__["reply_to"] = getReplyTo
__swig_setmethods__["reply_to"] = setReplyTo
if _newclass: reply_to = property(getReplyTo, setReplyTo)
-
+
def __repr__(self):
args = []
for name in ["id", "subject", "user_id", "reply_to",
Modified: qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt Fri Sep 20 18:59:30 2013
@@ -39,6 +39,10 @@ include_directories(${RUBY_INCLUDE_DIRS}
${qpid-cpp_SOURCE_DIR}/include
${qpid-cpp_SOURCE_DIR}/bindings)
+list(APPEND SWIG_MODULE_cqpid_ruby_EXTRA_DEPS
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/qpid/qpid.i
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/qpid/swig_ruby_typemaps.i
+)
swig_add_module(cqpid_ruby ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i)
swig_link_libraries(cqpid_ruby qpidmessaging qpidtypes qmf2 ${RUBY_LIBRARY})
Modified: qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/ChangeLog
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/ChangeLog?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/ChangeLog (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/ChangeLog Fri Sep 20 18:59:30 2013
@@ -1,4 +1,10 @@
-Verison 0.22:
+Version 0.26:
+ * QPID-4834: Ruby client examples incorrectly handles '--connection-options' option
+
+Version 0.24:
+ * No language-specific changes.
+
+Version 0.22:
* Qpid::Messaging::Address can use an address string on creation.
* Qpid::Messaging::Message can use an address string for reply_to.
* Removed errors.rb and the KeyError and SessionNameException errors.
Modified: qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/examples/spout.rb
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/examples/spout.rb?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/examples/spout.rb (original)
+++ qpid/branches/linearstore/qpid/cpp/bindings/qpid/ruby/examples/spout.rb Fri Sep 20 18:59:30 2013
@@ -26,6 +26,7 @@ options = {
:broker => "127.0.0.1",
:address => "",
:timeout => 0,
+ :durable => false,
:count => 1,
:properties => {},
:content => nil,
@@ -51,6 +52,11 @@ opts = OptionParser.new do |opts|
options[:timeout] = Qpid::Messaging::Duration.new timeout * 1000
end
+ opts.on("-d", "--durable",
+ "make the message durable (def. #{options[:durable]})") do
+ options[:durable] = true
+ end
+
opts.on("-c", "--count VALUE", Integer,
"stop after count messages have been sent, zero disables") do |count|
options[:count] = count
@@ -85,8 +91,9 @@ opts = OptionParser.new do |opts|
options[:content] = content
end
- opts.on(nil, "--connection-options VALUE",
+ opts.on("--connection-options VALUE",
"connection options string in the form {name1:value1, name2:value2}") do |conopts|
+
options[:connection_options] = conopts
end
end
@@ -100,7 +107,27 @@ end
# now get the non-arg options
options[:address] = ARGV[0] unless ARGV[0].nil?
-connection = Qpid::Messaging::Connection.new :url => options[:broker], :options => options[:connection_options]
+# process the connection options
+unless options[:connection_options].nil?
+ fields = options[:connection_options].gsub(/^{(.*)}$/, '\1')
+ # remove any surrounding braces
+ if /{.*}/ =~ fields
+ fields = fields[1..-2]
+ end
+ # break up the options separated by commas
+ keysvalues = {}
+ fields.split(",").each do |field|
+ if /.+:.+/ =~ field
+ (key, value) = field.split(":")
+ keysvalues[key] = value
+ end
+ end
+ # now store the options
+ options[:connection_options] = keysvalues
+end
+
+connection = Qpid::Messaging::Connection.new(:url => options[:broker],
+ :options => options[:connection_options])
connection.open
session = connection.create_session
sender = session.create_sender options[:address]
@@ -114,6 +141,7 @@ options[:properties].each_key {|key| mes
elsif options[:content]
message.content = options[:content]
end
+ message.durable = options[:durable]
message.content = options[:content] unless options[:content].nil?
message.properties["spout-id"] = "#{count}"
message.reply_to = options[:replyto] unless options[:replyto].nil? || options[:replyto].empty?
Modified: qpid/branches/linearstore/qpid/cpp/bld-winsdk.ps1
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/bld-winsdk.ps1?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/bld-winsdk.ps1 (original)
+++ qpid/branches/linearstore/qpid/cpp/bld-winsdk.ps1 Fri Sep 20 18:59:30 2013
@@ -218,19 +218,17 @@ function BuildAPlatform
('bin/msvc*.dll', 'bin/Release') ,
('bin/*d.dll', 'bin/Debug'),
('bin/*.dll', 'bin/Release'),
- ('bin/*test.exe', 'bin/Release')
+ ('bin/*test.exe', 'bin/Release'),
+ ('bin/qpid-send.exe', 'bin/Release'),
+ ('bin/qpid-receive.exe', 'bin/Release')
)
$preserve=(
- 'include/qpid/agent',
- 'include/qpid/amqp_0_10',
- 'include/qpid/management',
'include/qpid/messaging',
'include/qpid/sys/IntegerTypes.h',
'include/qpid/sys/windows/IntegerTypes.h',
'include/qpid/sys/posix/IntegerTypes.h',
'include/qpid/types',
- 'include/qpid/CommonImportExport.h',
'include/qpid/ImportExport.h')
$remove=(
@@ -244,8 +242,10 @@ function BuildAPlatform
'bin/*PDB/qpidxarm*.*',
'bin/boost_regex*.*',
'bin/boost',
+ 'bin/*.exe',
+ 'bin/qmf-gen',
+ 'bin/qpidt',
'conf',
- 'examples/qmf-console',
'examples/*.sln',
'examples/*.vcproj',
'examples/messaging/*.vcproj',
@@ -287,8 +287,8 @@ function BuildAPlatform
# Set top level info files to DOS line endings
Unix2Dos "$install_dir/README-winsdk.txt"
- Unix2Dos "$install_dir/LICENSE"
- Unix2Dos "$install_dir/NOTICE"
+ Unix2Dos "$install_dir/docs/LICENSE"
+ Unix2Dos "$install_dir/docs/NOTICE"
Unix2Dos "$install_dir/examples/README.txt"
# Install the .NET binding example source code
Propchange: qpid/branches/linearstore/qpid/cpp/docs/api/
------------------------------------------------------------------------------
Merged /qpid/trunk/qpid/cpp/docs/api:r1501885-1525056
Modified: qpid/branches/linearstore/qpid/cpp/etc/qpidd.in
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/etc/qpidd.in?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/etc/qpidd.in (original)
+++ qpid/branches/linearstore/qpid/cpp/etc/qpidd.in Fri Sep 20 18:59:30 2013
@@ -63,9 +63,8 @@ if [ $RETVAL = 4 ]; then
fi
start() {
- [[ $QPID_DATA_DIR ]] || QPID_DATA_DIR=/var/lib/qpidd
echo -n $"Starting Qpid AMQP daemon: "
- daemon --pidfile $pidfile --check $prog --user qpidd @sbindir@/$prog --data-dir $QPID_DATA_DIR --daemon $QPIDD_OPTIONS
+ daemon --pidfile $pidfile --check $prog --user qpidd @sbindir@/$prog ${QPID_DATA_DIR:+--data-dir $QPID_DATA_DIR} --daemon $QPIDD_OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $lockfile
Modified: qpid/branches/linearstore/qpid/cpp/examples/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/examples/CMakeLists.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/examples/CMakeLists.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/examples/CMakeLists.txt Fri Sep 20 18:59:30 2013
@@ -90,6 +90,5 @@ if (MSVC)
COMPONENT ${QPID_COMPONENT_EXAMPLES})
endif (MSVC)
-add_subdirectory(qmf-console)
add_subdirectory(messaging)
-add_subdirectory(old_api)
+
Modified: qpid/branches/linearstore/qpid/cpp/examples/messaging/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/examples/messaging/CMakeLists.txt?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/examples/messaging/CMakeLists.txt (original)
+++ qpid/branches/linearstore/qpid/cpp/examples/messaging/CMakeLists.txt Fri Sep 20 18:59:30 2013
@@ -23,7 +23,7 @@
macro(add_messaging_example example)
add_executable(${example} ${example}.cpp OptionParser.cpp)
set_target_properties(${example} PROPERTIES OUTPUT_NAME ${example})
- target_link_libraries(${example} qpidmessaging ${_boost_libs_needed})
+ target_link_libraries(${example} qpidmessaging qpidtypes ${_boost_libs_needed})
# For installs, don't install the built example; that would be pointless.
# Install the things a user needs to build the example on-site.
install (FILES
@@ -49,6 +49,7 @@ add_messaging_example(map_sender)
add_messaging_example(client)
add_messaging_example(server)
+add_messaging_example(server_reconnect)
# These don't need Boost or OptionParser
add_executable(hello_world hello_world.cpp)
@@ -74,6 +75,7 @@ install (FILES
${CMAKE_CURRENT_SOURCE_DIR}/map_sender.cpp
${CMAKE_CURRENT_SOURCE_DIR}/client.cpp
${CMAKE_CURRENT_SOURCE_DIR}/server.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/server_reconnect.cpp
DESTINATION ${QPID_INSTALL_EXAMPLESDIR}/messaging
COMPONENT ${QPID_COMPONENT_EXAMPLES})
Modified: qpid/branches/linearstore/qpid/cpp/examples/messaging/drain.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/examples/messaging/drain.cpp?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/examples/messaging/drain.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/examples/messaging/drain.cpp Fri Sep 20 18:59:30 2013
@@ -90,15 +90,17 @@ int main(int argc, char** argv)
int count = options.getCount();
Message message;
int i = 0;
-
+
while (receiver.fetch(message, timeout)) {
- std::cout << "Message(properties=" << message.getProperties() << ", content='" ;
+ std::cout << "Message(properties=" << message.getProperties();
+ if (!message.getSubject().empty()) {
+ std::cout << ", subject='" << message.getSubject() << "'";
+ }
+ std::cout << ", content='";
if (message.getContentType() == "amqp/map") {
- Variant::Map map;
- decode(message, map);
- std::cout << map;
+ std::cout << message.getContentObject().asMap();
} else {
- std::cout << message.getContent();
+ std::cout << message.getContentObject();
}
std::cout << "')" << std::endl;
session.acknowledge();
@@ -106,7 +108,7 @@ int main(int argc, char** argv)
break;
}
receiver.close();
- session.close();
+ session.close();
connection.close();
return 0;
} catch(const std::exception& error) {
@@ -114,5 +116,5 @@ int main(int argc, char** argv)
connection.close();
}
}
- return 1;
+ return 1;
}
Modified: qpid/branches/linearstore/qpid/cpp/examples/messaging/map_receiver.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/examples/messaging/map_receiver.cpp?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/examples/messaging/map_receiver.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/examples/messaging/map_receiver.cpp Fri Sep 20 18:59:30 2013
@@ -39,15 +39,13 @@ int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
const char* address = argc>2 ? argv[2] : "message_queue; {create: always}";
std::string connectionOptions = argc > 3 ? argv[3] : "";
-
+
Connection connection(url, connectionOptions);
try {
connection.open();
Session session = connection.createSession();
Receiver receiver = session.createReceiver(address);
- Variant::Map content;
- decode(receiver.fetch(), content);
- std::cout << content << std::endl;
+ std::cout << receiver.fetch().getContentObject() << std::endl;
session.acknowledge();
receiver.close();
connection.close();
@@ -56,5 +54,5 @@ int main(int argc, char** argv) {
std::cout << error.what() << std::endl;
connection.close();
}
- return 1;
+ return 1;
}
Modified: qpid/branches/linearstore/qpid/cpp/examples/messaging/map_sender.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/examples/messaging/map_sender.cpp?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/examples/messaging/map_sender.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/examples/messaging/map_sender.cpp Fri Sep 20 18:59:30 2013
@@ -39,7 +39,7 @@ int main(int argc, char** argv) {
const char* url = argc>1 ? argv[1] : "amqp:tcp:127.0.0.1:5672";
const char* address = argc>2 ? argv[2] : "message_queue; {create: always}";
std::string connectionOptions = argc > 3 ? argv[3] : "";
-
+
Connection connection(url, connectionOptions);
try {
connection.open();
@@ -57,8 +57,8 @@ int main(int argc, char** argv) {
colours.push_back(Variant("white"));
content["colours"] = colours;
content["uuid"] = Uuid(true);
- encode(content, message);
-
+ message.setContentObject(content);
+
sender.send(message, true);
connection.close();
Modified: qpid/branches/linearstore/qpid/cpp/examples/messaging/spout.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/examples/messaging/spout.cpp?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/examples/messaging/spout.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/examples/messaging/spout.cpp Fri Sep 20 18:59:30 2013
@@ -43,6 +43,7 @@ struct Options : OptionParser
std::string url;
std::string address;
int timeout;
+ bool durable;
int count;
std::string id;
std::string replyto;
@@ -55,10 +56,12 @@ struct Options : OptionParser
: OptionParser("Usage: spout [OPTIONS] ADDRESS", "Send messages to the specified address"),
url("127.0.0.1"),
timeout(0),
- count(1)
+ count(1),
+ durable(false)
{
add("broker,b", url, "url of broker to connect to");
add("timeout,t", timeout, "exit after the specified time");
+ add("durable,d", durable, "make the message durable (def. transient)");
add("count,c", count, "stop after count messages have been sent, zero disables");
add("id,i", id, "use the supplied id instead of generating one");
add("reply-to", replyto, "specify reply-to address");
@@ -127,6 +130,11 @@ struct Options : OptionParser
return true;
}
}
+
+ bool isDurable() const
+ {
+ return durable;
+ }
};
@@ -141,14 +149,16 @@ int main(int argc, char** argv)
Sender sender = session.createSender(options.address);
Message message;
+ message.setDurable(options.isDurable());
options.setProperties(message);
+ Variant& obj = message.getContentObject();
if (options.entries.size()) {
Variant::Map content;
options.setEntries(content);
- encode(content, message);
+ obj = content;
} else if (options.content.size()) {
- message.setContent(options.content);
- message.setContentType("text/plain");
+ obj = options.content;
+ obj.setEncoding("utf8");
}
std::time_t start = std::time(0);
for (int count = 0;
Modified: qpid/branches/linearstore/qpid/cpp/include/qpid/ImportExport.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/include/qpid/ImportExport.h?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/include/qpid/ImportExport.h (original)
+++ qpid/branches/linearstore/qpid/cpp/include/qpid/ImportExport.h Fri Sep 20 18:59:30 2013
@@ -60,12 +60,16 @@
//
// Non-Windows (Linux, etc.) definitions:
//
+#if __GNUC__ >= 4
+# define QPID_EXPORT __attribute ((visibility ("default")))
+#else
# define QPID_EXPORT
+#endif
# define QPID_IMPORT
-# define QPID_CLASS_EXPORT
-# define QPID_CLASS_IMPORT
-# define QPID_INLINE_EXPORT
-# define QPID_INLINE_IMPORT
+# define QPID_CLASS_EXPORT QPID_EXPORT
+# define QPID_CLASS_IMPORT QPID_IMPORT
+# define QPID_INLINE_EXPORT QPID_EXPORT
+# define QPID_INLINE_IMPORT QPID_IMPORT
#endif
#endif /*!QPID_IMPORTEXPORT_H*/
Modified: qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/Connection.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/Connection.h?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/Connection.h (original)
+++ qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/Connection.h Fri Sep 20 18:59:30 2013
@@ -98,6 +98,33 @@ class QPID_MESSAGING_CLASS_EXTERN Connec
QPID_MESSAGING_EXTERN void open();
QPID_MESSAGING_EXTERN bool isOpen();
QPID_MESSAGING_EXTERN bool isOpen() const;
+
+ /**
+ * Attempts to reconnect to the specified url, re-establish
+ * existing sessions, senders and receivers and resend any indoubt
+ * messages.
+ *
+ * This can be used to directly control reconnect behaviour rather
+ * than using the reconnect option for automatically handling
+ * that.
+ */
+ QPID_MESSAGING_EXTERN void reconnect(const std::string& url);
+ /**
+ * Attempts to reconnect to the original url, including any
+ * specified reconnect_urls, re-establish existing sessions,
+ * senders and receivers and resend any indoubt messages.
+ *
+ * This can be used to directly control reconnect behaviour rather
+ * than using the reconnect option for automatically handling
+ * that.
+ */
+ QPID_MESSAGING_EXTERN void reconnect();
+ /**
+ * returns a url reprsenting the broker the client is currently
+ * connected to (or an e,pty string if it is not connected).
+ */
+ QPID_MESSAGING_EXTERN std::string getUrl() const;
+
/**
* Closes a connection and all sessions associated with it. An
* opened connection must be closed before the last handle is
Modified: qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/Message.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/Message.h?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/Message.h (original)
+++ qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/Message.h Fri Sep 20 18:59:30 2013
@@ -42,6 +42,7 @@ class MessageImpl;
class QPID_MESSAGING_CLASS_EXTERN Message
{
public:
+ QPID_MESSAGING_EXTERN Message(qpid::types::Variant&);
QPID_MESSAGING_EXTERN Message(const std::string& bytes = std::string());
QPID_MESSAGING_EXTERN Message(const char*, size_t);
QPID_MESSAGING_EXTERN Message(const Message&);
@@ -148,6 +149,7 @@ class QPID_MESSAGING_CLASS_EXTERN Messag
*/
QPID_MESSAGING_EXTERN const qpid::types::Variant::Map& getProperties() const;
QPID_MESSAGING_EXTERN qpid::types::Variant::Map& getProperties();
+ QPID_MESSAGING_EXTERN void setProperties(const qpid::types::Variant::Map&);
/**
* Set the content to the data held in the string parameter. Note:
@@ -164,6 +166,27 @@ class QPID_MESSAGING_CLASS_EXTERN Messag
/** Get the content as a std::string */
QPID_MESSAGING_EXTERN std::string getContent() const;
+ /** Get the content as raw bytes (an alias for getContent() */
+ QPID_MESSAGING_EXTERN std::string getContentBytes() const;
+ /** Set the content as raw bytes (an alias for setContent() */
+ QPID_MESSAGING_EXTERN void setContentBytes(const std::string&);
+ /**
+ * Get the content as a Variant, which can represent an object of
+ * different types. This can be used for content representing a
+ * map or a list for example.
+ */
+ QPID_MESSAGING_EXTERN qpid::types::Variant& getContentObject();
+ /**
+ * Get the content as a Variant, which can represent an object of
+ * different types. This can be used for content representing a
+ * map or a list for example.
+ */
+ QPID_MESSAGING_EXTERN const qpid::types::Variant& getContentObject() const;
+ /**
+ * Set the content using a Variant, which can represent an object
+ * of different types.
+ */
+ QPID_MESSAGING_EXTERN void setContentObject(const qpid::types::Variant&);
/**
* Get a const pointer to the start of the content data. The
* memory pointed to is owned by the message. The getContentSize()
Modified: qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/exceptions.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/exceptions.h?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/exceptions.h (original)
+++ qpid/branches/linearstore/qpid/cpp/include/qpid/messaging/exceptions.h Fri Sep 20 18:59:30 2013
@@ -40,9 +40,6 @@ struct QPID_MESSAGING_CLASS_EXTERN Messa
{
QPID_MESSAGING_EXTERN MessagingException(const std::string& msg);
QPID_MESSAGING_EXTERN virtual ~MessagingException() throw();
-
- qpid::types::Variant::Map detail;
- //TODO: override what() to include detail if present
};
/**
Modified: qpid/branches/linearstore/qpid/cpp/include/qpid/swig_python_typemaps.i
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/include/qpid/swig_python_typemaps.i?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/include/qpid/swig_python_typemaps.i (original)
+++ qpid/branches/linearstore/qpid/cpp/include/qpid/swig_python_typemaps.i Fri Sep 20 18:59:30 2013
@@ -61,6 +61,11 @@ typedef int Py_ssize_t;
if (PyInt_Check(value)) return qpid::types::Variant(int64_t(PyInt_AS_LONG(value)));
if (PyLong_Check(value)) return qpid::types::Variant(int64_t(PyLong_AsLongLong(value)));
if (PyString_Check(value)) return qpid::types::Variant(std::string(PyString_AS_STRING(value)));
+ if (PyUnicode_Check(value)) {
+ qpid::types::Variant v(std::string(PyUnicode_AS_DATA(value)));
+ v.setEncoding("utf8");
+ return v;
+ }
if (PyDict_Check(value)) {
qpid::types::Variant::Map map;
PyToMap(value, &map);
@@ -116,7 +121,10 @@ typedef int Py_ssize_t;
}
case qpid::types::VAR_STRING : {
const std::string val(v->asString());
- result = PyString_FromStringAndSize(val.c_str(), val.size());
+ if (v->getEncoding() == "utf8")
+ result = PyUnicode_DecodeUTF8(val.c_str(), val.size(), NULL);
+ else
+ result = PyString_FromStringAndSize(val.c_str(), val.size());
break;
}
case qpid::types::VAR_MAP : {
Modified: qpid/branches/linearstore/qpid/cpp/include/qpid/types/Uuid.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/include/qpid/types/Uuid.h?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/include/qpid/types/Uuid.h (original)
+++ qpid/branches/linearstore/qpid/cpp/include/qpid/types/Uuid.h Fri Sep 20 18:59:30 2013
@@ -32,7 +32,7 @@ namespace types {
class QPID_TYPES_CLASS_EXTERN Uuid
{
public:
- static const size_t SIZE;
+ QPID_TYPES_EXTERN static const size_t SIZE;
/**
* If unique is true, this will generate a new unique uuid, if not
* it will construct a null uuid.
@@ -42,6 +42,7 @@ class QPID_TYPES_CLASS_EXTERN Uuid
QPID_TYPES_EXTERN Uuid& operator=(const Uuid&);
/** Copy the UUID from data16, which must point to a 16-byte UUID */
QPID_TYPES_EXTERN Uuid(const unsigned char* data16);
+ QPID_TYPES_EXTERN Uuid(const char* data16);
/** Set to a new unique identifier. */
QPID_TYPES_EXTERN void generate();
@@ -81,6 +82,9 @@ class QPID_TYPES_CLASS_EXTERN Uuid
unsigned char bytes[16];
};
+/** Hash value function for use with boots::hash or std::hash */
+inline size_t hash_value(const Uuid& uuid) { return uuid.hash(); }
+
/** Returns true if the uuids are equal, false otherwise. **/
QPID_TYPES_EXTERN bool operator==(const Uuid&, const Uuid&);
/** Returns true if the uuids are NOT equal, false if they are. **/
Modified: qpid/branches/linearstore/qpid/cpp/include/qpid/types/Variant.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/include/qpid/types/Variant.h?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/include/qpid/types/Variant.h (original)
+++ qpid/branches/linearstore/qpid/cpp/include/qpid/types/Variant.h Fri Sep 20 18:59:30 2013
@@ -38,7 +38,8 @@ namespace types {
*/
struct QPID_TYPES_CLASS_EXTERN InvalidConversion : public Exception
{
- InvalidConversion(const std::string& msg);
+ QPID_TYPES_EXTERN InvalidConversion(const std::string& msg);
+ QPID_TYPES_EXTERN ~InvalidConversion() throw();
};
enum VariantType {
Modified: qpid/branches/linearstore/qpid/cpp/managementgen/qmfgen/templates/Class.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/managementgen/qmfgen/templates/Class.cpp?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/managementgen/qmfgen/templates/Class.cpp (original)
+++ qpid/branches/linearstore/qpid/cpp/managementgen/qmfgen/templates/Class.cpp Fri Sep 20 18:59:30 2013
@@ -70,6 +70,16 @@ uint8_t /*MGEN:Class.NameCap*/::md5Sum[M
/*MGEN:Class.NameCap*/::~/*MGEN:Class.NameCap*/ ()
{
+/*MGEN:IF(Class.ExistPerThreadStats)*/
+ for (int idx = 0; idx < maxThreads; idx++)
+ if (perThreadStatsArray[idx] != 0)
+ delete perThreadStatsArray[idx];
+ delete[] perThreadStatsArray;
+/*MGEN:ENDIF*/
+}
+
+void /*MGEN:Class.NameCap*/::debugStats (const std::string& comment)
+{
/*MGEN:IF(Root.GenLogs)*/
bool logEnabled;
QPID_LOG_TEST_CAT(trace, model, logEnabled);
@@ -77,19 +87,14 @@ uint8_t /*MGEN:Class.NameCap*/::md5Sum[M
{
::qpid::types::Variant::Map map;
mapEncodeValues(map, false, true);
- QPID_LOG_CAT(trace, model, "Mgmt delete " << className
+ QPID_LOG_CAT(trace, model, "Mgmt " << comment << ((comment!="")?(" "):("")) << className
<< ". id:" << getKey()
<< " Statistics: " << map);
}
/*MGEN:ENDIF*/
-/*MGEN:IF(Class.ExistPerThreadStats)*/
- for (int idx = 0; idx < maxThreads; idx++)
- if (perThreadStatsArray[idx] != 0)
- delete perThreadStatsArray[idx];
- delete[] perThreadStatsArray;
-/*MGEN:ENDIF*/
}
+
namespace {
const string NAME("name");
const string TYPE("type");
Modified: qpid/branches/linearstore/qpid/cpp/managementgen/qmfgen/templates/Class.h
URL: http://svn.apache.org/viewvc/qpid/branches/linearstore/qpid/cpp/managementgen/qmfgen/templates/Class.h?rev=1525101&r1=1525100&r2=1525101&view=diff
==============================================================================
--- qpid/branches/linearstore/qpid/cpp/managementgen/qmfgen/templates/Class.h (original)
+++ qpid/branches/linearstore/qpid/cpp/managementgen/qmfgen/templates/Class.h Fri Sep 20 18:59:30 2013
@@ -118,6 +118,8 @@ namespace qmf {
/*MGEN:Root.ExternMethod*/ ~/*MGEN:Class.NameCap*/();
+ void debugStats (const std::string& comment);
+
/*MGEN:Class.SetGeneralReferenceDeclaration*/
/*MGEN:Root.ExternMethod*/ static void registerSelf(
Propchange: qpid/branches/linearstore/qpid/cpp/src/
------------------------------------------------------------------------------
Merged /qpid/trunk/qpid/cpp/src:r1501885-1525056
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org