[PATCH] Only invoke onQuality callbck for MAMA_MSG_TYPE_MISC


Michael Schonberg <mschonberg@...>
 

From: Mike Schonberg <mschonberg@nyx.com>

When amessage arrives with a status of POSSIBLY_STALE, verify that the message
type is MAMA_MSG_TYPE_MISC. This behavior is consistent with OpenMAMA market
data publishers.

Signed-off-by: Michael Schonberg <mschonberg@nyx.com>
---
mama/c_cpp/src/c/listenermsgcallback.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/mama/c_cpp/src/c/listenermsgcallback.c b/mama/c_cpp/src/c/listenermsgcallback.c
index 9e770a9..dca5474 100644
--- a/mama/c_cpp/src/c/listenermsgcallback.c
+++ b/mama/c_cpp/src/c/listenermsgcallback.c
@@ -306,6 +306,25 @@ listenerMsgCallback_processMsg( listenerMsgCallback callback, mamaMsg msg,
handleNoSubscribers (impl, msg, ctx);
return;
}
+
+ /* 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)
--
1.7.5.4

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