[PATCH] Added MAMA_STATUS_SUBSCRIPTION_GAP


Michael Schonberg <mschonberg@...>
 

From: Mike Schonberg <mschonberg@...>

Middleware bridges pass this status to the mamaSubscription onError callback
when the middleware detects a gap:

mamaSubscription_getUserCallbacks(sub)->onError(...)

Middlewares that do not detect dropped messages will not use this status.

Note that this callback is independent of the sequence number gap detection
implemented by dqpublisher and dqstrategy.

Signed-off-by: John Gray <jgray@...>
---
mama/c_cpp/src/c/mama/status.h | 4 +++-
mama/c_cpp/src/c/status.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/mama/c_cpp/src/c/mama/status.h b/mama/c_cpp/src/c/mama/status.h
index bccb7e0..fa0c5f5 100644
--- a/mama/c_cpp/src/c/mama/status.h
+++ b/mama/c_cpp/src/c/mama/status.h
@@ -99,7 +99,9 @@ typedef enum
/* Queue has open objects. */
MAMA_STATUS_QUEUE_OPEN_OBJECTS = 5002,
/* The function isn't supported for this type of subscription. */
- MAMA_STATUS_SUBSCRIPTION_INVALID_TYPE = 5003
+ MAMA_STATUS_SUBSCRIPTION_INVALID_TYPE = 5003,
+ /* The underlying transport saw a gap. */
+ MAMA_STATUS_SUBSCRIPTION_GAP = 5004

#ifdef WITH_ENTITLEMENTS
/* Out of memory */
diff --git a/mama/c_cpp/src/c/status.c b/mama/c_cpp/src/c/status.c
index 1c394e3..7e7ff91 100644
--- a/mama/c_cpp/src/c/status.c
+++ b/mama/c_cpp/src/c/status.c
@@ -61,7 +61,8 @@ mamaStatus_stringForStatus (mama_status status)
case MAMA_STATUS_SUBSCRIPTION_INVALID_STATE: return "MAMA_STATUS_SUBSCRIPTION_INVALID_STATE";
case MAMA_STATUS_QUEUE_OPEN_OBJECTS: return "MAMA_STATUS_QUEUE_OPEN_OBJECTS";
case MAMA_STATUS_SUBSCRIPTION_INVALID_TYPE: return "MAMA_STATUS_SUBSCRIPTION_INVALID_TYPE";
-
+ case MAMA_STATUS_SUBSCRIPTION_GAP: return "MAMA_STATUS_SUBSCRIPTION_GAP";
+
#ifdef WITH_ENTITLEMENTS
case MAMA_ENTITLE_STATUS_NOMEM : return "ENTITLE_STATUS_NOMEM";
case MAMA_ENTITLE_STATUS_BAD_PARAM : return "ENTITLE_STATUS_BAD_PARAM";
--
1.7.5.4