reta commented on code in PR #1346:
URL: https://github.com/apache/cxf/pull/1346#discussion_r1288426888


##########
integration/spring-boot/autoconfigure/src/main/java/org/apache/cxf/spring/boot/autoconfigure/micrometer/MicrometerObservationAutoConfiguration.java:
##########
@@ -0,0 +1,58 @@
+/**
+ * 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.cxf.spring.boot.autoconfigure.micrometer;
+
+import org.apache.cxf.tracing.micrometer.MessageInObservationConvention;
+import org.apache.cxf.tracing.micrometer.MessageOutObservationConvention;
+import org.apache.cxf.tracing.micrometer.ObservationClientFeature;
+import org.apache.cxf.tracing.micrometer.ObservationFeature;
+import org.springframework.beans.factory.ObjectProvider;
+import 
org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import 
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import io.micrometer.observation.ObservationRegistry;
+
+@Configuration
+@AutoConfigureAfter(ObservationAutoConfiguration.class)
+@ConditionalOnClass({ ObservationRegistry.class, ObservationFeature.class })
+@ConditionalOnProperty(name = "cxf.observation.enabled", matchIfMissing = true)
+@ConditionalOnBean(ObservationRegistry.class)
+public class MicrometerObservationAutoConfiguration {

Review Comment:
   Correct, that is why I was suggesting to have pre-created all needed beans 
(guarded by @ConditionalOnMissingBean, `ObservationRegistry` falls into this 
category) in this auto configuration (if there are chances in may not be 
present. But you think it is redundant, the configuration could be removed.



-- 
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]

Reply via email to