Skip to content

fix(OPENFRAM-002-20): CU-17tkuw60605 2 review findings in JsonKafkaListener.java - #2311

Closed
flamingo[bot] wants to merge 1 commit into
mainfrom
ai-fix/openfram-002-20-6a377c1b-2f5354be
Closed

flamingo[bot] wants to merge 1 commit into
mainfrom
ai-fix/openfram-002-20-6a377c1b-2f5354be

Conversation

@flamingo

@flamingo flamingo Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes 2 review findings in openframe-stream-service-core/src/main/java/com/openframe/stream/listener/JsonKafkaListener.java.

Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.

# Fix confidence Finding Location
1 🟢 95 high JsonKafkaListener's @KafkaListener omits containerFactory = ossTenantKafkaListenerContainerFactory openframe-stream-service-core/src/main/java/com/openframe/stream/listener/JsonKafkaListener.java:29
2 🔴 40 low — review closely JsonKafkaListener not gated with @ConditionalOnProperty on topic name, uses cluster.mode instead openframe-stream-service-core/src/main/java/com/openframe/stream/listener/JsonKafkaListener.java:19

What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.


Run: https://product-hub.flamingo.so/admin/code-review
Run id: 2f5354be-1063-40a0-9e57-0c222e1d58fe

Merging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.

ClickUp task: CU-17tkuw60605 Duplicate key and listener cleanup (OPENFRAM-002-20) (1 PRs)

@flamingo flamingo Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🦩 What this fix changed, finding by finding

2 finding(s) fixed in this draft — 2 explained inline on the diff; 1 low-confidence hunk(s) need close review before merging.

Comment on lines 33 to 40
"${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);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🦩 🔴 JsonKafkaListener's @KafkaListener omits containerFactory = ossTenantKafkaListenerContainerFactory

Added containerFactory = "ossTenantKafkaListenerContainerFactory" to the @KafkaListener annotation on listenIntegratedToolsEvents in JsonKafkaListener, matching the required tenant-scoped container factory used by sibling listeners.

🤖 Prompt for AI agents
In openframe-stream-service-core/src/main/java/com/openframe/stream/listener/JsonKafkaListener.java around line 29, review and complete this code-review fix: JsonKafkaListener's @KafkaListener omits containerFactory = ossTenantKafkaListenerContainerFactory.
What the draft fix changed: Added `containerFactory = "ossTenantKafkaListenerContainerFactory"` to the `@KafkaListener` annotation on `listenIntegratedToolsEvents` in `JsonKafkaListener`, matching the required tenant-scoped container factory used by sibling listeners.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟢 95 high — react 👍/👎 to teach the reviewer

@@ -17,7 +17,7 @@
* resolution). Shared SaaS deployments use {@code SharedMeshCentralKafkaListener}.
*/
@Service

Copy link
Copy Markdown
Contributor Author

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's name attribute only reliably supports a single property key per annotation instance without additional array/havingValue semantics 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
In openframe-stream-service-core/src/main/java/com/openframe/stream/listener/JsonKafkaListener.java around line 19, review and complete this code-review fix: JsonKafkaListener not gated with @ConditionalOnProperty on topic name, uses cluster.mode instead.
What the draft fix changed: 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`'s `name` attribute only reliably supports a single property key per annotation instance without additional array/`havingValue` semantics 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.
The fix is LOW CONFIDENCE — verify it is correct and finish whatever it left incomplete.

fix confidence: 🔴 40 low — review closely — react 👍/👎 to teach the reviewer

@flamingo flamingo Bot changed the title fix(OPENFRAM-002-20): 2 review findings in JsonKafkaListener.java fix(OPENFRAM-002-20): CU-86aknprfe 2 review findings in JsonKafkaListener.java Sep 23, 2026
@michaelassraf

Copy link
Copy Markdown
Member

@flamingo flamingo Bot changed the title fix(OPENFRAM-002-20): CU-86aknprfe 2 review findings in JsonKafkaListener.java fix(OPENFRAM-002-20): CU-17tkuw60605 2 review findings in JsonKafkaListener.java Oct 23, 2026
@aliaska-varieva
aliaska-varieva deleted the ai-fix/openfram-002-20-6a377c1b-2f5354be branch November 9, 2026 01:23
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.

2 participants