Hi there,
How do I get the status of domain routes programatically? AKA, I would like to recieve status change events in case one is not 'healthy' or changes state.
Hi there,
How do I get the status of domain routes programatically? AKA, I would like to recieve status change events in case one is not 'healthy' or changes state.
You have to use the remote monitoring "interface", which uses DDS Topics to receive status updates.
https://community.rti.com/static/documentation/connext-dds/6.1.1/doc/manuals/connext_dds_professional/services/routing_service/monitoring.html
Thank you Howard, that worked.
I now get get the events that I need, however I do not get the entity associated with the event. Ie: the name of a domain route/session/routing service/etc
Is there a way that I can get the name of the entity from the event?
IE: const RTI::RoutingService::Monitoring::Event& event = registeredEvent.data();
Is there a way to get the name of the entity from this event?
Well, you basically have to traverse the structure (using an IDE like Visual Code or Eclipse is quite helpful to do this easily)
RTI::RoutingService::Monitoring::Event
derives fromRTI::Service::Monitoring::KeyedResource
so
event.object_guid
identifies the object for which the event is being reported.
But to convert the GUID into something human recognizable, you need to also subscribe to the ConfigDistributionTopic and cache the information that you receive from that, e.g., create a map from the GUID to the associated Config data, that GUID from the Config data would correspond to the GUID of that you get from the Event data
RTI::RoutingService::Monitoring::Config
also derives fromRTI::Service::Monitoring::KeyedResource
RTI::RoutingService::Monitoring::Config config;
config.object_guid
<-->event.object_guid
and
config.value
is a union of the configurations of the different entities...and using the union discriminator,config.value._d
, you can determine what kind of entity is represented by theobject_guid
,and for example, if it's a RouteConfig, then
config.value.routing_route.resource_id
would have a string value that is the Resource Identifier.
https://community.rti.com/static/documentation/connext-dds/6.1.1/doc/manuals/connext_dds_professional/services/routing_service/common/resource_model.html#resource-identifiers
While a bit complicated...and you have to do the caching of information to be looked up later, this minimizes the amount of data that has to be sent when an event occurs or on a periodic basis.
Hi Howard,
Thank you for your explanation.
The only problem I am experiencing now is that if the above services are already running, I am not able to get config events from them. Here is my readcondition. Is there a better implementation I should consider?
This is a general issue for any application that starts after another application has already been sending data. How to get the data that was sent before discovery was completed?
All of the Monitoring topics in RTI Routing Service are created with TRANSIENT_LOCAL Durability kind.
https://community.rti.com/static/documentation/connext-dds/6.1.1/doc/manuals/connext_dds_professional/services/routing_service/configuration.html?highlight=durability#tablemonitoringtag
And so to get the past data automatically sent upon discovery, you need to create your DataReaders with the same Durability.