.. include:: ../../../router.1.0/srcDoc/vars.rst .. _section-TopicQuerySupport: ******************* Topic Query Support ******************* |RS| is fully compatible with |TQs| (see :link_connext_dds_pro_um_up_one:`Topic Queries<#users_manual/TopicQueries.htm>` in the *RTI Connext DDS Core Libraries User’s Manual*). You can enable this functionality in |TRs| and |ATRs| with two different query modes: - **Dispatch mode**: The |TR|'s |DW| configured with TRANSIENT_LOCAL durability will accept matching |TQs| and dispatch them from its own sample cache. - **Propagation mode**: |TQs| are propagated from the user |DRs| to the user |DWs|. These |DWs| will be the final endpoints that dispatch the propagated |TQs|. |RS| allows propagating |TQs| from |DRs| to |DWs| acting as a proxy of |TQs|. |RS| supports |TQ| proxy in either of the above modes. It is not possible to enable both modes within the same |TR|. However, you can create multiple |TRs|/|ATRs| with different |TQ| proxy modes. You can enable a |TQ| proxy with the ```` tag available under the |TR| configuration (see :ref:`section-Config-Route`) and |ATR| configuration (see :ref:`section-Config-AutoRoute`). The following sections describe the |RS| proxy modes. :numref:`FigureTopicQueryLegend` summarizes the symbols you will see in the figures that illustrate the modes’ behaviors. .. figure:: ../static/RouterTopicQueryLegend.svg :figwidth: 40% :alt: Symbol Legend for Proxy Modes Figures :name: FigureTopicQueryLegend :align: center Symbol Legend for Proxy Modes Figures .. _section-TopicQuerySupport-Dispatch: Dispatch Mode ============= *Dispatch mode* refers to enabling |TQ| dispatch in a TRANSIENT_LOCAL |TR|'s |DW|. This is done by configuring its TopicQueryDispatchQosPolicy. It no different than enabling a |TQ| for a |DW| in a user application. :numref:`FigureTopicQueryDispatch` shows a simple scenario. A |TQ| (TQ\ :sub:`n`) issued by a user |DR| (DR\ :sub:`n`) will be received by the |TR|'s |SW|. The |SW| will process the |TQ| and dispatch it, providing the corresponding samples from the available history in the |SW|. As a result, the user |DR| will receive live samples (S\ :sub:`Live`) and |TQ| samples (S\ :sub:`TQ`). .. figure:: ../static/RouterTopicQueryDispatch.svg :figwidth: 80% :alt: |TR| Enabling |TQ| Proxy in Dispatch Mode :name: FigureTopicQueryDispatch :align: center |TR| Enabling |TQ| Proxy in Dispatch Mode Dispatch mode can be useful when the user |DW| on the publication side is part of an application with low-resources requirements, such as low power consumption and small memory capacity. In this case, a |RS| instance connected to the application can cache a set of data published by the user |DW| and dispatch the |TQs| issued by user |DRs|. To enable |TQ| proxy dispatch mode, use the following configuration tags within a |TR|/|ATR| configuration: .. code-block:: xml DISPATCH The above configuration will cause the Durability QoS setting for the |TR|'s output |DW| to be TRANSIENT_LOCAL and will enable |TQ| dispatch. If you want to configure advanced dispatch features, you can set other options in the TopicQueryDispatchQosPolicy within the corresponding |DW| QoS tag. .. _section-TopicQuerySupport-Propagation: Propagation Mode ================ *Propagation mode* refers to having |RS| act as a proxy of |TQs|. The |TRs| propagate the |TQs| issued by the matching user |DRs| to the matching user |DWs|. Then the samples generated for both the |TQ| and live stream are \'propagated\' to the original user |DRs|. :numref:`FigureTopicQueryPropagation` shows a simple scenario. .. figure:: ../static/RouterTopicQueryPropagation.svg :figwidth: 80% :alt: |TR| Enabling |TQ| Proxy in Dispatch Mode :name: FigureTopicQueryPropagation :align: center |TR| Enabling |TQ| Proxy in Propagation Mode The |TR| propagates the |TQ| requests from user |DRs| on the subscription side to the user |DWs| on the publication side. User |DWs| eventually dispatch the |TQ| requests and generate samples for the |TQ| stream. The samples for a specific |TQ| are routed to the corresponding original user |DR| that issued such |TQ|. For a given |TR|, the propagation of |TQ| requests and samples for both the |TQ| and live stream occurs sequentially. The expected traffic pattern consists of |TQ| requests, |TQ| samples, and live samples interleaved. |TQ| propagation is also compatible with filter propagation (see :ref:`section-filters`). You can enable both at the same time and expect live samples to be filtered accordingly, and |TQ| samples to be unaffected by the filters. To enable |TQ| proxy dispatch mode, you can use the following configuration tags within a |TR|/|ATR| configuration: .. code-block:: xml PROPAGATION Note that the above configuration will cause the |TR|'s output |DW| durability QoS setting to be VOLATILE. Restrictions ============ |TQ| proxy in PROPAGATION mode cannot be enabled when: - Using |ROUTEs| or |ARs|, since they are meant to work with other adapters different than the builtin DDS one. - A transformation is present in the |TR|'s output. - The |TR| has a custom processor.