Author: tross
Date: Wed May 14 21:08:56 2014
New Revision: 1594718
URL: http://svn.apache.org/r1594718
Log:
DISPATCH-54 - Moved message metadata from the delivery annotations to the
message annotations.
Modified:
qpid/dispatch/trunk/doc/book/amqp-mapping.md
qpid/dispatch/trunk/include/qpid/dispatch/amqp.h
qpid/dispatch/trunk/include/qpid/dispatch/message.h
qpid/dispatch/trunk/src/amqp.c
qpid/dispatch/trunk/src/message.c
qpid/dispatch/trunk/src/message_private.h
qpid/dispatch/trunk/src/python_embedded.c
qpid/dispatch/trunk/src/router_node.c
qpid/dispatch/trunk/tests/system_tests_one_router.py
qpid/dispatch/trunk/tests/system_tests_two_routers.py
Modified: qpid/dispatch/trunk/doc/book/amqp-mapping.md
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/doc/book/amqp-mapping.md?rev=1594718&r1=1594717&r2=1594718&view=diff
==============================================================================
--- qpid/dispatch/trunk/doc/book/amqp-mapping.md (original)
+++ qpid/dispatch/trunk/doc/book/amqp-mapping.md Wed May 14 21:08:56 2014
@@ -24,14 +24,15 @@ codepoints, and semantics for routing ov
the details of Dispatch Router's use of AMQP.
-## Delivery Annotations
+## Message Annotations
-The following Delivery Annotation fields are defined by Dispatch Router:
+The following Message Annotation fields are defined by Dispatch Router:
|| *Field* || *Type* || *Description* ||
|| <span style="white-space: nowrap;">x-opt-qd.ingress</span> || string ||
The identity of the ingress router for a message-routed message. The ingress
router is the first router encountered by a transiting message. The router
will, if this field is present, leave it unaltered. If the field is not
present, the router shall insert the field with its own identity. ||
|| <span style="white-space: nowrap;">x-opt-qd.trace</span> || list of
string || The list of routers through which this message-routed message has
transited. If this field is not present, the router shall do nothing. If the
field is present, the router shall append its own identity to the end of the
list. ||
|| x-opt-qd.to || string || To-Override for message-routed messages. If
this field is present, the address in this field shall be used for routing in
lieu of the *to* field in the message properties. A router may append, remove,
or modify this annotation field depending on the policy in place for routing
the message. ||
+ || x-opt-qd.class || string || Message class. This is used to allow the
router to provide separate paths for different classes of traffic. ||
## Source/Target Capabilities
Modified: qpid/dispatch/trunk/include/qpid/dispatch/amqp.h
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/include/qpid/dispatch/amqp.h?rev=1594718&r1=1594717&r2=1594718&view=diff
==============================================================================
--- qpid/dispatch/trunk/include/qpid/dispatch/amqp.h (original)
+++ qpid/dispatch/trunk/include/qpid/dispatch/amqp.h Wed May 14 21:08:56 2014
@@ -86,11 +86,12 @@ enum {
QD_AMQP_ARRAY32 = 0xf0,
} qd_amqp_type_t;
-/** @name Delivery Annotation Headers */
+/** @name Message Annotation Headers */
/// @{
-const char * const QD_DA_INGRESS; ///< Ingress Router
-const char * const QD_DA_TRACE; ///< Trace
-const char * const QD_DA_TO; ///< To-Override
+const char * const QD_MA_INGRESS; ///< Ingress Router
+const char * const QD_MA_TRACE; ///< Trace
+const char * const QD_MA_TO; ///< To-Override
+const char * const QD_MA_CLASS; ///< Message-Class
/// @}
/** @name Link Terminus Capabilities */
Modified: qpid/dispatch/trunk/include/qpid/dispatch/message.h
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/include/qpid/dispatch/message.h?rev=1594718&r1=1594717&r2=1594718&view=diff
==============================================================================
--- qpid/dispatch/trunk/include/qpid/dispatch/message.h (original)
+++ qpid/dispatch/trunk/include/qpid/dispatch/message.h Wed May 14 21:08:56 2014
@@ -122,30 +122,30 @@ void qd_message_free(qd_message_t *msg);
qd_message_t *qd_message_copy(qd_message_t *msg);
/**
- * Retrieve the delivery annotations from a message.
+ * Retrieve the message annotations from a message.
*
* IMPORTANT: The pointer returned by this function remains owned by the
message.
* The caller MUST NOT free the parsed field.
*
* @param msg Pointer to a received message.
- * @return Pointer to the parsed field for the delivery annotations. If the
message doesn't
- * have delivery annotations, the return value shall be NULL.
+ * @return Pointer to the parsed field for the message annotations. If the
message doesn't
+ * have message annotations, the return value shall be NULL.
*/
-qd_parsed_field_t *qd_message_delivery_annotations(qd_message_t *msg);
+qd_parsed_field_t *qd_message_message_annotations(qd_message_t *msg);
/**
- * Set the delivery annotations for the message. If the message already has
delivery annotations,
+ * Set the message annotations for the message. If the message already has
message annotations,
* they will be overwritten/replaced by the new field.
*
* @param msg Pointer to a receiver message.
- * @param da Pointer to a composed field representing the new delivery
annotations of the message.
- * If null, the message will not have a delivery annotations field.
+ * @param da Pointer to a composed field representing the new message
annotations of the message.
+ * If null, the message will not have a message annotations field.
* IMPORTANT: The message will not take ownership of the composed
field. The
* caller is responsible for freeing it after this call.
Since the contents
* are copied into the message, it is safe to free the
composed field
* any time after the call to this function.
*/
-void qd_message_set_delivery_annotations(qd_message_t *msg,
qd_composed_field_t *da);
+void qd_message_set_message_annotations(qd_message_t *msg, qd_composed_field_t
*da);
/**
* Receive message data via a delivery. This function may be called more than
once on the same
Modified: qpid/dispatch/trunk/src/amqp.c
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/amqp.c?rev=1594718&r1=1594717&r2=1594718&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/amqp.c (original)
+++ qpid/dispatch/trunk/src/amqp.c Wed May 14 21:08:56 2014
@@ -19,9 +19,10 @@
#include <qpid/dispatch/amqp.h>
-const char * const QD_DA_INGRESS = "x-opt-qd.ingress";
-const char * const QD_DA_TRACE = "x-opt-qd.trace";
-const char * const QD_DA_TO = "x-opt-qd.to";
+const char * const QD_MA_INGRESS = "x-opt-qd.ingress";
+const char * const QD_MA_TRACE = "x-opt-qd.trace";
+const char * const QD_MA_TO = "x-opt-qd.to";
+const char * const QD_MA_CLASS = "x-opt-qd.class";
const char * const QD_CAPABILITY_ROUTER = "qd.router";
Modified: qpid/dispatch/trunk/src/message.c
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/message.c?rev=1594718&r1=1594717&r2=1594718&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/message.c (original)
+++ qpid/dispatch/trunk/src/message.c Wed May 14 21:08:56 2014
@@ -416,6 +416,11 @@ static qd_field_location_t *qd_message_f
return &content->section_delivery_annotation;
break;
+ case QD_FIELD_MESSAGE_ANNOTATION:
+ if (content->section_message_annotation.parsed)
+ return &content->section_message_annotation;
+ break;
+
case QD_FIELD_APPLICATION_PROPERTIES:
if (content->section_application_properties.parsed)
return &content->section_application_properties;
@@ -452,7 +457,7 @@ qd_message_t *qd_message()
msg->content->lock = sys_mutex();
msg->content->ref_count = 1;
msg->content->parse_depth = QD_DEPTH_NONE;
- msg->content->parsed_delivery_annotations = 0;
+ msg->content->parsed_message_annotations = 0;
return (qd_message_t*) msg;
}
@@ -469,8 +474,8 @@ void qd_message_free(qd_message_t *in_ms
sys_mutex_unlock(content->lock);
if (rc == 0) {
- if (content->parsed_delivery_annotations)
- qd_parse_free(content->parsed_delivery_annotations);
+ if (content->parsed_message_annotations)
+ qd_parse_free(content->parsed_message_annotations);
qd_buffer_t *buf = DEQ_HEAD(content->buffers);
while (buf) {
@@ -479,11 +484,11 @@ void qd_message_free(qd_message_t *in_ms
buf = DEQ_HEAD(content->buffers);
}
- buf = DEQ_HEAD(content->new_delivery_annotations);
+ buf = DEQ_HEAD(content->new_message_annotations);
while (buf) {
- DEQ_REMOVE_HEAD(content->new_delivery_annotations);
+ DEQ_REMOVE_HEAD(content->new_message_annotations);
qd_buffer_free(buf);
- buf = DEQ_HEAD(content->new_delivery_annotations);
+ buf = DEQ_HEAD(content->new_message_annotations);
}
sys_mutex_free(content->lock);
@@ -514,40 +519,40 @@ qd_message_t *qd_message_copy(qd_message
}
-qd_parsed_field_t *qd_message_delivery_annotations(qd_message_t *in_msg)
+qd_parsed_field_t *qd_message_message_annotations(qd_message_t *in_msg)
{
qd_message_pvt_t *msg = (qd_message_pvt_t*) in_msg;
qd_message_content_t *content = msg->content;
- if (content->parsed_delivery_annotations)
- return content->parsed_delivery_annotations;
+ if (content->parsed_message_annotations)
+ return content->parsed_message_annotations;
- qd_field_iterator_t *da = qd_message_field_iterator(in_msg,
QD_FIELD_DELIVERY_ANNOTATION);
- if (da == 0)
+ qd_field_iterator_t *ma = qd_message_field_iterator(in_msg,
QD_FIELD_MESSAGE_ANNOTATION);
+ if (ma == 0)
return 0;
- content->parsed_delivery_annotations = qd_parse(da);
- if (content->parsed_delivery_annotations == 0 ||
- !qd_parse_ok(content->parsed_delivery_annotations) ||
- !qd_parse_is_map(content->parsed_delivery_annotations)) {
- qd_field_iterator_free(da);
- qd_parse_free(content->parsed_delivery_annotations);
- content->parsed_delivery_annotations = 0;
+ content->parsed_message_annotations = qd_parse(ma);
+ if (content->parsed_message_annotations == 0 ||
+ !qd_parse_ok(content->parsed_message_annotations) ||
+ !qd_parse_is_map(content->parsed_message_annotations)) {
+ qd_field_iterator_free(ma);
+ qd_parse_free(content->parsed_message_annotations);
+ content->parsed_message_annotations = 0;
return 0;
}
- qd_field_iterator_free(da);
- return content->parsed_delivery_annotations;
+ qd_field_iterator_free(ma);
+ return content->parsed_message_annotations;
}
-void qd_message_set_delivery_annotations(qd_message_t *msg,
qd_composed_field_t *da)
+void qd_message_set_message_annotations(qd_message_t *msg, qd_composed_field_t
*da)
{
qd_message_content_t *content = MSG_CONTENT(msg);
qd_buffer_list_t *field_buffers = qd_compose_buffers(da);
- assert(DEQ_SIZE(content->new_delivery_annotations) == 0);
- content->new_delivery_annotations = *field_buffers;
+ assert(DEQ_SIZE(content->new_message_annotations) == 0);
+ content->new_message_annotations = *field_buffers;
DEQ_INIT(*field_buffers); // Zero out the linkage to the now moved buffers.
}
@@ -658,18 +663,18 @@ void qd_message_send(qd_message_t *in_ms
qd_message_repr(in_msg, repr, sizeof(repr)),
pn_link_name(pnl));
- if (DEQ_SIZE(content->new_delivery_annotations) > 0) {
+ if (DEQ_SIZE(content->new_message_annotations) > 0) {
//
- // This is the case where the delivery annotations have been modified.
+ // This is the case where the message annotations have been modified.
// The message send must be divided into sections: The existing
header;
- // the new delivery annotations; the rest of the existing message.
- // Note that the original delivery annotations that are still in the
+ // the new message annotations; the rest of the existing message.
+ // Note that the original message annotations that are still in the
// buffer chain must not be sent.
//
// Start by making sure that we've parsed the message sections through
- // the delivery annotations
+ // the message annotations
//
- if (!qd_message_check(in_msg, QD_DEPTH_DELIVERY_ANNOTATIONS))
+ if (!qd_message_check(in_msg, QD_DEPTH_MESSAGE_ANNOTATIONS))
return;
//
@@ -685,20 +690,20 @@ void qd_message_send(qd_message_t *in_ms
}
//
- // Send new delivery annotations
+ // Send new message annotations
//
- qd_buffer_t *da_buf = DEQ_HEAD(content->new_delivery_annotations);
+ qd_buffer_t *da_buf = DEQ_HEAD(content->new_message_annotations);
while (da_buf) {
pn_link_send(pnl, (char*) qd_buffer_base(da_buf),
qd_buffer_size(da_buf));
da_buf = DEQ_NEXT(da_buf);
}
//
- // Skip over replaced delivery annotations
+ // Skip over replaced message annotations
//
- if (content->section_delivery_annotation.length > 0)
+ if (content->section_message_annotation.length > 0)
advance(&cursor, &buf,
- content->section_delivery_annotation.hdr_length +
content->section_delivery_annotation.length,
+ content->section_message_annotation.hdr_length +
content->section_message_annotation.length,
0, 0);
//
Modified: qpid/dispatch/trunk/src/message_private.h
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/message_private.h?rev=1594718&r1=1594717&r2=1594718&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/message_private.h (original)
+++ qpid/dispatch/trunk/src/message_private.h Wed May 14 21:08:56 2014
@@ -71,7 +71,7 @@ typedef struct {
sys_mutex_t *lock;
uint32_t ref_count; // The number of
messages referencing this
qd_buffer_list_t buffers; // The buffer chain
containing the message
- qd_buffer_list_t new_delivery_annotations; // The buffer chain
containing the new delivery annotations (MOVE TO MSG_PVT)
+ qd_buffer_list_t new_message_annotations; // The buffer chain
containing the new message annotations (MOVE TO MSG_PVT)
qd_field_location_t section_message_header; // The message
header list
qd_field_location_t section_delivery_annotation; // The delivery
annotation map
qd_field_location_t section_message_annotation; // The message
annotation map
@@ -87,7 +87,7 @@ typedef struct {
qd_buffer_t *parse_buffer;
unsigned char *parse_cursor;
qd_message_depth_t parse_depth;
- qd_parsed_field_t *parsed_delivery_annotations;
+ qd_parsed_field_t *parsed_message_annotations;
} qd_message_content_t;
typedef struct {
Modified: qpid/dispatch/trunk/src/python_embedded.c
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/python_embedded.c?rev=1594718&r1=1594717&r2=1594718&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/python_embedded.c (original)
+++ qpid/dispatch/trunk/src/python_embedded.c Wed May 14 21:08:56 2014
@@ -532,13 +532,13 @@ static PyObject* qd_python_send(PyObject
if (!PyArg_ParseTuple(args, "sOO", &address, &app_properties, &body))
return 0;
- field = qd_compose(QD_PERFORMATIVE_DELIVERY_ANNOTATIONS, field);
+ field = qd_compose(QD_PERFORMATIVE_MESSAGE_ANNOTATIONS, field);
qd_compose_start_map(field);
- qd_compose_insert_string(field, QD_DA_INGRESS);
+ qd_compose_insert_string(field, QD_MA_INGRESS);
qd_compose_insert_string(field, qd_router_id(ioa->qd));
- qd_compose_insert_string(field, QD_DA_TRACE);
+ qd_compose_insert_string(field, QD_MA_TRACE);
qd_compose_start_list(field);
qd_compose_insert_string(field, qd_router_id(ioa->qd));
qd_compose_end_list(field);
Modified: qpid/dispatch/trunk/src/router_node.c
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/router_node.c?rev=1594718&r1=1594717&r2=1594718&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/router_node.c (original)
+++ qpid/dispatch/trunk/src/router_node.c Wed May 14 21:08:56 2014
@@ -437,37 +437,37 @@ static int router_writable_link_handler(
static qd_field_iterator_t *router_annotate_message(qd_router_t *router,
- qd_parsed_field_t *in_da,
+ qd_parsed_field_t *in_ma,
qd_message_t *msg,
int *drop,
const char
*to_override)
{
- qd_composed_field_t *out_da =
qd_compose(QD_PERFORMATIVE_DELIVERY_ANNOTATIONS, 0);
+ qd_composed_field_t *out_ma =
qd_compose(QD_PERFORMATIVE_MESSAGE_ANNOTATIONS, 0);
qd_field_iterator_t *ingress_iter = 0;
qd_parsed_field_t *trace = 0;
qd_parsed_field_t *ingress = 0;
- if (in_da) {
- trace = qd_parse_value_by_key(in_da, QD_DA_TRACE);
- ingress = qd_parse_value_by_key(in_da, QD_DA_INGRESS);
+ if (in_ma) {
+ trace = qd_parse_value_by_key(in_ma, QD_MA_TRACE);
+ ingress = qd_parse_value_by_key(in_ma, QD_MA_INGRESS);
}
- qd_compose_start_map(out_da);
+ qd_compose_start_map(out_ma);
//
// If there is a to_override provided, insert a TO field.
//
if (to_override) {
- qd_compose_insert_string(out_da, QD_DA_TO);
- qd_compose_insert_string(out_da, to_override);
+ qd_compose_insert_string(out_ma, QD_MA_TO);
+ qd_compose_insert_string(out_ma, to_override);
}
//
// If there is a trace field, append this router's ID to the trace.
//
- qd_compose_insert_string(out_da, QD_DA_TRACE);
- qd_compose_start_list(out_da);
+ qd_compose_insert_string(out_ma, QD_MA_TRACE);
+ qd_compose_start_list(out_ma);
if (trace) {
if (qd_parse_is_list(trace)) {
uint32_t idx = 0;
@@ -477,31 +477,31 @@ static qd_field_iterator_t *router_annot
if (qd_field_iterator_equal(iter, (unsigned char*) node_id))
*drop = 1;
qd_field_iterator_reset(iter);
- qd_compose_insert_string_iterator(out_da, iter);
+ qd_compose_insert_string_iterator(out_ma, iter);
idx++;
trace_item = qd_parse_sub_value(trace, idx);
}
}
}
- qd_compose_insert_string(out_da, node_id);
- qd_compose_end_list(out_da);
+ qd_compose_insert_string(out_ma, node_id);
+ qd_compose_end_list(out_ma);
//
// If there is no ingress field, annotate the ingress as this router else
// keep the original field.
//
- qd_compose_insert_string(out_da, QD_DA_INGRESS);
+ qd_compose_insert_string(out_ma, QD_MA_INGRESS);
if (ingress && qd_parse_is_scalar(ingress)) {
ingress_iter = qd_parse_raw(ingress);
- qd_compose_insert_string_iterator(out_da, ingress_iter);
+ qd_compose_insert_string_iterator(out_ma, ingress_iter);
} else
- qd_compose_insert_string(out_da, node_id);
+ qd_compose_insert_string(out_ma, node_id);
- qd_compose_end_map(out_da);
+ qd_compose_end_map(out_ma);
- qd_message_set_delivery_annotations(msg, out_da);
- qd_compose_free(out_da);
+ qd_message_set_message_annotations(msg, out_ma);
+ qd_compose_free(out_ma);
//
// Return the iterator to the ingress field _if_ it was present.
@@ -718,7 +718,7 @@ static void router_rx_handler(void* cont
valid_message = qd_message_check(msg, QD_DEPTH_PROPERTIES);
if (valid_message) {
- qd_parsed_field_t *in_da = 0;
+ qd_parsed_field_t *in_ma = 0;
qd_field_iterator_t *iter = 0;
bool free_iter = true;
qd_address_t *addr;
@@ -729,15 +729,15 @@ static void router_rx_handler(void* cont
// Only respect the delivery annotations if the message came from
another router.
//
if (rlink->link_type != QD_LINK_WAYPOINT)
- in_da = qd_message_delivery_annotations(msg);
+ in_ma = qd_message_message_annotations(msg);
//
// If the message has delivery annotations, get the to-override field
from the annotations.
//
- if (in_da) {
- qd_parsed_field_t *da_to = qd_parse_value_by_key(in_da, QD_DA_TO);
- if (da_to) {
- iter = qd_parse_raw(da_to);
+ if (in_ma) {
+ qd_parsed_field_t *ma_to = qd_parse_value_by_key(in_ma, QD_MA_TO);
+ if (ma_to) {
+ iter = qd_parse_raw(ma_to);
free_iter = false;
}
}
@@ -805,7 +805,7 @@ static void router_rx_handler(void* cont
// returns a 'drop' indication if it detects that the message
will loop.
//
int drop = 0;
- qd_field_iterator_t *ingress_iter =
router_annotate_message(router, in_da, msg, &drop, to_override);
+ qd_field_iterator_t *ingress_iter =
router_annotate_message(router, in_ma, msg, &drop, to_override);
//
// Forward to the in-process handler for this address if there
is one. The
Modified: qpid/dispatch/trunk/tests/system_tests_one_router.py
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/tests/system_tests_one_router.py?rev=1594718&r1=1594717&r2=1594718&view=diff
==============================================================================
--- qpid/dispatch/trunk/tests/system_tests_one_router.py (original)
+++ qpid/dispatch/trunk/tests/system_tests_one_router.py Wed May 14 21:08:56
2014
@@ -434,8 +434,8 @@ class RouterTest(unittest.TestCase):
# pass
- def test_08_delivery_annotations(self):
- addr = "amqp://0.0.0.0:20000/da/1"
+ def test_08_message_annotations(self):
+ addr = "amqp://0.0.0.0:20000/ma/1"
M1 = Messenger()
M2 = Messenger()
@@ -464,15 +464,15 @@ class RouterTest(unittest.TestCase):
M2.recv(1)
M2.get(rm)
self.assertEqual(i, rm.body['number'])
- da = rm.instructions
- self.assertEqual(da.__class__, dict)
- self.assertEqual(da['x-opt-qd.ingress'], '0/QDR')
- self.assertEqual(da['x-opt-qd.trace'], ['0/QDR'])
+ ma = rm.annotations
+ self.assertEqual(ma.__class__, dict)
+ self.assertEqual(ma['x-opt-qd.ingress'], '0/QDR')
+ self.assertEqual(ma['x-opt-qd.trace'], ['0/QDR'])
##
## Pre-existing ingress
##
- tm.instructions = {'x-opt-qd.ingress': 'ingress-router'}
+ tm.annotations = {'x-opt-qd.ingress': 'ingress-router'}
for i in range(10):
tm.body = {'number': i}
M1.put(tm)
@@ -482,15 +482,15 @@ class RouterTest(unittest.TestCase):
M2.recv(1)
M2.get(rm)
self.assertEqual(i, rm.body['number'])
- da = rm.instructions
- self.assertEqual(da.__class__, dict)
- self.assertEqual(da['x-opt-qd.ingress'], 'ingress-router')
- self.assertEqual(da['x-opt-qd.trace'], ['0/QDR'])
+ ma = rm.annotations
+ self.assertEqual(ma.__class__, dict)
+ self.assertEqual(ma['x-opt-qd.ingress'], 'ingress-router')
+ self.assertEqual(ma['x-opt-qd.trace'], ['0/QDR'])
##
## Invalid trace type
##
- tm.instructions = {'x-opt-qd.trace' : 45}
+ tm.annotations = {'x-opt-qd.trace' : 45}
for i in range(10):
tm.body = {'number': i}
M1.put(tm)
@@ -500,15 +500,15 @@ class RouterTest(unittest.TestCase):
M2.recv(1)
M2.get(rm)
self.assertEqual(i, rm.body['number'])
- da = rm.instructions
- self.assertEqual(da.__class__, dict)
- self.assertEqual(da['x-opt-qd.ingress'], '0/QDR')
- self.assertEqual(da['x-opt-qd.trace'], ['0/QDR'])
+ ma = rm.annotations
+ self.assertEqual(ma.__class__, dict)
+ self.assertEqual(ma['x-opt-qd.ingress'], '0/QDR')
+ self.assertEqual(ma['x-opt-qd.trace'], ['0/QDR'])
##
## Empty trace
##
- tm.instructions = {'x-opt-qd.trace' : []}
+ tm.annotations = {'x-opt-qd.trace' : []}
for i in range(10):
tm.body = {'number': i}
M1.put(tm)
@@ -518,15 +518,15 @@ class RouterTest(unittest.TestCase):
M2.recv(1)
M2.get(rm)
self.assertEqual(i, rm.body['number'])
- da = rm.instructions
- self.assertEqual(da.__class__, dict)
- self.assertEqual(da['x-opt-qd.ingress'], '0/QDR')
- self.assertEqual(da['x-opt-qd.trace'], ['0/QDR'])
+ ma = rm.annotations
+ self.assertEqual(ma.__class__, dict)
+ self.assertEqual(ma['x-opt-qd.ingress'], '0/QDR')
+ self.assertEqual(ma['x-opt-qd.trace'], ['0/QDR'])
##
## Non-empty trace
##
- tm.instructions = {'x-opt-qd.trace' : ['0/first.hop']}
+ tm.annotations = {'x-opt-qd.trace' : ['0/first.hop']}
for i in range(10):
tm.body = {'number': i}
M1.put(tm)
@@ -536,10 +536,10 @@ class RouterTest(unittest.TestCase):
M2.recv(1)
M2.get(rm)
self.assertEqual(i, rm.body['number'])
- da = rm.instructions
- self.assertEqual(da.__class__, dict)
- self.assertEqual(da['x-opt-qd.ingress'], '0/QDR')
- self.assertEqual(da['x-opt-qd.trace'], ['0/first.hop', '0/QDR'])
+ ma = rm.annotations
+ self.assertEqual(ma.__class__, dict)
+ self.assertEqual(ma['x-opt-qd.ingress'], '0/QDR')
+ self.assertEqual(ma['x-opt-qd.trace'], ['0/first.hop', '0/QDR'])
M1.stop()
M2.stop()
Modified: qpid/dispatch/trunk/tests/system_tests_two_routers.py
URL:
http://svn.apache.org/viewvc/qpid/dispatch/trunk/tests/system_tests_two_routers.py?rev=1594718&r1=1594717&r2=1594718&view=diff
==============================================================================
--- qpid/dispatch/trunk/tests/system_tests_two_routers.py (original)
+++ qpid/dispatch/trunk/tests/system_tests_two_routers.py Wed May 14 21:08:56
2014
@@ -503,7 +503,7 @@ class RouterTest(unittest.TestCase):
def test_08_delivery_annotations(self):
- addr = "amqp:/da/1"
+ addr = "amqp:/ma/1"
M1 = Messenger()
M2 = Messenger()
@@ -516,7 +516,7 @@ class RouterTest(unittest.TestCase):
M1.start()
M2.start()
self.subscribe(M2, addr)
- wait_for_addr(M1, "da/1", 0, 1)
+ wait_for_addr(M1, "ma/1", 0, 1)
tm = Message()
rm = Message()
@@ -535,10 +535,10 @@ class RouterTest(unittest.TestCase):
M2.recv(1)
M2.get(rm)
self.assertEqual(i, rm.body['number'])
- da = rm.instructions
- self.assertEqual(da.__class__, dict)
- self.assertEqual(da['x-opt-qd.ingress'], '0/QDR.A')
- self.assertEqual(da['x-opt-qd.trace'], ['0/QDR.A', '0/QDR.B'])
+ ma = rm.annotations
+ self.assertEqual(ma.__class__, dict)
+ self.assertEqual(ma['x-opt-qd.ingress'], '0/QDR.A')
+ self.assertEqual(ma['x-opt-qd.trace'], ['0/QDR.A', '0/QDR.B'])
M1.stop()
M2.stop()
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]