Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

@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;
Expand All @@ -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

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

Expand Down
Loading