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 {