fix: publish under the standard kebab component token + envelope-projection stance - #5
Merged
Merged
Conversation
…ection stance The adapter published under `MtconnectAdapter`: with no `component.token` set, the library falls back to the short form of the Greengrass component name (`com.mbreissi.edgecommons.MtconnectAdapter`), which is PascalCase. Every doc in this repo already said `mtconnect-adapter`, and the sibling reference adapters (opcua-adapter, modbus-adapter) set `component.token` explicitly for exactly this reason. Set it here too, in every configuration surface: both test-configs, the Greengrass recipe, and the Kubernetes ConfigMap. Documentation follows the now-true token: the README quick start (its config, its captured topics, and its envelope example), the sample configurations, and the configuration/messaging references, which now also say where the token comes from and that the Greengrass component name never reaches the wire. Also adopts the envelope JSON-projection stance atop the messaging reference's envelope section, matching the core southbound contract.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
A default run of this adapter published under
MtconnectAdapter:while every document in this repository — the messaging reference, the tutorial, the metrics
reference, the how-to guides — says
mtconnect-adapter.Why
libs/rust/src/config/identity.rsresolves the UNS component token ascomponent.tokenwhenconfigured, otherwise the short form of the component name (the segment after the last
.).This adapter passes the Greengrass component name
com.mbreissi.edgecommons.MtconnectAdapter, sothe fallback yields PascalCase. No configuration here set
component.token.The standard is lower-kebab on the wire — the canonical config schema pins
component.tokento^[a-z0-9]+(?:-[a-z0-9]+)*$and describes it as "First-party EdgeCommonscomponents use lower-kebab tokens (for example,
opcua-adapter) while their Greengrass componentnames use the
com.mbreissi.edgecommons.<Name>pattern." The reference adapters follow it:opcua-adapterandmodbus-adaptersetcomponent.tokenin every configuration they ship.The fix
Same mechanism as the siblings —
component.token, no code change — applied to every configurationsurface this component ships:
test-configs/config.json,test-configs/mtconnect.json,k8s/configmap.yaml, andrecipe.yaml(the Greengrass default configuration).Documentation follows the now-true token: the README quick start (its config, its captured topics,
and its envelope example), the four sample configurations, and the configuration and messaging
references — which now also record where the token comes from, and that the Greengrass component
name never appears on the wire.
Envelope JSON-projection stance
The messaging reference's envelope section now opens with the canonical stance: the envelope is
documented in its JSON projection — the canonical field names and shapes; the MQTT/IPC wire encoding
is the protobuf envelope (
proto/edgecommons/v1), which round-trips this projection exactly.Validation
cargo test— 362 tests, all green.Live run against EMQX on
localhost:1883(--platform HOST --transport MQTT,-c FILE ./test-configs/config.json -t demo-thing), subscriber onecv1/#:The protobuf payloads carry the matching
identity:pathfactory-1/demo-thing,componentmtconnect-adapter,instancedevice-1.