Open
Conversation
Add a NATS publisher implementation and corresponding tests. * **config/config.go** - Add NATS configuration struct to the Config struct. - Add NATS configuration to the ConfigureProducers method. * **datastore/nats/nats.go** - Implement Producer struct for NATS. - Implement NewProducer function to initialize NATS producer. - Implement Produce method to send messages to NATS. - Implement Close method to close NATS connection. - Implement ProcessReliableAck method to handle reliable acknowledgements. - Implement ReportError method to report errors. * **datastore/nats/nats_test.go** - Implement unit tests for NewProducer function. - Implement unit tests for Produce method. - Implement unit tests for Close method. - Implement unit tests for ProcessReliableAck method. - Implement unit tests for ReportError method. * **.devcontainer/devcontainer.json** - Add devcontainer configuration for building the project. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Teslemetry/tesla-fleet-telemetry?shareId=XXXX-XXXX-XXXX-XXXX).
* Add `nats.go` dependency to `go.mod` * Add `nats.go`, `nkeys`, `nuid`, `compress`, `crypto`, `sync`, and `text` dependencies to `go.sum`
* Add import for `github.com/teslamotors/fleet-telemetry/metrics/adapter` * Add tests for error handling, metrics, and different payload types in `TestProduce` * Fix references to `metricsRegistry` fields to use exported fields * Remove unused import for `context` Update `.devcontainer/devcontainer.json` * Add "test" task with command "make test"
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.
Description
Adds NATS as a producer. This has been in use in production by Teslemetry for over a year now.
Fixes # (issue)
Type of change
Please select all options that apply to this change:
Checklist:
Confirm you have completed the following steps: