Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate TimDepositController to use Spring Kafka #139

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

dmccoystephenson
Copy link
Member

@dmccoystephenson dmccoystephenson commented Dec 30, 2024

PR Details

Description

The TimDepositController class has been modified to use the KafkaTemplate class instead of the KafkaConsumer class.

Related Issue

No related GitHub issue.

Motivation and Context

Implementing Spring Kafka gives us better lifecycle management of producers and consumers, more reusable producer/consumer code, easier testability, and a more robust production-ready Kafka library. This is part of a more significant effort to replace our hand-rolled Kafka implementation with Spring Kafka. The previous changesets related to this effort are #118, #116, #123, #129, #131 and #134.

How Has This Been Tested?

  • Unit tests have been updated and verified to pass.
  • Depositing a TIM through the /tim endpoint has been verified to work as expected and the following topics were produced to: topic.OdeTimBroadcastJson, topic.J2735TimBroadcastJson, topic.OdeTimJson, topic.Asn1EncoderInput

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
    ODE Contributing Guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@dmccoystephenson dmccoystephenson marked this pull request as ready for review December 30, 2024 01:57
Copy link

@mcook42 mcook42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look good. Without any tests to confirm the swap to KafkaTemplate from MessageProducer didn't change the values produced I'm not comfortable calling these changes tested. Please add some tests to confirm that we are interacting with Kafka as intended. Some helpful examples to use as a guide are https://github.com/CDOT-CV/jpo-ode/blob/dev/jpo-ode-svcs/src/test/java/us/dot/its/jpo/ode/udp/tim/TimReceiverTest.java and https://github.com/CDOT-CV/jpo-ode/blob/dev/jpo-ode-svcs/src/test/java/us/dot/its/jpo/ode/kafka/listeners/Asn1DecodedDataRouterTest.java

@dmccoystephenson dmccoystephenson marked this pull request as draft January 2, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants