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/02/28 17:14:57 UTC
svn commit: r1451244 [3/45] - in /qpid/branches/asyncstore: ./ bin/ cpp/
cpp/bindings/ cpp/bindings/qmf/ cpp/bindings/qmf/python/
cpp/bindings/qmf/ruby/ cpp/bindings/qmf2/ cpp/bindings/qmf2/examples/cpp/
cpp/bindings/qmf2/python/ cpp/bindings/qmf2/ruby...
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/examples/perl/server.pl
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/examples/perl/server.pl?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/examples/perl/server.pl (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/examples/perl/server.pl Thu Feb 28 16:14:30 2013
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -20,43 +20,64 @@
use strict;
use warnings;
-use cqpid_perl;
+use qpid;
-my $url = ( @ARGV == 1 ) ? $ARGV[0] : "amqp:tcp:127.0.0.1:5672";
-my $connectionOptions = ( @ARGV > 1 ) ? $ARGV[1] : "";
+my $url = ( @ARGV == 1 ) ? $ARGV[0] : "amqp:tcp:127.0.0.1:5672";
+my $connectionOptions = ( @ARGV > 1 ) ? $ARGV[1] : "";
-
-my $connection = new cqpid_perl::Connection($url, $connectionOptions);
+# create a connection object
+my $connection = new qpid::messaging::Connection( $url, $connectionOptions );
eval {
+
+ # connect to the broker and create a session
$connection->open();
- my $session = $connection->createSession();
+ my $session = $connection->create_session();
- my $receiver = $session->createReceiver("service_queue; {create: always}");
+ # create a receiver for accepting incoming messages
+ my $receiver = $session->create_receiver("service_queue; {create: always}");
+ # go into an infinite loop to receive messages and process them
while (1) {
+
+ # wait for the next message to be processed
my $request = $receiver->fetch();
- my $address = $request->getReplyTo();
+
+
+ # get the address for sending replies
+ # if no address was supplised then we can't really respond, so
+ # only process when one is present
+ my $address = $request->get_reply_to();
if ($address) {
- my $sender = $session->createSender($address);
- my $s = $request->getContent();
+
+ # a temporary sender for sending to the response queue
+ my $sender = $session->create_sender($address);
+ my $s = $request->get_content();
$s = uc($s);
- my $response = new cqpid_perl::Message($s);
+
+ # create the response message and send it
+ my $response = new qpid::messaging::Message($s);
$sender->send($response);
- print "Processed request: " . $request->getContent() . " -> " . $response->getContent() . "\n";
+ print "Processed request: "
+ . $request->get_content() . " -> "
+ . $response->get_content() . "\n";
+
+ # acknowledge the message since it was processed
$session->acknowledge();
}
else {
- print "Error: no reply address specified for request: " . $request->getContent() . "\n";
+ print "Error: no reply address specified for request: "
+ . $request->get_content() . "\n";
$session->reject($request);
}
}
-$connection->close();
+ # close connections to clean up
+ $session->close();
+ $connection->close();
};
if ($@) {
die $@;
}
-
Propchange: qpid/branches/asyncstore/cpp/bindings/qpid/examples/perl/server.pl
------------------------------------------------------------------------------
svn:executable = *
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/examples/perl/spout.pl
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/examples/perl/spout.pl?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/examples/perl/spout.pl (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/examples/perl/spout.pl Thu Feb 28 16:14:30 2013
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -20,117 +20,145 @@
use strict;
use warnings;
-use cqpid_perl;
+use qpid;
use Getopt::Long;
+use Pod::Usage;
use Time::Local;
-my $url = "127.0.0.1";
+my $url = "127.0.0.1";
my $timeout = 0;
my $count = 1;
my $id = "";
my $replyto = "";
my @properties;
my @entries;
-my $content = "";
+my $content = "";
my $connectionOptions = "";
-my $address = "amq.direct";
+my $address = "amq.direct";
+my $help;
my $result = GetOptions(
- "broker|b=s" => \ $url,
- "timeout|t=i" => \ $timeout,
- "count|c=i" => \ $count,
- "id|i=s" => \ $id,
- "replyto=s" => \ $replyto,
- "property|p=s@" => \ @properties,
- "map|m=s@" => \ @entries,
- "content=s" => \ $content,
- "connection-options=s" => \ $connectionOptions,
-);
+ "broker|b=s" => \$url,
+ "timeout|t=i" => \$timeout,
+ "count|c=i" => \$count,
+ "id|i=s" => \$id,
+ "replyto=s" => \$replyto,
+ "property|p=s@" => \@properties,
+ "map|m=s@" => \@entries,
+ "content=s" => \$content,
+ "connection-options=s" => \$connectionOptions,
+ "help|h" => \$help
+) || pod2usage( -verbose => 0 );
+pod2usage( -verbose => 1 ) if $help;
-if (! $result) {
- print "Usage: perl drain.pl [OPTIONS]\n";
+if ( $#ARGV ge 0 ) {
+ $address = $ARGV[0];
}
-
-if ($#ARGV ge 0) {
- $address = $ARGV[0]
-}
-
-
sub setEntries {
my ($content) = @_;
foreach (@entries) {
- my ($name, $value) = split("=", $_);
+ my ( $name, $value ) = split( "=", $_ );
$content->{$name} = $value;
}
}
-
sub setProperties {
my ($message) = @_;
foreach (@properties) {
- my ($name, $value) = split("=", $_);
- $message->getProperties()->{$name} = $value;
+ my ( $name, $value ) = split( "=", $_ );
+ $message->setProperty( $name, $value );
}
}
-my $connection = new cqpid_perl::Connection($url, $connectionOptions);
+# create a connection object
+my $connection = new qpid::messaging::Connection( $url, $connectionOptions );
eval {
+ # open the connection, create a session and then a sender
$connection->open();
- my $session = $connection->createSession();
- my $sender = $session->createSender($address);
+ my $session = $connection->create_session();
+ my $sender = $session->create_sender($address);
- my $message = new cqpid_perl::Message();
+ # create a message to be sent
+ my $message = new qpid::messaging::Message();
setProperties($message) if (@properties);
if (@entries) {
my $content = {};
setEntries($content);
- cqpid_perl::encode($content, $message);
+ $message->set_content($content);
}
elsif ($content) {
- $message->setContent($content);
- $message->setContentType("text/plain");
+ $message->set_content($content);
+ $message->set_content_type("text/plain");
}
+ # if a reply-to address was supplied, then create a receiver from the
+ # session and wait for a response to be sent
my $receiver;
if ($replyto) {
- my $responseQueue = new cqpid_perl::Address($replyto);
- $receiver = $session->createReceiver($responseQueue);
- $message->setReplyTo($responseQueue);
+ my $responseQueue = new qpid::messaging::Address($replyto);
+ $receiver = $session->create_receiver($responseQueue);
+ $message->set_reply_to($responseQueue);
}
my $start = localtime;
- my @s = split(/[:\s]/, $start);
- my $s = "$s[3]$s[4]$s[5]";
- my $n = $s;
-
- for (my $i = 0;
- ($i < $count || $count == 0) and
- ($timeout == 0 || abs($n - $s) < $timeout);
- $i++) {
+ my @s = split( /[:\s]/, $start );
+ my $s = "$s[3]$s[4]$s[5]";
+ my $n = $s;
+
+ for (
+ my $i = 0 ;
+ ( $i < $count || $count == 0 )
+ and ( $timeout == 0 || abs( $n - $s ) < $timeout ) ;
+ $i++
+ )
+ {
$sender->send($message);
if ($receiver) {
+ print "Waiting for a response.\n";
my $response = $receiver->fetch();
- print "$i -> " . $response->getContent() . "\n";
+ print "$i -> " . $response->get_content() . "\n";
}
my $now = localtime;
- my @n = split(/[:\s]/, $now);
- my $n = "$n[3]$n[4]$n[5]";
+ my @n = split( /[:\s]/, $now );
+ my $n = "$n[3]$n[4]$n[5]";
}
$session->sync();
$connection->close();
};
if ($@) {
- $connection->close();
- die $@;
+ $connection->close();
+ die $@;
}
+__END__
+
+=head1 NAME
+
+spout - Send messages to the specified address
+
+=head1 SYNOPSIS
+
+ Usage: spout [OPTIONS] ADDRESS
+
+ Options:
+ -h, --help show this message
+ -b VALUE, --broker VALUE url of broker to connect to
+ -t VALUE, --timeout VALUE exit after the specified time
+ -c VALUE, --count VALUE stop after count messageshave been sent, zero disables
+ -i VALUE, --id VALUE use the supplied id instead of generating one
+ --replyto VALUE specify reply-to value
+ -P VALUE, --property VALUE specify message property
+ -M VALUE, --map VALUE specify entry for map content
+ --content VALUE specify textual content
+ --connection-options VALUE connection options string in the form {name1:value1, name2:value2}
+=cut
Propchange: qpid/branches/asyncstore/cpp/bindings/qpid/examples/perl/spout.pl
------------------------------------------------------------------------------
svn:executable = *
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/perl/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/perl/CMakeLists.txt?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/perl/CMakeLists.txt (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/perl/CMakeLists.txt Thu Feb 28 16:14:30 2013
@@ -21,18 +21,25 @@
## Use Swig to generate a literal binding to the C++ API
##------------------------------------------------------
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/perl.i PROPERTIES CPLUSPLUS ON)
-set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/perl.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include")
+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")
swig_add_module(cqpid_perl perl ${CMAKE_CURRENT_SOURCE_DIR}/perl.i)
swig_link_libraries(cqpid_perl qpidmessaging qpidtypes qmf2 ${PERL_LIBRARY})
-set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -I${PERL_INCLUDE_PATH} -I${qpid-cpp_SOURCE_DIR}/include")
+set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing")
+include_directories(${PERL_INCLUDE_PATH}
+ ${qpid-cpp_SOURCE_DIR}/include
+ ${qpid-cpp_SOURCE_DIR}/bindings)
##----------------------------------
## Install the complete Perl binding
##----------------------------------
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqpid_perl.so
${CMAKE_CURRENT_BINARY_DIR}/cqpid_perl.pm
- DESTINATION ${PERL_ARCHLIB}
+ ${CMAKE_CURRENT_SOURCE_DIR}/qpid.pm
+ ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE
+ ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.PL
+ DESTINATION ${PERL_PFX_ARCHLIB}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/perl/perl.i
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/perl/perl.i?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/perl/perl.i (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/perl/perl.i Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
%module cqpid_perl
%include "std_string.i"
-%include "../../swig_perl_typemaps.i"
+%include "qpid/swig_perl_typemaps.i"
/* Define the general-purpose exception handling */
%exception {
@@ -31,5 +31,5 @@
}
}
-%include "../qpid.i"
+%include "qpid/qpid.i"
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/python/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/python/CMakeLists.txt?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/python/CMakeLists.txt (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/python/CMakeLists.txt Thu Feb 28 16:14:30 2013
@@ -21,17 +21,20 @@
## Use Swig to generate a literal binding to the C++ API
##------------------------------------------------------
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES CPLUSPLUS ON)
-set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include")
+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})
-set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -I${PYTHON_INCLUDE_PATH} -I${qpid-cpp_SOURCE_DIR}/include")
+set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing")
+include_directories(${PYTHON_INCLUDE_PATH}
+ ${qpid-cpp_SOURCE_DIR}/include
+ ${qpid-cpp_SOURCE_DIR}/bindings)
##------------------------------------
## Install the complete Python binding
##------------------------------------
-execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cqpid.py
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cqpid.py
@@ -39,12 +42,12 @@ install(CODE "execute_process(COMMAND ${
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqpid.py
${CMAKE_CURRENT_BINARY_DIR}/cqpid.pyc
${CMAKE_CURRENT_BINARY_DIR}/cqpid.pyo
- DESTINATION ${PYTHON_SITE_PACKAGES}
+ DESTINATION ${PYTHON_SITEARCH_PACKAGES}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_cqpid_python.so
RENAME _cqpid.so
- DESTINATION ${PYTHON_SITE_PACKAGES}
+ DESTINATION ${PYTHON_SITEARCH_PACKAGES}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/python/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/python/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/python/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/python/Makefile.am Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
if HAVE_PYTHON_DEVEL
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src/qmf -I$(top_srcdir)/src -I$(top_builddir)/src
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/bindings -I$(top_builddir)/include -I$(top_srcdir)/src/qmf -I$(top_srcdir)/src -I$(top_builddir)/src
generated_file_list = \
cqpid.cpp \
@@ -29,7 +29,7 @@ EXTRA_DIST = CMakeLists.txt python.i
BUILT_SOURCES = $(generated_file_list)
SWIG_FLAGS = -w362,401
-$(generated_file_list): $(srcdir)/python.i $(srcdir)/../qpid.i $(srcdir)/../../swig_python_typemaps.i
+$(generated_file_list): $(srcdir)/python.i
$(SWIG) -c++ -python $(SWIG_FLAGS) $(INCLUDES) $(QPID_CXXFLAGS) -I$(top_srcdir)/src/qmf -I/usr/include -o cqpid.cpp $(srcdir)/python.i
pylibdir = $(pyexecdir)
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/python/python.i
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/python/python.i?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/python/python.i (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/python/python.i Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
%module cqpid
%include "std_string.i"
-%include "../../swig_python_typemaps.i"
+%include "qpid/swig_python_typemaps.i"
/* Needed for get/setPriority methods. Surprising SWIG 1.3.40 doesn't
* convert uint8_t by default. */
@@ -159,7 +159,7 @@ QPID_EXCEPTION(UnauthorizedAccess, Sessi
%rename(_setTtl) qpid::messaging::Message::setTtl;
-%include "../qpid.i"
+%include "qpid/qpid.i"
%extend qpid::messaging::Connection {
%pythoncode %{
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/CMakeLists.txt?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/CMakeLists.txt (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/CMakeLists.txt Thu Feb 28 16:14:30 2013
@@ -31,7 +31,9 @@ set(GEM_OUTPUT_FILE ${GEM_OUTPUT_PATH}/p
##------------------------------------------------------
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES CPLUSPLUS ON)
-include_directories(${RUBY_INCLUDE_DIRS} ${qpid-cpp_SOURCE_DIR}/include)
+include_directories(${RUBY_INCLUDE_DIRS}
+ ${qpid-cpp_SOURCE_DIR}/include
+ ${qpid-cpp_SOURCE_DIR}/bindings)
swig_add_module(cqpid_ruby ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i)
swig_link_libraries(cqpid_ruby qpidmessaging qpidtypes qmf2 ${RUBY_LIBRARY})
@@ -43,7 +45,7 @@ set_source_files_properties(${swig_gener
##----------------------------------
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqpid_ruby.so
RENAME cqpid.so
- DESTINATION ${RUBY_ARCH_DIR}
+ DESTINATION ${RUBY_PFX_ARCH_DIR}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/LICENSE
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/LICENSE?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/LICENSE (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/LICENSE Thu Feb 28 16:14:30 2013
@@ -1,7 +1,3 @@
-=========================================================================
-== Apache License ==
-=========================================================================
-
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/Makefile.am Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
if HAVE_RUBY_DEVEL
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_builddir)/src
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/bindings -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_builddir)/src
EXTRA_DIST = CMakeLists.txt ruby.i
BUILT_SOURCES = cqpid.cpp
@@ -27,7 +27,7 @@ SWIG_FLAGS = -w362,401
rubylibdir = $(RUBY_LIB)
-cqpid.cpp: $(srcdir)/ruby.i $(srcdir)/../qpid.i $(srcdir)/../../swig_ruby_typemaps.i
+cqpid.cpp: $(srcdir)/ruby.i
$(SWIG) -ruby -c++ $(SWIG_FLAGS) $(INCLUDES) $(QPID_CXXFLAGS) -I/usr/include -o cqpid.cpp $(srcdir)/ruby.i
rubylibarchdir = $(RUBY_LIB_ARCH)
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/README.rdoc
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/README.rdoc?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/README.rdoc (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/README.rdoc Thu Feb 28 16:14:30 2013
@@ -1,45 +1,41 @@
-= Qpid - Open Source AMQP Messaging
+= Qpid - Ruby language bindings for the Qpid messaging framework.
-Qpid is an cross-platform enterprise messaging system.
-
-Version :: 0.19.0
+Qpid is a cross-platform enterprise messaging system based on the open-source
+AMQP protocol.
= Links
Documents :: http://qpid.apache.org/
-= Installation
+= Building The Gemfile
+
+== Prerequisites
-You can install Qpid with the following command.
+You need to have the Qpid client libraries installed along with the related
+development files (headers, etc). To install them, please see:
- $ gem install qpid
+http://cwiki.apache.org/qpid/developer-pages.html
-== Building The Native Code
+== Gemfile Creation
-The Qpid gem requires that you have available the Qpid libraries and
-development header files. To install them, please see:
+Simply type:
-http://cwiki.apache.org/qpid/developer-pages.html
+ $ gem build qpid_messaging.gemspec
-If you are building the gem within the Qpid development environment
-itself, you can specify the location of the Qpid headers and
-libraries with:
+This will produce a gemfile name qpid_messaging-${VERSION}.gem.
-$ ruby extconfig.rb --with-qpid-lib=[path to libqpidclient.so, etc.]
-$ make
+== Installation
-== Examples
+You can install Qpid with the following command:
-Take a look at the integration tests for examples on how to leverage
-the messaging capabilities of Qpid in your Ruby applications.
+ $ gem install qpid_messaging-${VERSION}.gem
== License
Licensed to the Apache Software Foundation (ASF) under one or more
contributor licensing agreements.
-Author:: Darryl L. Pierce (mailto:dpierce@redhat.com)
-Copyright:: Copyright (c) 2011, Red Hat, Inc.
+Author:: Apache Qpid Project
Homepage:: http://qpid.apache.org
License:: Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/TODO
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/TODO?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/TODO (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/TODO Thu Feb 28 16:14:30 2013
@@ -1,7 +1,12 @@
-TODO Items
------------------------------------------------------------------------------
+Qpid Ruby bindigns TODO List
+==============================================================================
-Version 0.11.0:
- * Deliver the Ruby bindings as a gem.
- * Rework the blocking tasks to not bring the main thread to a halt.
+Beyond this simple laundry list, you can find the list of bugs and
+enhancements to be fixed by going to the Apache Qpid JIRA instance:
+ http://issues.apache.org/jira/browse/QPID
+
+
+Fixes & Improvements
+==============================================================================
+* Fix the threading issues with blocking I/O calls (Receiver get/fetch).
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/client.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/client.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/client.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/client.rb Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'qpid'
+require 'qpid_messaging'
if __FILE__ == $0
broker = ARGV[1] || "amqp:tcp:localhost:5672"
@@ -29,9 +29,7 @@ if __FILE__ == $0
connection.open
session = connection.create_session
sender = session.create_sender "service_queue"
- response_queue = Qpid::Messaging::Address.new("#response-queue", "",
- :create => :always,
- :delete => :always)
+ response_queue = Qpid::Messaging::Address.new("#response-queue;{create:always}")
receiver = session.create_receiver response_queue
["Twas brillig, and the slithy toves",
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/drain.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/drain.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/drain.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/drain.rb Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'qpid'
+require 'qpid_messaging'
require 'optparse'
options = {
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/hello_world.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/hello_world.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/hello_world.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/hello_world.rb Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'qpid'
+require 'qpid_messaging'
# This is your classic Hello World application, written in
# Ruby, that uses Qpid. It demonstrates how to send and
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/map_receiver.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/map_receiver.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/map_receiver.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/map_receiver.rb Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'qpid'
+require 'qpid_messaging'
broker = ARGV[0] || "amqp:tcp:127.0.0.1:5672"
address = ARGV[1] || "message_queue; {create: always}"
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/map_sender.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/map_sender.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/map_sender.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/map_sender.rb Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'qpid'
+require 'qpid_messaging'
broker = ARGV[0] || "amqp:tcp:127.0.0.1:5672"
address = ARGV[1] || "message_queue; {create: always}"
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/server.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/server.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/server.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/server.rb Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'qpid'
+require 'qpid_messaging'
if __FILE__ == $0
broker = ARGV[0] || "amqp:tcp:localhost:5672"
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/spout.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/spout.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/spout.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/examples/spout.rb Thu Feb 28 16:14:30 2013
@@ -19,7 +19,7 @@
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'qpid'
+require 'qpid_messaging'
require 'optparse'
options = {
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/ext/cqpid/extconf.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/ext/cqpid/extconf.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/ext/cqpid/extconf.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/ext/cqpid/extconf.rb Thu Feb 28 16:14:30 2013
@@ -26,9 +26,10 @@
require 'mkmf'
# Setup the build environment.
-$CFLAGS = "-fPIC -fno-inline -x c++"
+$CFLAGS = "-fPIC -fno-inline -x c++ -lstdc++"
REQUIRED_LIBRARIES = [
+ 'stdc++',
'qpidclient',
'qpidcommon',
'qpidmessaging',
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/creating_a_receiver.feature Thu Feb 28 16:14:30 2013
@@ -25,5 +25,5 @@ Feature: Creating a receiver
Scenario: Using an Address object
Given an open session
- And an Address with the name "create-receiver-test" and subject "foo" and option "create" set to "always" and "delete" set to "always"
+ And an Address with the string "create-receiver-test;{create:always}"
Then creating a receiver with an Address succeeds
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/creating_a_sender.feature
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/creating_a_sender.feature?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/creating_a_sender.feature (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/creating_a_sender.feature Thu Feb 28 16:14:30 2013
@@ -21,5 +21,5 @@ Feature: Creating a sender
Scenario: Using an Address object
Given an open session
- And an Address with the name "my-queue" and subject "my-subject" and option "create" set to "always"
+ And an Address with the string "my-queue/my-subject;{create:always}"
Then creating a sender with an Address succeeds
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/step_definitions/address_steps.rb Thu Feb 28 16:14:30 2013
@@ -17,15 +17,6 @@
# under the License.
#
-Given /^an Address with the name "([^"]*)" and subject "([^"]*)" and option "([^"]*)" set to "([^"]*)"$/ do |name, subject, key, value|
- options = Hash.new
- options["#{key}"] = "#{value}"
- @address = Qpid::Messaging::Address.new "#{name}", "#{subject}", options
-end
-
-Given /^an Address with the name "([^"]*)" and subject "([^"]*)" and option "([^"]*)" set to "([^"]*)" and "([^"]*)" set to "([^"]*)"$/ do |name, subject, key1, value1, key2, value2|
- options = Hash.new
- options["#{key1}"] = "#{value1}"
- options["#{key2}"] = "#{value2}"
- @address = Qpid::Messaging::Address.new "#{name}", "#{subject}", options
+Given /^an Address with the string "(.*?)"$/ do |address|
+ @address = Qpid::Messaging::Address.new "#{address}"
end
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/support/env.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/support/env.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/support/env.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/features/support/env.rb Thu Feb 28 16:14:30 2013
@@ -19,4 +19,4 @@
$LOAD_PATH.unshift(File.dirname(__FILE__) + "/../../lib")
-require 'qpid'
+require 'qpid_messaging'
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/ruby.i
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/ruby.i?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/ruby.i (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/ruby.i Thu Feb 28 16:14:30 2013
@@ -18,8 +18,10 @@
*/
%module cqpid
+/* Ruby doesn't have a != operator*/
+#pragma SWIG nowarn=378
%include "std_string.i"
-%include "../../swig_ruby_typemaps.i"
+%include "qpid/swig_ruby_typemaps.i"
/* Define the general-purpose exception handling */
%exception {
@@ -32,5 +34,5 @@
}
}
-%include "../qpid.i"
+%include "qpid/qpid.i"
Modified: qpid/branches/asyncstore/cpp/bindings/qpid/ruby/spec/spec_helper.rb
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bindings/qpid/ruby/spec/spec_helper.rb?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bindings/qpid/ruby/spec/spec_helper.rb (original)
+++ qpid/branches/asyncstore/cpp/bindings/qpid/ruby/spec/spec_helper.rb Thu Feb 28 16:14:30 2013
@@ -17,5 +17,4 @@
# under the License.
#
-require 'qpid'
-require 'cqpid'
+require 'qpid_messaging'
Modified: qpid/branches/asyncstore/cpp/bld-winsdk.ps1
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/bld-winsdk.ps1?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/bld-winsdk.ps1 (original)
+++ qpid/branches/asyncstore/cpp/bld-winsdk.ps1 Thu Feb 28 16:14:30 2013
@@ -245,13 +245,7 @@ function BuildAPlatform
'bin/boost_regex*.*',
'bin/boost',
'conf',
- 'examples/direct',
- 'examples/failover',
- 'examples/fanout',
- 'examples/pub-sub',
'examples/qmf-console',
- 'examples/request-response',
- 'examples/tradedemo',
'examples/*.sln',
'examples/*.vcproj',
'examples/messaging/*.vcproj',
Modified: qpid/branches/asyncstore/cpp/configure.ac
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/configure.ac?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/configure.ac (original)
+++ qpid/branches/asyncstore/cpp/configure.ac Thu Feb 28 16:14:30 2013
@@ -29,6 +29,10 @@ AC_PROG_CXX
AC_USE_SYSTEM_EXTENSIONS
AC_LANG([C++])
+# Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it
+# doesn't exist)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
+
# Check for optional use of help2man
AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
AC_ARG_WITH([help2man],
@@ -146,7 +150,7 @@ AM_CONDITIONAL([HAS_RPMLINT], [test -n "
AC_CHECK_PROG([RUBY], [ruby], [ruby])
# Swig binding generator is needed for the script (Ruby, Python, etc.) bindings.
-AC_PROG_SWIG(1.3.26)
+AC_PROG_SWIG(1.3.32)
test ! -x "$SWIG" && SWIG=""
AC_ARG_WITH([swig],
[AS_HELP_STRING([--with-swig], [Use swig to generate qmf bindings.])],
@@ -210,10 +214,11 @@ AS_IF([test -n "$PYTHON"], [
# location
AC_MSG_WARN([Didn't find Python 2.7 developer libs - looking for older version])
PYTHON_INC=$($PYTHON -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc()')
- AC_CHECK_LIB([python$PYTHON_VERSION],[Py_Initialize])
+ AC_CHECK_LIB([python$PYTHON_VERSION],[Py_Initialize],[
+ PYTHON_LIBS="-lpython$PYTHON_VERSION"
+ ])
AC_CHECK_FILE(["$PYTHON_INC/Python.h"],[
PYTHON_CFLAGS="-I$PYTHON_INC"
- PYTHON_LIBS="-lpython$PYTHON_VERSION"
have_python_dev=yes
],[
if test yes = "$with_python" ; then
@@ -296,6 +301,15 @@ AS_IF([test "x$WANT_SASL" != xno],
AM_CONDITIONAL([HAVE_SASL], [test "x$have_sasl" = xyes])
AC_SUBST([SASL_PASSWD])
+# Allow integration against external AMQP 1.0 protocol engine
+AC_ARG_WITH([proton], AS_HELP_STRING([--with-proton], [Build with the proton toolkit for AMQP 1.0 support]))
+
+AS_IF([test "x$with_proton" = "xyes"], [
+ PKG_CHECK_MODULES([PROTON], [libqpid-proton])
+])
+AM_CONDITIONAL([HAVE_PROTON], [test "x$with_proton" = "xyes"])
+
+
# Setup --with-xml/--without-xml as arguments to configure
use_xml=yes
want_xml=check
@@ -525,7 +539,6 @@ AC_CONFIG_FILES([
managementgen/Makefile
etc/Makefile
src/Makefile
- src/tests/cpg_check.sh
src/tests/Makefile
src/tests/test_env.sh
src/tests/install_env.sh
Modified: qpid/branches/asyncstore/cpp/design_docs/new-ha-design.txt
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/design_docs/new-ha-design.txt?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/design_docs/new-ha-design.txt (original)
+++ qpid/branches/asyncstore/cpp/design_docs/new-ha-design.txt Thu Feb 28 16:14:30 2013
@@ -84,12 +84,6 @@ retry on a single address to fail over.
support configuring a fixed list of broker addresses when qpid is run
outside of a resource manager.
-Aside: Cold-standby is also possible using rgmanager with shared
-storage for the message store (e.g. GFS). If the broker fails, another
-broker is started on a different node and and recovers from the
-store. This bears investigation but the store recovery times are
-likely too long for failover.
-
** Replicating configuration
New queues and exchanges and their bindings also need to be replicated.
@@ -109,13 +103,9 @@ configuration.
Explicit exchange/queue qpid.replicate argument:
- none: the object is not replicated
- configuration: queues, exchanges and bindings are replicated but messages are not.
-- messages: configuration and messages are replicated.
-
-TODO: provide configurable default for qpid.replicate
+- all: configuration and messages are replicated.
-[GRS: current prototype relies on queue sequence for message identity
-so selectively replicating certain messages on a given queue would be
-challenging. Selectively replicating certain queues however is trivial.]
+Set configurable default all/configuration/none
** Inconsistent errors
@@ -125,12 +115,13 @@ eliminates the need to stall the whole c
resolved. We still have to handle inconsistent store errors when store
and cluster are used together.
-We have 2 options (configurable) for handling inconsistent errors,
+We have 3 options (configurable) for handling inconsistent errors,
on the backup that fails to store a message from primary we can:
- Abort the backup broker allowing it to be re-started.
- Raise a critical error on the backup broker but carry on with the message lost.
-We can configure the option to abort or carry on per-queue, we
-will also provide a broker-wide configurable default.
+- Reset and re-try replication for just the affected queue.
+
+We will provide some configurable options in this regard.
** New backups connecting to primary.
@@ -156,8 +147,8 @@ In backup mode, brokers reject connectio
so clients will fail over to the primary. HA admin tools mark their
connections so they are allowed to connect to backup brokers.
-Clients discover the primary by re-trying connection to the client URL
-until the successfully connect to the primary. In the case of a
+Clients discover the primary by re-trying connection to all addresses in the client URL
+until they successfully connect to the primary. In the case of a
virtual IP they re-try the same address until it is relocated to the
primary. In the case of a list of IPs the client tries each in
turn. Clients do multiple retries over a configured period of time
@@ -168,12 +159,6 @@ is a separate broker URL for brokers sin
over a different network. The broker URL has to be a list of real
addresses rather than a virtual address.
-Brokers have the following states:
-- connecting: Backup broker trying to connect to primary - loops retrying broker URL.
-- catchup: Backup connected to primary, catching up on pre-existing configuration & messages.
-- ready: Backup fully caught-up, ready to take over as primary.
-- primary: Acting as primary, serving clients.
-
** Interaction with rgmanager
rgmanager interacts with qpid via 2 service scripts: backup &
@@ -190,8 +175,8 @@ the primary state. Backups discover the
*** Failover
-primary broker or node fails. Backup brokers see disconnect and go
-back to connecting mode.
+primary broker or node fails. Backup brokers see the disconnect and
+start trying to re-connect to the new primary.
rgmanager notices the failure and starts the primary service on a new node.
This tells qpidd to go to primary mode. Backups re-connect and catch up.
@@ -225,71 +210,30 @@ to become a ready backup.
** Interaction with the store.
-Clean shutdown: entire cluster is shut down cleanly by an admin tool:
-- primary stops accepting client connections till shutdown is complete.
-- backups come fully up to speed with primary state.
-- all shut down marking stores as 'clean' with an identifying UUID.
-
-After clean shutdown the cluster can re-start automatically as all nodes
-have equivalent stores. Stores starting up with the wrong UUID will fail.
-
-Stored status: clean(UUID)/dirty, primary/backup, generation number.
-- All stores are marked dirty except after a clean shutdown.
-- Generation number: passed to backups and incremented by new primary.
-
-After total crash must manually identify the "best" store, provide admin tool.
-Best = highest generation number among stores in primary state.
-
-Recovering from total crash: all brokers will refuse to start as all stores are dirty.
-Check the stores manually to find the best one, then either:
-1. Copy stores:
- - copy good store to all hosts
- - restart qpidd on all hosts.
-2. Erase stores:
- - Erase the store on all other hosts.
- - Restart qpidd on the good store and wait for it to become primary.
- - Restart qpidd on all other hosts.
-
-Broker startup with store:
-- Dirty: refuse to start
-- Clean:
- - Start and load from store.
- - When connecting as backup, check UUID matches primary, shut down if not.
-- Empty: start ok, no UUID check with primary.
+Needs more detail:
+
+We want backup brokers to be able to user their stored messages on restart
+so they don't have to download everything from priamary.
+This requires a HA sequence number to be stored with the message
+so the backup can identify which messages are in common with the primary.
+
+This will work very similarly to the way live backups can use in-memory
+messages to reduce the download.
+
+Need to determine which broker is chosen as initial primary based on currency of
+stores. Probably using stored generation numbers and status flags. Ideally
+automated with rgmanager, or some intervention might be reqiured.
* Current Limitations
(In no particular order at present)
-For message replication:
-
-LM1a - On failover, backups delete their queues and download the full queue state from the
-primary. There was code to use messags already on the backup for re-synchronisation, it
-was removed in early development (r1214490) to simplify the logic while getting basic
-replication working. It needs to be re-introduced.
-
-LM1b - This re-synchronisation does not handle the case where a newly elected primary is *behind*
-one of the other backups. To address this I propose a new event for restting the sequence
-that the new primary would send out on detecting that a replicating browser is ahead of
-it, requesting that the replica revert back to a particular sequence number. The replica
-on receiving this event would then discard (i.e. dequeue) all the messages ahead of that
-sequence number and reset the counter to correctly sequence any subsequently delivered
-messages.
-
-LM2 - There is a need to handle wrap-around of the message sequence to avoid
-confusing the resynchronisation where a replica has been disconnected
-for a long time, sufficient for the sequence numbering to wrap around.
+For message replication (missing items have been fixed)
LM3 - Transactional changes to queue state are not replicated atomically.
-LM4 - Acknowledgements are confirmed to clients before the message has been
-dequeued from replicas or indeed from the local store if that is
-asynchronous.
-
-LM5 - During failover, messages (re)published to a queue before there are
-the requisite number of replication subscriptions established will be
-confirmed to the publisher before they are replicated, leaving them
-vulnerable to a loss of the new primary before they are replicated.
+LM4 - (No worse than store) Acknowledgements are confirmed to clients before the message
+has been dequeued from replicas or indeed from the local store if that is asynchronous.
LM6 - persistence: In the event of a total cluster failure there are
no tools to automatically identify the "latest" store.
@@ -323,21 +267,11 @@ case (b) can be addressed in a simple ma
(c) would require changes to the broker to allow client to simply
determine when the command has fully propagated.
-LC3 - Queues that are not in the query response received when a
-replica establishes a propagation subscription but exist locally are
-not deleted. I.e. Deletion of queues/exchanges while a replica is not
-connected will not be propagated. Solution is to delete any queues
-marked for propagation that exist locally but do not show up in the
-query response.
-
LC4 - It is possible on failover that the new primary did not
previously receive a given QMF event while a backup did (sort of an
analogous situation to LM1 but without an easy way to detect or remedy
it).
-LC5 - Need richer control over which queues/exchanges are propagated, and
-which are not.
-
LC6 - The events and query responses are not fully synchronized.
In particular it *is* possible to not receive a delete event but
@@ -356,12 +290,11 @@ LC6 - The events and query responses are
LC7 Federated links from the primary will be lost in failover, they will not be re-connected on
the new primary. Federation links to the primary can fail over.
-LC8 Only plain FIFO queues can be replicated. LVQs and ring queues are not yet supported.
-
LC9 The "last man standing" feature of the old cluster is not available.
* Benefits compared to previous cluster implementation.
+- Allows per queue/exchange control over what is replicated.
- Does not depend on openais/corosync, does not require multicast.
- Can be integrated with different resource managers: for example rgmanager, PaceMaker, Veritas.
- Can be ported to/implemented in other environments: e.g. Java, Windows
Propchange: qpid/branches/asyncstore/cpp/docs/api/
------------------------------------------------------------------------------
Merged /qpid/trunk/qpid/cpp/docs/api:r1375509-1450773
Modified: qpid/branches/asyncstore/cpp/docs/api/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/docs/api/CMakeLists.txt?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/docs/api/CMakeLists.txt (original)
+++ qpid/branches/asyncstore/cpp/docs/api/CMakeLists.txt Thu Feb 28 16:14:30 2013
@@ -30,11 +30,13 @@ if (GEN_DOXYGEN)
${CMAKE_CURRENT_BINARY_DIR}/developer.doxygen)
add_custom_target (docs-user-api COMMAND ${DOXYGEN_EXECUTABLE} user.doxygen)
add_custom_target (docs-developer COMMAND ${DOXYGEN_EXECUTABLE} developer.doxygen)
+ add_dependencies (docs docs-developer docs-user-api)
# HTML files are generated to ./html - put those in the install.
install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
- DESTINATION ${QPID_INSTALL_HTMLDIR}
- COMPONENT ${QPID_COMPONENT_CLIENT_INCLUDE})
+ DESTINATION ${QPID_INSTALL_DOCDIR}/api/html
+ COMPONENT ${QPID_COMPONENT_CLIENT_INCLUDE}
+ ${OPTIONAL_ARG})
if (CPACK_GENERATOR STREQUAL "NSIS")
set (CPACK_NSIS_MENU_LINKS
"${QPID_INSTALL_HTMLDIR}/index.html" "Qpid C++ API Documentation"
Modified: qpid/branches/asyncstore/cpp/etc/qpidd-primary.in
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/etc/qpidd-primary.in?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/etc/qpidd-primary.in (original)
+++ qpid/branches/asyncstore/cpp/etc/qpidd-primary.in Thu Feb 28 16:14:30 2013
@@ -57,7 +57,7 @@ if [[ !(-x $QPID_HA) ]]; then
fi
status() {
- if $QPID_HA -b localhost:$QPID_PORT status --expect=primary ; then
+ if $QPID_HA -b localhost:$QPID_PORT status --is-primary ; then
echo "qpidd is primary"
else
echo "qpidd is not primary"
Modified: qpid/branches/asyncstore/cpp/etc/sasl2/qpidd.conf
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/etc/sasl2/qpidd.conf?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/etc/sasl2/qpidd.conf (original)
+++ qpid/branches/asyncstore/cpp/etc/sasl2/qpidd.conf Thu Feb 28 16:14:30 2013
@@ -18,33 +18,31 @@
#
#
#---------------------------------
-# Mechanisms and Users
+# SASL Mechanisms and Users
#---------------------------------
#
-# This default qpidd configuration allows for only SASL ANONYMOUS authentication.
-# To additionally enable DIGEST-MD5 authentication:
-#
-# 1. edit the mech_list below to read
-# mech_list: DIGEST-MD5 ANONYMOUS
-#
-# 2. To add new a new user+password to the sasldb file:
-# echo $PASSWD | saslpasswd2 -c -p -f $SASLTEST_DB -u QPID $USERNAME
-#
+# This default mech list allows for PLAIN, but that
+# mechanism sends credentials in the clear, and is normally
+# only used along with SSL transport-layer security.
+#
+# This default also permits DIGEST-MD5, but you must have
+# a user and password defined in your sasldb file to use
+# this mechanism. ( See notes below. )
#
# PLEASE NOTE
# For production messaging systems, a high-security mechanism such as
-# DIGEST-MD5 or PLAIN+SSL should be enabled.
+# DIGEST-MD5 or PLAIN+SSL should be used.
#
#
pwcheck_method: auxprop
auxprop_plugin: sasldb
sasldb_path: /var/lib/qpidd/qpidd.sasldb
-mech_list: ANONYMOUS
+mech_list: ANONYMOUS DIGEST-MD5 EXTERNAL PLAIN
#---------------------------------
-# Other Notes
+# Please Note
#---------------------------------
#
# 1. If you use a nonstandard location for your sasl_config directory,
@@ -60,15 +58,19 @@ mech_list: ANONYMOUS
# /var/lib/qpidd/qpidd.sasldb
#
# 3. You can see what usernames have been stored in the sasldb, with the
-# sasldblistusers2 command.
+# command "sasldblistusers2 -f /var/lib/qpidd/qpidd.sasldb"
#
# 4. The REALM is important and should be the same as the --realm
# option to the broker. This lets the broker properly find the user in
# the sasldb file.
#
# 5. The sasldb file must be readable by the user running the qpidd
-# daemon, and should be readable only by that user.
+# daemon, ( the user name is qpidd ) and should be readable only
+# by that user.
#
+# 6. The EXTERNAL mechanism allows you to use SSL transport layer
+# security. In that case, you can also set the broker option
+# --ssl-require-client-authentication .
Modified: qpid/branches/asyncstore/cpp/examples/makedist.mk
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/makedist.mk?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/makedist.mk (original)
+++ qpid/branches/asyncstore/cpp/examples/makedist.mk Thu Feb 28 16:14:30 2013
@@ -20,6 +20,7 @@
AM_CXXFLAGS = $(WARNING_CFLAGS)
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include
CLIENT_LIB=$(top_builddir)/src/libqpidclient.la
+COMMON_LIB=$(top_builddir)/src/libqpidcommon.la
CONSOLE_LIB=$(top_builddir)/src/libqmfconsole.la
CLIENTFLAGS=-lqpidclient
CONSOLEFLAGS=-lqmfconsole
Modified: qpid/branches/asyncstore/cpp/examples/messaging/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/messaging/CMakeLists.txt?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/messaging/CMakeLists.txt (original)
+++ qpid/branches/asyncstore/cpp/examples/messaging/CMakeLists.txt Thu Feb 28 16:14:30 2013
@@ -26,9 +26,13 @@ macro(add_messaging_example example)
target_link_libraries(${example} qpidmessaging ${_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 ${CMAKE_CURRENT_SOURCE_DIR}/${example}.cpp ${CMAKE_CURRENT_SOURCE_DIR}/OptionParser.h ${CMAKE_CURRENT_SOURCE_DIR}/OptionParser.cpp
- DESTINATION ${QPID_INSTALL_EXAMPLESDIR}/messaging
- COMPONENT ${QPID_COMPONENT_EXAMPLES})
+ install (FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/${example}.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/OptionParser.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/OptionParser.cpp
+ DESTINATION ${QPID_INSTALL_EXAMPLESDIR}/messaging
+ COMPONENT ${QPID_COMPONENT_EXAMPLES})
+
if (MSVC)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/messaging_${example}.vcproj
DESTINATION ${QPID_INSTALL_EXAMPLESDIR}/messaging
@@ -57,7 +61,19 @@ install (FILES ${CMAKE_CURRENT_SOURCE_DI
add_executable(hello_xml hello_xml.cpp)
set_target_properties(hello_xml PROPERTIES OUTPUT_NAME hello_xml)
target_link_libraries(hello_xml qpidmessaging)
-install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/hello_xml.cpp
+
+install (FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/extra_dist/CMakeLists.txt
+ ${CMAKE_CURRENT_SOURCE_DIR}/OptionParser.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/OptionParser.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/hello_world.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/hello_xml.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/drain.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/spout.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/map_receiver.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/map_sender.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/client.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/server.cpp
DESTINATION ${QPID_INSTALL_EXAMPLESDIR}/messaging
COMPONENT ${QPID_COMPONENT_EXAMPLES})
Modified: qpid/branches/asyncstore/cpp/examples/messaging/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/messaging/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/messaging/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/examples/messaging/Makefile.am Thu Feb 28 16:14:30 2013
@@ -22,6 +22,7 @@ examplesdir=$(pkgdatadir)/examples/messa
AM_CXXFLAGS = $(WARNING_CFLAGS)
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include
CLIENT_LIB=$(top_builddir)/src/libqpidmessaging.la
+TYPES_LIB=$(top_builddir)/src/libqpidtypes.la
CLIENTFLAGS=-lqpidmessaging
noinst_PROGRAMS=drain spout client server map_sender map_receiver hello_world hello_xml
@@ -33,10 +34,10 @@ hello_xml_SOURCES=hello_xml.cpp
hello_xml_LDADD=$(CLIENT_LIB)
drain_SOURCES=drain.cpp OptionParser.h OptionParser.cpp
-drain_LDADD=$(CLIENT_LIB)
+drain_LDADD=$(CLIENT_LIB) $(TYPES_LIB)
spout_SOURCES=spout.cpp OptionParser.h OptionParser.cpp
-spout_LDADD=$(CLIENT_LIB)
+spout_LDADD=$(CLIENT_LIB) $(TYPES_LIB)
client_SOURCES=client.cpp
client_LDADD=$(CLIENT_LIB)
@@ -45,10 +46,10 @@ server_SOURCES=server.cpp
server_LDADD=$(CLIENT_LIB)
map_sender_SOURCES=map_sender.cpp
-map_sender_LDADD=$(CLIENT_LIB)
+map_sender_LDADD=$(CLIENT_LIB) $(TYPES_LIB)
map_receiver_SOURCES=map_receiver.cpp
-map_receiver_LDADD=$(CLIENT_LIB)
+map_receiver_LDADD=$(CLIENT_LIB) $(TYPES_LIB)
examples_DATA= \
hello_world.cpp \
@@ -61,7 +62,7 @@ examples_DATA= \
server.cpp \
map_sender.cpp \
map_receiver.cpp \
- extra_dist/Makefile
+ extra_dist/CMakeLists.txt
EXTRA_DIST= \
$(examples_DATA) \
Modified: qpid/branches/asyncstore/cpp/examples/messaging/spout.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/messaging/spout.cpp?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/messaging/spout.cpp (original)
+++ qpid/branches/asyncstore/cpp/examples/messaging/spout.cpp Thu Feb 28 16:14:30 2013
@@ -91,6 +91,7 @@ struct Options : OptionParser
std::string value;
if (nameval(property, name, value)) {
message.getProperties()[name] = value;
+ message.getProperties()[name].setEncoding("utf8");
} else {
message.getProperties()[name] = Variant();
}
Modified: qpid/branches/asyncstore/cpp/examples/old_api/direct/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/old_api/direct/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/old_api/direct/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/examples/old_api/direct/Makefile.am Thu Feb 28 16:14:30 2013
@@ -23,13 +23,13 @@ include $(top_srcdir)/examples/makedist.
noinst_PROGRAMS=direct_producer listener declare_queues
direct_producer_SOURCES=direct_producer.cpp
-direct_producer_LDADD=$(CLIENT_LIB)
+direct_producer_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
listener_SOURCES=listener.cpp
-listener_LDADD=$(CLIENT_LIB)
+listener_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
declare_queues_SOURCES=declare_queues.cpp
-declare_queues_LDADD=$(CLIENT_LIB)
+declare_queues_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
examples_DATA= \
direct_producer.cpp \
Modified: qpid/branches/asyncstore/cpp/examples/old_api/failover/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/old_api/failover/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/old_api/failover/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/examples/old_api/failover/Makefile.am Thu Feb 28 16:14:30 2013
@@ -24,13 +24,13 @@ include $(top_srcdir)/examples/makedist.
noinst_PROGRAMS=declare_queues resuming_receiver replaying_sender
declare_queues_SOURCES=declare_queues.cpp
-declare_queues_LDADD=$(CLIENT_LIB)
+declare_queues_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
resuming_receiver_SOURCES=resuming_receiver.cpp
-resuming_receiver_LDADD=$(CLIENT_LIB)
+resuming_receiver_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
replaying_sender_SOURCES=replaying_sender.cpp
-replaying_sender_LDADD=$(CLIENT_LIB)
+replaying_sender_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
examples_DATA= \
declare_queues.cpp \
Modified: qpid/branches/asyncstore/cpp/examples/old_api/fanout/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/old_api/fanout/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/old_api/fanout/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/examples/old_api/fanout/Makefile.am Thu Feb 28 16:14:30 2013
@@ -26,7 +26,7 @@ fanout_producer_SOURCES=fanout_producer.
fanout_producer_LDADD=$(CLIENT_LIB)
listener_SOURCES=listener.cpp
-listener_LDADD=$(CLIENT_LIB)
+listener_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
examples_DATA= \
fanout_producer.cpp \
Modified: qpid/branches/asyncstore/cpp/examples/old_api/pub-sub/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/old_api/pub-sub/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/old_api/pub-sub/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/examples/old_api/pub-sub/Makefile.am Thu Feb 28 16:14:30 2013
@@ -24,10 +24,10 @@ include $(top_srcdir)/examples/makedist.
noinst_PROGRAMS=topic_listener topic_publisher
topic_listener_SOURCES=topic_listener.cpp
-topic_listener_LDADD=$(CLIENT_LIB)
+topic_listener_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
topic_publisher_SOURCES=topic_publisher.cpp
-topic_publisher_LDADD=$(CLIENT_LIB)
+topic_publisher_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
examples_DATA= \
topic_listener.cpp \
Modified: qpid/branches/asyncstore/cpp/examples/old_api/request-response/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/old_api/request-response/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/old_api/request-response/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/examples/old_api/request-response/Makefile.am Thu Feb 28 16:14:30 2013
@@ -24,10 +24,10 @@ include $(top_srcdir)/examples/makedist.
noinst_PROGRAMS=client server
client_SOURCES=client.cpp
-client_LDADD=$(CLIENT_LIB)
+client_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
server_SOURCES=server.cpp
-server_LDADD=$(CLIENT_LIB)
+server_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
examples_DATA= \
server.cpp \
Modified: qpid/branches/asyncstore/cpp/examples/old_api/tradedemo/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/old_api/tradedemo/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/old_api/tradedemo/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/examples/old_api/tradedemo/Makefile.am Thu Feb 28 16:14:30 2013
@@ -24,13 +24,13 @@ include $(top_srcdir)/examples/makedist.
noinst_PROGRAMS=topic_listener topic_publisher declare_queues
topic_listener_SOURCES=topic_listener.cpp
-topic_listener_LDADD=$(CLIENT_LIB)
+topic_listener_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
topic_publisher_SOURCES=topic_publisher.cpp
-topic_publisher_LDADD=$(CLIENT_LIB)
+topic_publisher_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
declare_queues_SOURCES=declare_queues.cpp
-declare_queues_LDADD=$(CLIENT_LIB)
+declare_queues_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
examples_DATA= \
Modified: qpid/branches/asyncstore/cpp/examples/old_api/xml-exchange/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/old_api/xml-exchange/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/old_api/xml-exchange/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/examples/old_api/xml-exchange/Makefile.am Thu Feb 28 16:14:30 2013
@@ -24,13 +24,13 @@ include $(top_srcdir)/examples/makedist.
noinst_PROGRAMS=declare_queues xml_producer listener
declare_queues_SOURCES=declare_queues.cpp
-declare_queues_LDADD=$(CLIENT_LIB)
+declare_queues_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
xml_producer_SOURCES=xml_producer.cpp
-xml_producer_LDADD=$(CLIENT_LIB)
+xml_producer_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
listener_SOURCES=listener.cpp
-listener_LDADD=$(CLIENT_LIB)
+listener_LDADD=$(CLIENT_LIB) $(COMMON_LIB)
EXTRA_DIST= \
README.txt \
Modified: qpid/branches/asyncstore/cpp/examples/qmf-console/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/examples/qmf-console/Makefile.am?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/examples/qmf-console/Makefile.am (original)
+++ qpid/branches/asyncstore/cpp/examples/qmf-console/Makefile.am Thu Feb 28 16:14:30 2013
@@ -25,19 +25,19 @@ include $(top_srcdir)/examples/makedist.
noinst_PROGRAMS=console printevents ping queuestats cluster-qmon
console_SOURCES=console.cpp
-console_LDADD=$(CONSOLE_LIB)
+console_LDADD=$(CONSOLE_LIB) -lqpidcommon -lqpidclient
printevents_SOURCES=printevents.cpp
-printevents_LDADD=$(CONSOLE_LIB)
+printevents_LDADD=$(CONSOLE_LIB) -lqpidcommon -lqpidclient
ping_SOURCES=ping.cpp
-ping_LDADD=$(CONSOLE_LIB)
+ping_LDADD=$(CONSOLE_LIB) -lqpidcommon -lqpidclient
queuestats_SOURCES=queuestats.cpp
-queuestats_LDADD=$(CONSOLE_LIB)
+queuestats_LDADD=$(CONSOLE_LIB) -lqpidcommon -lqpidclient
cluster_qmon_SOURCES=cluster-qmon.cpp
-cluster_qmon_LDADD=$(CONSOLE_LIB)
+cluster_qmon_LDADD=$(CONSOLE_LIB) -lqpidcommon -lqpidclient
examples_DATA= \
console.cpp \
Modified: qpid/branches/asyncstore/cpp/include/qpid/Options.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/Options.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/Options.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/Options.h Thu Feb 28 16:14:30 2013
@@ -149,6 +149,11 @@ struct Options : public po::options_desc
const std::string& configfile=std::string(),
bool allowUnknown = false);
+ /**
+ * Tests for presence of argc/argv switch
+ */
+ QPID_COMMON_EXTERN bool findArg(int argc, char const* const* argv,
+ const std::string& theArg);
boost::program_options::options_description_easy_init addOptions() {
return add_options();
Modified: qpid/branches/asyncstore/cpp/include/qpid/Url.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/Url.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/Url.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/Url.h Thu Feb 28 16:14:30 2013
@@ -32,13 +32,6 @@ namespace qpid {
/** An AMQP URL contains a list of addresses */
struct Url : public std::vector<Address> {
- /** Url with the hostname as returned by gethostname(2) */
- QPID_COMMON_EXTERN static Url getHostNameUrl(uint16_t port);
-
- /** Url with local IP address(es), may be more than one address
- * on a multi-homed host. */
- QPID_COMMON_EXTERN static Url getIpAddressesUrl(uint16_t port);
-
struct Invalid : public Exception { QPID_COMMON_EXTERN Invalid(const std::string& s); };
/** Convert to string form. */
Modified: qpid/branches/asyncstore/cpp/include/qpid/client/ConnectionSettings.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/client/ConnectionSettings.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/client/ConnectionSettings.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/client/ConnectionSettings.h Thu Feb 28 16:14:30 2013
@@ -23,6 +23,7 @@
*/
#include "qpid/client/ClientImportExport.h"
+#include "qpid/framing/FieldTable.h"
#include "qpid/sys/IntegerTypes.h"
#include <string>
@@ -127,6 +128,11 @@ struct QPID_CLIENT_CLASS_EXTERN Connecti
* settings. Used only when a client connects to the broker.
*/
std::string sslCertName;
+
+ /**
+ * Passed as client-propreties on opening the connecction.
+ */
+ framing::FieldTable clientProperties;
};
}} // namespace qpid::client
Modified: qpid/branches/asyncstore/cpp/include/qpid/client/FailoverManager.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/client/FailoverManager.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/client/FailoverManager.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/client/FailoverManager.h Thu Feb 28 16:14:30 2013
@@ -87,6 +87,7 @@ class QPID_CLIENT_CLASS_EXTERN FailoverM
* attempted
*/
QPID_CLIENT_EXTERN FailoverManager(const ConnectionSettings& settings, ReconnectionStrategy* strategy = 0);
+ QPID_CLIENT_EXTERN ~FailoverManager();
/**
* Return the current connection if open or attept to reconnect to
* the specified list of urls. If no list is specified the list of
Modified: qpid/branches/asyncstore/cpp/include/qpid/framing/FieldValue.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/framing/FieldValue.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/framing/FieldValue.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/framing/FieldValue.h Thu Feb 28 16:14:30 2013
@@ -175,11 +175,19 @@ class FixedWidthValue : public FieldValu
return v;
}
uint8_t* rawOctets() { return octets; }
- uint8_t* rawOctets() const { return octets; }
+ const uint8_t* rawOctets() const { return octets; }
void print(std::ostream& o) const { o << "F" << width << ":"; };
};
+class UuidData : public FixedWidthValue<16> {
+ public:
+ UuidData();
+ UuidData(const unsigned char* bytes);
+ bool convertsToString() const;
+ std::string getString() const;
+};
+
template <class T, int W>
inline T FieldValue::getIntegerValue() const
{
@@ -356,7 +364,7 @@ class Var16Value : public FieldValue {
class Var32Value : public FieldValue {
public:
QPID_COMMON_EXTERN Var32Value(const std::string& v, uint8_t code);
-};
+ };
class Struct32Value : public FieldValue {
public:
@@ -453,6 +461,7 @@ class ListValue : public FieldValue {
class UuidValue : public FieldValue {
public:
+ QPID_COMMON_EXTERN UuidValue();
QPID_COMMON_EXTERN UuidValue(const unsigned char*);
};
Modified: qpid/branches/asyncstore/cpp/include/qpid/framing/ProtocolVersion.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/framing/ProtocolVersion.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/framing/ProtocolVersion.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/framing/ProtocolVersion.h Thu Feb 28 16:14:30 2013
@@ -36,21 +36,28 @@ class QPID_COMMON_CLASS_EXTERN ProtocolV
private:
uint8_t major_;
uint8_t minor_;
+ uint8_t protocol_;
public:
- explicit ProtocolVersion(uint8_t _major=0, uint8_t _minor=0)
- : major_(_major), minor_(_minor) {}
+ explicit ProtocolVersion(uint8_t _major=0, uint8_t _minor=0, uint8_t _protocol=0)
+ : major_(_major), minor_(_minor), protocol_(_protocol) {}
QPID_COMMON_INLINE_EXTERN uint8_t getMajor() const { return major_; }
QPID_COMMON_INLINE_EXTERN void setMajor(uint8_t major) { major_ = major; }
QPID_COMMON_INLINE_EXTERN uint8_t getMinor() const { return minor_; }
QPID_COMMON_INLINE_EXTERN void setMinor(uint8_t minor) { minor_ = minor; }
+ QPID_COMMON_INLINE_EXTERN uint8_t getProtocol() const { return protocol_; }
+ QPID_COMMON_INLINE_EXTERN void setProtocol(uint8_t protocol) { protocol_ = protocol; }
QPID_COMMON_EXTERN const std::string toString() const;
QPID_COMMON_EXTERN ProtocolVersion& operator=(ProtocolVersion p);
QPID_COMMON_EXTERN bool operator==(ProtocolVersion p) const;
QPID_COMMON_INLINE_EXTERN bool operator!=(ProtocolVersion p) const { return ! (*this == p); }
+ QPID_COMMON_EXTERN static uint8_t AMQP;
+ QPID_COMMON_EXTERN static uint8_t LEGACY_AMQP;
+ QPID_COMMON_EXTERN static uint8_t TLS;
+ QPID_COMMON_EXTERN static uint8_t SASL;
};
} // namespace framing
Modified: qpid/branches/asyncstore/cpp/include/qpid/log/Logger.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/log/Logger.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/log/Logger.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/log/Logger.h Thu Feb 28 16:14:30 2013
@@ -95,6 +95,11 @@ class QPID_COMMON_CLASS_EXTERN Logger :
/** Get the options used to configure the logger. */
QPID_COMMON_INLINE_EXTERN const Options& getOptions() const { return options; }
+ /** Get the hires timestamp setting */
+ QPID_COMMON_EXTERN bool getHiresTimestamp();
+
+ /** Set the hires timestamp setting */
+ QPID_COMMON_EXTERN void setHiresTimestamp(bool setting);
private:
typedef boost::ptr_vector<Output> Outputs;
Modified: qpid/branches/asyncstore/cpp/include/qpid/management/Manageable.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/management/Manageable.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/management/Manageable.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/management/Manageable.h Thu Feb 28 16:14:30 2013
@@ -55,7 +55,11 @@ class QPID_COMMON_EXTERN Manageable
//
// This accessor function returns a pointer to the management object.
//
- virtual ManagementObject* GetManagementObject(void) const = 0;
+#ifdef _IN_QPID_BROKER
+ virtual ManagementObject::shared_ptr GetManagementObject() const = 0;
+#else
+ virtual ManagementObject* GetManagementObject() const = 0;
+#endif
// Every "Manageable" object must implement ManagementMethod. This
// function is called when a remote management client invokes a method
Modified: qpid/branches/asyncstore/cpp/include/qpid/management/ManagementObject.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/management/ManagementObject.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/management/ManagementObject.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/management/ManagementObject.h Thu Feb 28 16:14:30 2013
@@ -25,10 +25,13 @@
#include "qpid/management/Mutex.h"
#include "qpid/types/Variant.h"
-
#include <map>
#include <vector>
+#ifdef _IN_QPID_BROKER
+#include <boost/shared_ptr.hpp>
+#endif
+
namespace qpid {
namespace management {
@@ -155,6 +158,10 @@ protected:
QPID_COMMON_EXTERN uint32_t writeTimestampsSize() const;
public:
+#ifdef _IN_QPID_BROKER
+ typedef boost::shared_ptr<ManagementObject> shared_ptr;
+#endif
+
QPID_COMMON_EXTERN static const uint8_t MD5_LEN = 16;
QPID_COMMON_EXTERN static int maxThreads;
//typedef void (*writeSchemaCall_t) (qpid::framing::Buffer&);
@@ -227,8 +234,10 @@ protected:
//QPID_COMMON_EXTERN void mapDecode(const types::Variant::Map& map);
};
-typedef std::map<ObjectId, ManagementObject*> ManagementObjectMap;
-typedef std::vector<ManagementObject*> ManagementObjectVector;
+#ifdef _IN_QPID_BROKER
+typedef std::map<ObjectId, ManagementObject::shared_ptr> ManagementObjectMap;
+typedef std::vector<ManagementObject::shared_ptr> ManagementObjectVector;
+#endif
}}
Modified: qpid/branches/asyncstore/cpp/include/qpid/messaging/Message.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/messaging/Message.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/messaging/Message.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/messaging/Message.h Thu Feb 28 16:14:30 2013
@@ -34,7 +34,7 @@ namespace messaging {
class Address;
class Codec;
-struct MessageImpl;
+class MessageImpl;
/** \ingroup messaging
* Representation of a message.
Modified: qpid/branches/asyncstore/cpp/include/qpid/sys/IOHandle.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/sys/IOHandle.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/sys/IOHandle.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/sys/IOHandle.h Thu Feb 28 16:14:30 2013
@@ -22,8 +22,6 @@
*
*/
-#include "qpid/CommonImportExport.h"
-
namespace qpid {
namespace sys {
@@ -31,18 +29,7 @@ namespace sys {
* This is a class intended to abstract the Unix concept of file descriptor
* or the Windows concept of HANDLE
*/
-class PollerHandle;
-class IOHandlePrivate;
-class IOHandle {
- friend class PollerHandle;
- friend class IOHandlePrivate;
-
-protected:
- IOHandlePrivate* const impl;
-
- IOHandle(IOHandlePrivate*);
- QPID_COMMON_EXTERN virtual ~IOHandle();
-};
+class IOHandle;
}}
Modified: qpid/branches/asyncstore/cpp/include/qpid/sys/SystemInfo.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/sys/SystemInfo.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/sys/SystemInfo.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/sys/SystemInfo.h Thu Feb 28 16:14:30 2013
@@ -47,16 +47,23 @@ QPID_COMMON_EXTERN long concurrency();
QPID_COMMON_EXTERN bool getLocalHostname (Address &address);
/**
- * Get the (possibly multiple) local IP addresses of this host
- * using the specified port.
+ * Get the names of all the network interfaces connected to
+ * this host.
+ * @param names Receives the list of interface names
*/
-QPID_COMMON_EXTERN void getLocalIpAddresses (uint16_t port, std::vector<Address> &addrList);
+QPID_COMMON_EXTERN void getInterfaceNames(std::vector<std::string>& names );
/**
- * Return true if host names an address of the local host.
- *@param host host name or IP address.
+ * Get strings for each of the IP addresses associated with a named network
+ * interface.
+ * If there is no interface of that name an empty list will be returned.
+ *
+ * @param interface The name of the network interface
+ * @param addresses The list of the strings for the IP addresses are pushed on the back of this parameter
+ * to get just the list you need to clear the vector before using it.
+ * @return true if an interface of the correct name was found, false otherwise
*/
-QPID_COMMON_EXTERN bool isLocalHost(const std::string& host);
+QPID_COMMON_EXTERN bool getInterfaceAddresses(const std::string& interface, std::vector<std::string>& addresses);
/**
* Retrieve system identifiers and versions. This is information that can
@@ -90,6 +97,12 @@ QPID_COMMON_EXTERN uint32_t getParentPro
*/
QPID_COMMON_EXTERN std::string getProcessName();
+/**
+ * Can thread related primitives be trusted during runtime house-cleaning?
+ * (i.e. static destructors, atexit()).
+ */
+QPID_COMMON_EXTERN bool threadSafeShutdown();
+
}}} // namespace qpid::sys::SystemInfo
Modified: qpid/branches/asyncstore/cpp/include/qpid/sys/posix/PrivatePosix.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/sys/posix/PrivatePosix.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/sys/posix/PrivatePosix.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/sys/posix/PrivatePosix.h Thu Feb 28 16:14:30 2013
@@ -23,7 +23,6 @@
*/
#include "qpid/sys/Time.h"
-#include "qpid/sys/IOHandle.h"
struct timespec;
struct timeval;
@@ -41,32 +40,21 @@ Duration toTime(const struct timespec& t
class SocketAddress;
const struct addrinfo& getAddrInfo(const SocketAddress&);
-// Private fd related implementation details
-class IOHandlePrivate {
+// Posix fd as an IOHandle
+class IOHandle {
public:
- IOHandlePrivate(int f = -1) :
- fd(f)
+ IOHandle(int fd0 = -1) :
+ fd(fd0)
{}
int fd;
};
-int toFd(const IOHandlePrivate* h);
-
-// Posix fd as an IOHandle
-class PosixIOHandle : public IOHandle {
-public:
- PosixIOHandle(int fd) :
- IOHandle(new IOHandlePrivate(fd))
- {}
-};
-
// Dummy IOHandle for places it's required in the API
// but we promise not to actually try to do any operations on the IOHandle
class NullIOHandle : public IOHandle {
public:
- NullIOHandle() :
- IOHandle(new IOHandlePrivate)
+ NullIOHandle()
{}
};
Modified: qpid/branches/asyncstore/cpp/include/qpid/types/Variant.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/include/qpid/types/Variant.h?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/include/qpid/types/Variant.h (original)
+++ qpid/branches/asyncstore/cpp/include/qpid/types/Variant.h Thu Feb 28 16:14:30 2013
@@ -177,6 +177,7 @@ QPID_TYPES_EXTERN std::ostream& operator
QPID_TYPES_EXTERN std::ostream& operator<<(std::ostream& out, const Variant::Map& map);
QPID_TYPES_EXTERN std::ostream& operator<<(std::ostream& out, const Variant::List& list);
QPID_TYPES_EXTERN bool operator==(const Variant& a, const Variant& b);
+QPID_TYPES_EXTERN bool operator!=(const Variant& a, const Variant& b);
#endif
}} // namespace qpid::types
Modified: qpid/branches/asyncstore/cpp/managementgen/qmf-gen
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/managementgen/qmf-gen?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/managementgen/qmf-gen (original)
+++ qpid/branches/asyncstore/cpp/managementgen/qmf-gen Thu Feb 28 16:14:30 2013
@@ -68,9 +68,11 @@ vargs = {}
if opts.brokerplugin:
vargs["agentHeaderDir"] = "management"
vargs["genQmfV1"] = True
+ vargs["genForBroker"] = True
else:
vargs["agentHeaderDir"] = "agent"
vargs["genQmfV1"] = None
+ vargs["genForBroker"] = None
if opts.qpidlogs:
vargs["genLogs"] = True
Modified: qpid/branches/asyncstore/cpp/managementgen/qmfgen/generate.py
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/managementgen/qmfgen/generate.py?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/managementgen/qmfgen/generate.py (original)
+++ qpid/branches/asyncstore/cpp/managementgen/qmfgen/generate.py Thu Feb 28 16:14:30 2013
@@ -307,11 +307,22 @@ class Generator:
def testGenLogs (self, variables):
return variables["genLogs"]
+ def testInBroker (self, variables):
+ return variables['genForBroker']
+
def genDisclaimer (self, stream, variables):
prefix = variables["commentPrefix"]
stream.write (prefix + " This source file was created by a code generator.\n")
stream.write (prefix + " Please do not edit.")
+ def genExternClass (self, stream, variables):
+ if variables['genForBroker']:
+ stream.write("QPID_BROKER_CLASS_EXTERN")
+
+ def genExternMethod (self, stream, variables):
+ if variables['genForBroker']:
+ stream.write("QPID_BROKER_EXTERN")
+
def fileExt (self, path):
dot = path.rfind (".")
if dot == -1:
Modified: qpid/branches/asyncstore/cpp/managementgen/qmfgen/schema.py
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/managementgen/qmfgen/schema.py?rev=1451244&r1=1451243&r2=1451244&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/managementgen/qmfgen/schema.py (original)
+++ qpid/branches/asyncstore/cpp/managementgen/qmfgen/schema.py Thu Feb 28 16:14:30 2013
@@ -1476,8 +1476,11 @@ class SchemaClass:
def genMethodIdDeclarations (self, stream, variables):
number = 1
+ ext = ""
+ if variables['genForBroker']:
+ ext = "QPID_BROKER_EXTERN "
for method in self.methods:
- stream.write (" QPID_BROKER_EXTERN static const uint32_t METHOD_" + method.getName().upper() +\
+ stream.write (" " + ext + "static const uint32_t METHOD_" + method.getName().upper() +\
" = %d;\n" % number)
number = number + 1
@@ -1521,7 +1524,7 @@ class SchemaClass:
for config in self.properties:
if config.isParentRef == 1:
stream.write (config.getName () + \
- " = _parent->GetManagementObject ()->getObjectId ();")
+ " = _parent->GetManagementObject()->getObjectId();")
return
def genSchemaMD5 (self, stream, variables):
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org