From c29dd0129b35390334bb6d2bbed5500b7089a532 Mon Sep 17 00:00:00 2001
From: Anders Svensson
Date: Thu, 13 Nov 2014 21:56:03 +0100
Subject: Order peers in pick_peer callbacks
The order of peers presented to a diameter_app(3) pick_peer callback has
previously not been documented, but there are use cases that are
simplified by an ordering. For example, consider preferring a direct
connection to a specified Destination-Host/Realm to any host in the
realm. The implementation previously treated this as a special case by
placing matching hosts at the head of the peers list, but the
documentation made no guarantees. Now present peers in match-order, so
that the desired sorting is the result of the following filter.
{any, [{all, [host, realm]}, realm]}
The implementation is not backwards compatible in the sense that a realm
filter alone is no longer equivalent in this case. However, as stated,
the documentation never made any guarantees regarding the sorting.
---
lib/diameter/doc/src/diameter.xml | 12 ++++++++++++
1 file changed, 12 insertions(+)
(limited to 'lib/diameter/doc')
diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml
index ab9ad25a3a..00b54ffbc4 100644
--- a/lib/diameter/doc/src/diameter.xml
+++ b/lib/diameter/doc/src/diameter.xml
@@ -500,6 +500,18 @@ Matches only those peers matched by each filter in the specified list.
Matches only those peers matched by at least one filter in the
specified list.
+
+
+The resulting peer list will be in match order, peers matching the
+first filter of the list sorting before those matched by the second,
+and so on.
+For example, the following filter causes peers matching both the host
+and realm filters to be presented before those matching only the realm
+filter.
+
+
+{any, [{all, [host, realm]}, realm]}
+
--
cgit v1.2.3