From c0b8067f78655647d398d12dac305e3993a90d85 Mon Sep 17 00:00:00 2001 From: Yadunund Date: Thu, 11 Jan 2024 19:47:09 +0800 Subject: [PATCH] Call ze_querying_subscriber_get after query sub is initialized Signed-off-by: Yadunund --- rmw_zenoh_cpp/src/rmw_zenoh.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rmw_zenoh_cpp/src/rmw_zenoh.cpp b/rmw_zenoh_cpp/src/rmw_zenoh.cpp index 7c39b356..8ed69e06 100644 --- a/rmw_zenoh_cpp/src/rmw_zenoh.cpp +++ b/rmw_zenoh_cpp/src/rmw_zenoh.cpp @@ -1321,6 +1321,14 @@ rmw_create_subscription( RMW_SET_ERROR_MSG("unable to create zenoh subscription"); return nullptr; } + // Call this method when a publisher with matching QoS is discovered since + // the published data could have been transmitted before the publisher was + // discovered. + ze_querying_subscriber_get( + z_loan(std::get(sub_data->sub)), + z_loan(keyexpr), + NULL + ); } // Create a regular subscriber for all other durability settings. else {