This Example shows how to configure the usage sharing feature of the Pipeline API. Usage sharing is a feature that allows you to share details of the requests you are processing with 51Degrees.
Usage sharing works by adding a 'ShareUsageElement' to the pipeline. This element will collect evidence values as they pass through, periodically sending them to 51Degrees for processing.
If you want to know more about usage sharing, and why you should consider using it, see the usage sharing feature page.
Usage sharing is enabled by default if using some 51Degrees pipeline builders such as the DeviceDetectionOnPremisePipelineBuilder. In this example, we show how to specifically add a usage sharing element to a Pipeline using configuration.
As with all flow elements, this can also be handled in code, using the constructor parameters. The commented section in the example demonstrates this.
The 51d.json file contains all the configuration options. These are all optional, so each can be omitted if the default for that option is sufficient:
For details of what each setting does, see the constructor parameters in the reference documentation for the share usage element
This example is available in full on GitHub.
Expected output: