From b97d318b7bc31b47fbd4b74421e351095f05139d Mon Sep 17 00:00:00 2001 From: "David M. Lee" Date: Tue, 6 Aug 2013 14:28:23 +0000 Subject: Tweak caching topics to fix CEL tests The Stasis changes in r395954 had an unanticipated side effect: messages published directly to an _all topic does not get forwarded to the corresponding caching topic. This patch fixes that by changing how caching topics forward messages, and how the caching pattern forwards are setup. For the caching pattern, the all_topic is forwarded to the all_topic_cached. This forwards messages published directly to the all_topic to all_topic_cached. In order to avoid duplicate messages on all_topic_cached, caching topics were changed to no longer forward uncached messages. Subscribers to an individual caching topic should only expect to receive cache updates, and subscription change messages. Since individual caching topics are new, this shouldn't be a problem. There are a few minor changes to the pre-cache split behavior. * For topics changed to use the caching pattern, the all_topic_cached will forward snapshots in addition to cache updates. Since subscribers by design ignore unexpected messages, this should be fine. * Caching topics that don't use the caching pattern no longer forward non-cache updates. This makes no difference for the current caching topics. * mwi_topic_cached, channel_by_name_topic and presence_state_topic_cached have no subscribers * device_state_topic_cached's only subscriber only processes cache udpates (issue ASTERISK-22243) Review: https://reviewboard.asterisk.org/r/2738 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396329 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/stasis_cache.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'main/stasis_cache.c') diff --git a/main/stasis_cache.c b/main/stasis_cache.c index 3d5065665..2ca4083df 100644 --- a/main/stasis_cache.c +++ b/main/stasis_cache.c @@ -426,8 +426,7 @@ static void caching_topic_exec(void *data, struct stasis_subscription *sub, id = caching_topic->cache->id_fn(message); if (id == NULL) { - /* Object isn't cached; forward */ - stasis_forward_message(caching_topic->topic, topic, message); + /* Object isn't cached; discard */ } else { /* Update the cache */ RAII_VAR(struct stasis_message *, old_snapshot, NULL, ao2_cleanup); -- cgit v1.2.3