Skip to content

Commit

Permalink
refactor: App Services refactor - Phase 2 (#1260)
Browse files Browse the repository at this point in the history
Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>
  • Loading branch information
Lenny Goodell authored Oct 24, 2023
1 parent cd33931 commit 53f5789
Show file tree
Hide file tree
Showing 34 changed files with 752 additions and 722 deletions.
6 changes: 3 additions & 3 deletions docs_src/getting-started/tools/Ch-GUI.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ When the application service is a configurable app service and is known to the G

There are four tabs in the Configurable Setting editor:

- [Trigger](../../microservices/application/sdk/details/Triggers.md) which defines how the configurable app service begins execution
- [Trigger](../../microservices/application/details/Triggers.md) which defines how the configurable app service begins execution
- [Pipeline Functions](../../microservices/application/sdk/api/BuiltInPipelineFunctions.md) defining which functions are part of the configurable app service pipeline and in which order should they be executed
- [Insecure Secrets](../../microservices/application/sdk/details/AdvancedTopics.md#secrets) - setting up secrets used by the configurable app service when running in non-secure mode (meaning Vault is not used to provide the secrets)
- [Store and Forward](../../microservices/application/sdk/details/AdvancedTopics.md#store-and-forward) which enables and configures the batch store and forward export capability
- [Insecure Secrets](../../microservices/application/sdk/details/Secrets.md) - setting up secrets used by the configurable app service when running in non-secure mode (meaning Vault is not used to provide the secrets)
- [Store and Forward](../../microservices/application/sdk/details/StoreAndForward.md) which enables and configures the batch store and forward export capability

!!! Note
When the Trigger is changed, the service must be restarted for the change to take effect.
Expand Down
2 changes: 1 addition & 1 deletion docs_src/microservices/application/ApiReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ title: App Services - API Reference

The following REST APIs are provided by the App SDK and are inherited by all Application Services.

<swagger-ui src="https://github.com/raw/edgexfoundry/app-functions-sdk-go/{{edgexversion}}/openapi/{{api_version}}/app-functions-sdk.yaml"/>
<swagger-ui src="https://github.com/raw/edgexfoundry/app-functions-sdk-go/{{edgexversion}}/openapi/{{api_version}}/app-functions-sdk.yaml"></swagger-ui>
4 changes: 2 additions & 2 deletions docs_src/microservices/application/ApplicationServices.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ but custom endpoints can be implemented alongside the existing functionality.
Application Services are based on the idea of "Functions Pipelines". A functions pipeline is a collection of functions
that processes messages (EdgeX event/reading messages by default) in the specified order. Triggers seed the
first function(s) in the defined pipeline(s) with the data received by the Application Service. A trigger is something like a message
landing in a watched message queue. The most commonly used Trigger is the MessageBus Trigger. See the [Triggers](sdk/details/Triggers.md) section for more details
landing in a watched message queue. The most commonly used Trigger is the MessageBus Trigger. See the [Triggers](details/Triggers.md) section for more details

![image](TriggersFunctions.png)

Expand Down Expand Up @@ -59,7 +59,7 @@ There are three primary triggers that have been included in the SDK that initiat
2. EdgeX MessageBus Trigger with connection details as specified in the configuration.
3. External MQTT Trigger with connection details as specified in the configuration.

See the [Triggers](sdk/details/Triggers.md) section for full details on the available triggers.
See the [Triggers](details/Triggers.md) section for full details on the available triggers.

Finally, data may be sent back to the Trigger response by calling `.SetResponseData()` on the context.

Expand Down
31 changes: 21 additions & 10 deletions docs_src/microservices/application/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ Similar to other EdgeX services, application service configuration is first dete

This section describes the configuration elements provided by the SDK that are unique to Application Services

Please first refer to the general [Configuration documentation](../../configuration/CommonConfiguration) for configuration properties common across all EdgeX services.
Please first refer to the general [Configuration documentation](../configuration/CommonConfiguration.md) for configuration properties common across all EdgeX services.

!!! edgey "EdgeX 3.1"
New in EdgeX 3.1 is URI for files which allows the private configuration file to be pulled from a remote location via a URI rather than from the local file system. See [Config File Command-line](../configuration/CommonCommandLineOptions.md#config-file) section for more details.

!!! note
`*`indicates the configuration value can be changed on the fly if using a configuration provider (like Consul).
Expand All @@ -19,7 +22,7 @@ The tabs below provide additional entries in the **Writable** section which are

=== "Writable.StoreAndForward"

The section configures the **Store and Forward** capability. Please refer to [Store and Forward](sdk/details/AdvancedTopics.md#store-and-forward) documentation for more details.
The section configures the **Store and Forward** capability. Please refer to [Store and Forward](sdk/details/StoreAndForward.md) documentation for more details.

| Configuration | Default Value | |
| :------------ | ------------- | ------------------------------------------------------------ |
Expand All @@ -45,7 +48,7 @@ The tabs below provide additional entries in the **Writable** section which are
=== "Writable.Telemetry"
|Property|<Default Value|Description|
|---|---|---|
|||See `Writable.Telemetry` at [Common Configuration](../configuration/CommonConfiguration.md/#configuration-properties) for the Telemetry configuration common to all services |
|||See `Writable.Telemetry` at [Common Configuration](../configuration/CommonConfiguration.md#common-configuration-properties) for the Telemetry configuration common to all services |
|Metrics| |Service metrics that the application service collects. Boolean value indicates if reporting of the metric is enabled. Custom metrics are also included here for custom application services that define custom metrics|
|Metrics.MessagesReceived | false |Enable/disable reporting of the built-in **MessagesReceived** metric|
|Metrics.InvalidMessagesReceived | false |Enable/disable reporting of the built-in **InvalidMessagesReceived** metric|
Expand All @@ -56,7 +59,7 @@ The tabs below provide additional entries in the **Writable** section which are
|Metrics.PipelineMessagesProcessed | false |Enable/disable reporting of the built-in **PipelineMessagesProcessed** metric|
|Metrics.PipelineProcessingErrors | false | Enable/disable reporting of the built-in **PipelineProcessingErrors** metric|
|Metrics.PipelineMessageProcessingTime | false |Enable/disable reporting of the built-in **PipelineMessageProcessingTime** metric|
|Metrics.`<CustomMetric>`| false | (Service Specific) Enable/disable reporting of custom application service's custom metric. See [Custom Application Service Metrics](sdk/details/AdvancedTopics.md/#custom-application-service-metrics) for more detail|
|Metrics.`<CustomMetric>`| false | (Service Specific) Enable/disable reporting of custom application service's custom metric. See [Custom Application Service Metrics](sdk/details/CustomServiceMetrics.md) for more detail|
|Tags|`<empty>`|List of arbitrary service level tags to included with every metric that is reported. i.e. `Gateway="my-iot-gateway"` |

### Not Writable
Expand All @@ -82,13 +85,13 @@ The tabs below provide additional configuration which are applicable to Applicat
Clients that are used from code must be present in the configuration, otherwise a nil reference will occur. `core-metadata` is already present in the common configuration, so it is not needed in the local private configuration.
=== "Trigger"

This section defines the `Trigger` for incoming data. See the [Triggers](sdk/details/Triggers.md) documentation for more details on the inner working of triggers.
This section defines the `Trigger` for incoming data. See the [Triggers](details/Triggers.md) documentation for more details on the inner working of triggers.
|Configuration | Default Value | Description |
| --- | --- | -- |
| Type | edgex-messagebus** | Indicates the `Trigger` binding type. valid values are `edgex-messagebus`, `external-mqtt`, `http`, or `<custom>` |
| SubscribeTopics | events/#** | Topic(s) to subscribe to. This is a comma separated list of topics. Supports filtering by subscribe topics. Only set when using `edgex-messagebus` or `external-mqtt`. See [EdgeXMessageBus](sdk/details/Triggers.md#edgex-message-bus) Trigger for more details. |
| PublishTopic | blank** | Indicates the topic in which to publish the function pipeline response data, if any. Supports dynamic topic places holders. Only set when using `edgex-messagebus` or `external-mqtt`. See [EdgeXMessageBus](sdk/details/Triggers.md#edgex-message-bus) Trigger for more details. |
| SubscribeTopics | events/#** | Topic(s) to subscribe to. This is a comma separated list of topics. Supports filtering by subscribe topics. Only set when using `edgex-messagebus` or `external-mqtt`. See [EdgeXMessageBus](details/Triggers.md#edgex-message-bus) Trigger for more details. |
| PublishTopic | blank** | Indicates the topic in which to publish the function pipeline response data, if any. Supports dynamic topic places holders. Only set when using `edgex-messagebus` or `external-mqtt`. See [EdgeXMessageBus](details/Triggers.md#edgex-message-bus) Trigger for more details. |

=== "Trigger ExternalMqtt"

Expand All @@ -110,10 +113,18 @@ The tabs below provide additional configuration which are applicable to Applicat
| SkipCertVerify | false** | Indicates if the certificate verification should be skipped |
| SecretPath | blank** | Name of the path in secret provider to retrieve your secrets. Must be non-blank. |
| AuthMode | blank** | Indicates what to use when connecting to the broker. Must be one of "none", "cacert" , "usernamepassword", "clientcert". <br />If a CA Cert exists in the SecretPath then it will be used for all modes except "none". |
| RetryDuration | 600 | Indicates how long (in seconds) to wait timing out on the MQTT client creation |
| RetryInterval | 5 | Indicates the time (in seconds) that will be waited between attempts to create MQTT client |
| RetryDuration | 600** | Indicates how long (in seconds) to wait timing out on the MQTT client creation |
| RetryInterval | 5** | Indicates the time (in seconds) that will be waited between attempts to create MQTT client |
| Will: Enabled | false** | Enables Last Will capability |
| Will: Topic | blank** | Topic to publish the Last Will Payload when service disconnects from MQTT Broker |
| Will: Payload | blank** | Will message to be sent to the Will Topic |
| Will: Qos | blank** | QOS level for Will Topic |
| Will: Retained | false** | Retained setting for Will Topic |

!!! note
!!! edgey "EdgeX 3.1"
Last Will capability is new in EdgeX 3.1

!!! note
`Authmode=cacert` is only needed when client authentication (e.g. `usernamepassword`) is not required, but a CA Cert is needed to validate the broker's SSL/TLS cert.

=== "Application Settings"
Expand Down
2 changes: 1 addition & 1 deletion docs_src/microservices/application/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To help accelerate the creation of your new custom Application Service the **App

## Triggers

`Triggers` are common to both `Configurable` and `Custom` Application Services. They are the next logical area to get familiar with. See the [Triggers](sdk/details/Triggers.md) section for more details.
`Triggers` are common to both `Configurable` and `Custom` Application Services. They are the next logical area to get familiar with. See the [Triggers](details/Triggers.md) section for more details.

## Configuration

Expand Down
Loading

0 comments on commit 53f5789

Please sign in to comment.