Removed unbufferedMsg references from motorq example#8
Removed unbufferedMsg references from motorq example#8zakharenkodmytro merged 10 commits intomainfrom
Conversation
zakharenkodmytro
commented
Jun 11, 2025
- removed unbufferedMsg references from motorq example
- removed ConvertToCloudEvent since we assume that all messages will come as CE
- removed ConvertToCloudEvent since we assume that all messages will come as CE
| } | ||
|
|
||
| // mapDataToSignals maps the data from the message to the default DIS signals | ||
| func mapDataToSignals(data models.Data, ts time.Time) ([]*defaultmodule.Signal, error) { |
There was a problem hiding this comment.
Im still leaving that function in case if we want to validate if vssNaming exists and correct from payload we received from kafka
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…cer' into cloud_event_no_subject_and_producer
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
JamesReate
left a comment
There was a problem hiding this comment.
Discussed that this still needs code to set the source, produce and subject based on settings and information from db.
…cer' into cloud_event_no_subject_and_producer
There was a problem hiding this comment.
Pull Request Overview
This PR removes all references to unbuffered messages and the ConvertToCloudEvent flag from the motorq example, updating tests and service logic to assume incoming messages are already in CloudEvent format. Key changes include replacing unbufferedMsg variables with a valid CloudEvent message in tests, removing the ConvertToCloudEvent conditional logic in the service, and cleaning up unused types and tests.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/service/oracle_test.go | Updated test data to use valid CloudEvent messages and removed ConvertToCloudEvent usage. |
| internal/service/oracle.go | Simplified event handling logic by eliminating deprecated conversion paths. |
| internal/models/models.go | Removed the UnbufferedMessageValue type no longer needed. |
| internal/convert/convert_test.go | Deleted obsolete tests related to unbuffered message conversion. |
| internal/convert/convert.go | Refactored conversion functions to only set CloudEvent fields and validate signals. |
| internal/config/settings.go | Removed the ConvertToCloudEvent setting to reflect the new assumptions. |
| go.mod | Removed the unused dependency. |
Comments suppressed due to low confidence (2)
internal/service/oracle_test.go:27
- Verify that the updated VIN value is intentional and that it aligns with expectations for test data consistency.
const vin = "1GGCM82633A123456"
internal/convert/convert.go:16
- Consider updating the function comment to clarify that SetProducerAndSubject only sets CloudEvent fields and always returns nil, to better inform readers of its intended usage.
func SetProducerAndSubject(veh dbmodels.Vin, ce *cloudevent.CloudEvent[json.RawMessage], settings config.Settings) error {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
JamesReate
left a comment
There was a problem hiding this comment.
let's get the linter to pass and then good to merge