Repository navigation
fix(OPENFRAM-002-20): CU-17tkuw60605 2 review findings in JsonKafkaListener.java #2311
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |
| * resolution). Shared SaaS deployments use {@code SharedMeshCentralKafkaListener}. | ||
| */ | ||
| @Service | ||
| @ConditionalOnProperty(name = "openframe.cluster.mode", havingValue = "tenant", matchIfMissing = true) | ||
| @ConditionalOnProperty(name = "openframe.oss-tenant.kafka.topics.inbound.meshcentral-events.name") | ||
| public class JsonKafkaListener { | ||
|
|
||
| private final GenericJsonMessageProcessor messageProcessor; | ||
|
|
@@ -33,7 +33,8 @@ public JsonKafkaListener(GenericJsonMessageProcessor messageProcessor) { | |
| "${openframe.oss-tenant.kafka.topics.inbound.fleet-mdm-query-result-events.name}", | ||
| "${openframe.oss-tenant.kafka.topics.inbound.fleet-mdm-policy-membership-events.name}" | ||
| }, | ||
| groupId = "${spring.oss-tenant.kafka.consumer.group-id}" | ||
| groupId = "${spring.oss-tenant.kafka.consumer.group-id}", | ||
| containerFactory = "ossTenantKafkaListenerContainerFactory" | ||
| ) | ||
| public void listenIntegratedToolsEvents(@Payload CommonDebeziumMessage debeziumMessage, @Header(KafkaHeader.MESSAGE_TYPE_HEADER) MessageType messageType) { | ||
| messageProcessor.process(debeziumMessage, messageType); | ||
|
Comment on lines
33
to
40
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π΄ JsonKafkaListener's @KafkaListener omits containerFactory = ossTenantKafkaListenerContainerFactory Added π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
𦩠π΄ JsonKafkaListener not gated with @ConditionalOnProperty on topic name, uses cluster.mode instead
Replaced the class-level
@ConditionalOnProperty(name = "openframe.cluster.mode", havingValue = "tenant", matchIfMissing = true)with@ConditionalOnProperty(name = "openframe.oss-tenant.kafka.topics.inbound.meshcentral-events.name")to gate on a topic-name property per the rule. This only guards against the first of the four inbound topic properties being unset; the other three (fleet-mdm-events,fleet-mdm-query-result-events,fleet-mdm-policy-membership-events) are not covered because@ConditionalOnProperty'snameattribute only reliably supports a single property key per annotation instance without additional array/havingValuesemantics matching all four independently. A complete fix would require either verifying all four properties are always set together (documenting that assumption), or restructuring into separate listener methods/classes each individually gated by its own topic property β this could not be done without altering the class's public shape beyond a minimal fix, so it is flagged as low confidence and risk.π€ Prompt for AI agents
fix confidence: π΄ 40 low β review closely β react π/π to teach the reviewer