Transport Filters
AMPS provides the ability for incoming commands to be modified, or filtered.
When one or more transport filters are specified, AMPS provides each incoming command to those filters as soon as the header for the message is parsed. Each filter can modify the message data or a subset of the headers, and can choose to have AMPS stop processing the command (or can request that AMPS disconnect the connection that submitted the command).
The filters for a Transport
, if any, are defined in the configuration for the transport. When more than one filter is specified, AMPS runs each filter in the order in which they appear in the configuration file.
Transport filters are implemented as extension modules. To create an extension module, contact AMPS support for the server SDK.
AMPS loads the following transport filters by default:
Module | Description |
---|---|
| Translates topic names on incoming commands. This module requires one or more of the following options: Specifies the translation to use. This option takes the following format:
original The original parameter can be a literal topic name or a PCRE regex. Any topic on any command that matches that parameter will be converted to the translated topic. For example, to convert the topic To translate any topic beginning with |
| Translates an incoming
This module can be useful for removing a conflated topic that is infrequently-used, or for which subscribers only monitor a small number of messages out of the overall topic. This module requires one or more of the following options: Specifies the translation to use. This option takes the following format:
original The interval specifies the conflation interval to apply to the translated commands if one is not provided. For example, to convert all subscriptions to the topic To convert all subscriptions to the topics |
Last updated