oscerd commented on code in PR #26733: URL: https://github.com/apache/camel/pull/26733#discussion_r4080055166
########## components/camel-debezium/camel-debezium-common/camel-debezium-common-component/src/main/java/org/apache/camel/component/debezium/DebeziumConsumerHealthCheck.java: ########## @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.debezium; + +import java.util.Map; + +import org.apache.camel.health.HealthCheck; +import org.apache.camel.health.HealthCheckResultBuilder; +import org.apache.camel.util.URISupport; + +/** + * {@link HealthCheck} reporting the state of the embedded Debezium engine that backs a {@link DebeziumConsumer}. + * <p> + * The engine runs on its own thread and does not restart itself, so once it has stopped with an error the route no + * longer receives change events even though it is still started. This check turns the route DOWN in that case. + */ +public class DebeziumConsumerHealthCheck implements HealthCheck { + + private final DebeziumConsumer consumer; + private final String id; + private final String sanitizedUri; + private boolean enabled = true; Review Comment: Follow-up filed as [CAMEL-24919](https://issues.apache.org/jira/browse/CAMEL-24919) (Improvement, unassigned) so the readiness idea is not lost: flip a ready flag from `DebeziumEngine.ConnectorCallback.pollingStarted()`, then the `failure == null` branch can honour `initialState` the way `ScheduledPollConsumerHealthCheck` does. Matters most for the connectors whose initial snapshot takes minutes. _Claude Code on behalf of oscerd_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
