[PATCH 2.3.1 1/1] TESTTOOLS: capturereplayc does not need to send reply when the received mama subscription request is not from inbox.


Alireza Assadzadeh <Alireza.Assadzadeh@...>
 

If subscription message is not from inbox, then there is no need to
publish the initial image when processing onNewRequest or onRequest.
For example, in the case of a real time market data subscription that
has disabled the receipt of initial image.

Test Plan:
- Checked with capturereplayc and mamalistenc.
- Used qpid middleware bridge for regression testing.
- Used solace middleware bridge for the case of real time market
data subscription with receipt of initial image disabled.

Signed-off-by: Alireza Assadzadeh <Alireza.Assadzadeh@solacesystems.com>
---

The patches are against 'next' branch. They are tested by using sample and
testtool programs: capturereplayc and mamalistenc.

.../src/testtools/capturereplay/c/capturereplayc.c | 26 +++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/mama/c_cpp/src/testtools/capturereplay/c/capturereplayc.c b/mama/c_cpp/src/testtools/capturereplay/c/capturereplayc.c
index e4b1ed0..c420384 100644
--- a/mama/c_cpp/src/testtools/capturereplay/c/capturereplayc.c
+++ b/mama/c_cpp/src/testtools/capturereplay/c/capturereplayc.c
@@ -478,8 +478,16 @@ subscriptionHandlerOnNewRequestCb (mamaDQPublisherManager manager,
MamaFieldMsgType.mFid,
MAMA_MSG_TYPE_INITIAL);
}
- mamaDQPublisher_sendReply (gSubscriptionList[index].pub, msg,
- gSubscriptionList[index].cachedMsg);
+ /* If subscription message is from inbox, then send reply to inbox.
+ * Otherwise, there is no need to publish the initial image. For
+ * example, in the case of a real time market data subscription that
+ * has disabled the receipt of initial image.
+ */
+ if (mamaMsg_isFromInbox (msg))
+ {
+ mamaDQPublisher_sendReply (gSubscriptionList[index].pub, msg,
+ gSubscriptionList[index].cachedMsg);
+ }
break;
default:
mama_log (MAMA_LOG_LEVEL_NORMAL, "Publishing MAMA_MSG_TYPE_RECAP");
@@ -529,9 +537,17 @@ subscriptionHandlerOnRequestCb (mamaDQPublisherManager manager,
MamaFieldMsgType.mFid,
MAMA_MSG_TYPE_INITIAL);
}
- mamaDQPublisher_sendReply (gSubscriptionList[index].pub,
- msg,
- gSubscriptionList[index].cachedMsg);
+ /* If subscription message is from inbox, then send reply to inbox.
+ * Otherwise, there is no need to publish the initial image. For
+ * example, in the case of a real time market data subscription that
+ * has disabled the receipt of initial image.
+ */
+ if (mamaMsg_isFromInbox (msg))
+ {
+ mamaDQPublisher_sendReply (gSubscriptionList[index].pub,
+ msg,
+ gSubscriptionList[index].cachedMsg);
+ }
break;
case MAMA_SUBSC_DQ_SUBSCRIBER:
case MAMA_SUBSC_DQ_PUBLISHER:
--
1.9.3

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