diff --git a/include/broker/endpoint.hh b/include/broker/endpoint.hh index 2af652266..a235eb0fd 100644 --- a/include/broker/endpoint.hh +++ b/include/broker/endpoint.hh @@ -252,7 +252,7 @@ public: // --- forwarding events ----------------------------------------------------- - /// Forward remote events for given filter even if no local subscribers exist. + [[deprecated("this legacy function has no effect")]] void forward(filter_type filter); // --- subscribing data ------------------------------------------------------ diff --git a/src/broker-node.cc b/src/broker-node.cc index 818bc4f6d..d0f9a911f 100644 --- a/src/broker-node.cc +++ b/src/broker-node.cc @@ -499,7 +499,6 @@ int main(int argc, char** argv) { for (auto& topic_name : topic_names) topics.emplace_back(std::move(topic_name)); } - ep.forward(topics); // Enable verbose output if demanded by user. actor verbose_logger; if (get_or(ep, "verbose", false)) { diff --git a/tests/python/forwarding.py b/tests/python/forwarding.py index 1d00b1729..b76565c57 100644 --- a/tests/python/forwarding.py +++ b/tests/python/forwarding.py @@ -40,58 +40,21 @@ def test_two_hops(self): x = s4.get() self.assertEqual(x, ('/test/foo', 'Foo!')) - x = s1.get() - self.assertEqual(x, ('/test/bar', 'Bar!')) - - def test_two_hops_with_forward(self): - # Two hops that are not subscribed, but configured to forward. - ((ep1, ep2, ep3, ep4), (s1, s2, s3, s4)) = setup_peers(create_s2=False, create_s3=False) - - ep2.forward("/test/"); - ep3.forward("/test/"); - time.sleep(1) # give time to take effect. - - ep1.publish("/test/foo", "Foo!") - ep4.publish("/test/bar", "Bar!") - x = s4.get() - self.assertEqual(x, ('/test/foo', 'Foo!')) x = s1.get() self.assertEqual(x, ('/test/bar', 'Bar!')) - def test_two_hops_forwarding_disabled(self): - # Two hops that are subscribed, so they would forward but we disable. - no_forward = broker.BrokerOptions() - no_forward.forward = False - - ((ep1, ep2, ep3, ep4), (s1, s2, s3, s4)) = setup_peers(opts2=no_forward) - - ep1.publish("/test/foo", "Foo!") # Shouldn't arrive - x = s4.get(1.0) - self.assertEqual(x, None) - - def test_two_hops_without_forward(self): - # Two hops that are not subscribed, and hence don't forward. - ((ep1, ep2, ep3, ep4), (s1, s2, s3, s4)) = setup_peers(create_s2=False, create_s3=False) - - ep1.publish("/test/foo", "Foo!") - x = s4.get(1.0) - self.assertEqual(x, None) - - def test_two_hops_ttl(self): - ttl1 = broker.BrokerOptions() - ttl1.ttl = 2 - ((ep1, ep2, ep3, ep4), (s1, s2, s3, s4)) = setup_peers(opts1=ttl1) - - ep1.publish("/test/foo", "Foo!") - - x = s2.get(1.0) - self.assertEqual(x, ('/test/foo', 'Foo!')) - x = s3.get(1.0) - self.assertEqual(x, ('/test/foo', 'Foo!')) - x = s4.get(1.0) - self.assertEqual(x, None) # Doesn't get here anymore. +# def test_two_hops_with_forward(self): +# # Two hops that are not subscribed, but configured to forward. +# ((ep1, ep2, ep3, ep4), (s1, s2, s3, s4)) = setup_peers(create_s2=False, create_s3=False) +# +# ep1.publish("/test/foo", "Foo!") +# ep4.publish("/test/bar", "Bar!") +# +# x = s4.get() +# self.assertEqual(x, ('/test/foo', 'Foo!')) +# x = s1.get() +# self.assertEqual(x, ('/test/bar', 'Bar!')) if __name__ == '__main__': - #TestCommunication().test_two_hops() unittest.main(verbosity=3)