[PATCH 1.1] listenmsgcallback.c: Msg status possibly stale and unknown


John Gray <jgray@...>
 

Added new msg status of possibly stale and unknown

 

--- listenermsgcallback.c               2012-01-27 10:45:39.000000000 +0000

+++ listenermsgcallback.c            2012-01-27 11:10:30.000000000 +0000

@@ -314,6 +314,23 @@

                                                               listenerMsgCallbackImpl_logUnknownStatus(ctx, status, subscription);

                                                               break;

         }

+                                             /* The possibly stale messages are sent by the MAMACACHE with a miscellanious type and should be translated

+                                             * into a quality event.

+                                             */

+                                             case MAMA_MSG_STATUS_POSSIBLY_STALE:

+                                             {

+                                                             /* Verify that the type is misc. */

+                                                             if(msgType == MAMA_MSG_TYPE_MISC)

+                                                             {

+                                                                             /* Change the state to maybe stale and invoke the onquality callback. */

+                                                                             mamaSubscription_setPossiblyStale(subscription);

+                                                                             break;

+                                                             }

+

+                                                             /* Otherwise log the fact we have received an unknown message. */

+                                                             listenerMsgCallbackImpl_logUnknownStatus(ctx, status, subscription);

+                                                             break;

+                                             }

         case MAMA_MSG_STATUS_MISC:

         {

             if (msgType == MAMA_MSG_TYPE_REFRESH)

@@ -635,3 +652,17 @@

                   userSymbol,

                   closure);

}

+

+void listenerMsgCallbackImpl_logUnknownStatus(SubjectContext *ctx, int status, mamaSubscription subscription)

+{

+    /* Write the log at fine level. */

+    if ((gMamaLogLevel >= MAMA_LOG_LEVEL_FINE) || (mamaSubscription_checkDebugLevel (subscription, MAMA_LOG_LEVEL_FINE)))

+    {

+        const char* userSymbol = NULL;

+        mamaSubscription_getSymbol (subscription, &userSymbol);

+        mama_log (MAMA_LOG_LEVEL_FINE,

+                        "%s%s%s%s Unexpected status: %s",

+                        userSymbolFormatted, ctxSymbolFormatted,

+                        mamaMsgStatus_stringForStatus( status ) );

+    }

+}

Signed-off-by: John Gray <jgray@...>

 

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.