JinyuChen97 commented on code in PR #511: URL: https://github.com/apache/camel-quarkus-examples/pull/511#discussion_r3343137767
########## amq-broker-keycloak/src/main/resources/application.properties: ########## @@ -0,0 +1,70 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- + +# Camel +camel.context.name = amq-broker-keycloak-example + +# AMQ Artemis (dev services auto-start) +%prod.quarkus.artemis.url=tcp://localhost:61616 +%prod.quarkus.artemis.username=admin +%prod.quarkus.artemis.password=admin + +# Production HTTP port +%prod.quarkus.http.port=8081 + +# Keycloak OIDC +%prod.quarkus.oidc.auth-server-url=http://localhost:8082/realms/quarkus +quarkus.oidc.client-id=quarkus-client +quarkus.oidc.application-type=service + +# Keycloak Dev Services +quarkus.keycloak.devservices.port=8082 +quarkus.keycloak.devservices.users.customer=customer-pass +quarkus.keycloak.devservices.roles.customer=customer-role +quarkus.keycloak.devservices.users.admin=admin-pass +quarkus.keycloak.devservices.roles.admin=admin-role + +# HTTP Security - REST endpoints protected by Quarkus OIDC +quarkus.http.auth.permission.customer.paths=/api/orders/* +quarkus.http.auth.permission.customer.policy=authenticated +quarkus.http.auth.permission.admin.paths=/api/admin/* +quarkus.http.auth.permission.admin.policy=admin-policy +quarkus.http.auth.policy.admin-policy.roles-allowed=admin-role + +# Keycloak Component Configuration (for Camel Keycloak component) +camel.component.keycloak.server-url=http://localhost:8082 +camel.component.keycloak.realm=quarkus +camel.component.keycloak.client-id=quarkus-client +camel.component.keycloak.client-secret=${QUARKUS_OIDC_CREDENTIALS_SECRET:secret} + +# CXF SOAP +quarkus.cxf.path=/services +soap.inventory.client.address=http://localhost:8081/services/inventory + +# Kubernetes +quarkus.kubernetes.env.secrets=quarkus-keycloak + +# Dev Configuration +%dev.quarkus.artemis.devservices.enabled=true +%dev.soap.inventory.client.address=http://localhost:8080/services/inventory + +# Test Configuration +%test.quarkus.artemis.devservices.enabled=true +%test.soap.inventory.client.address=http://localhost:8081/services/inventory + +# Native Configuration +quarkus.native.additional-build-args=--initialize-at-run-time=org.springframework.jms.listener.AbstractMessageListenerContainer$ObservationFactory Review Comment: After investigation by using quarkus.native.additional-build-args=-H:+PrintClassInitialization, This issue seems triggered by the cxf-soap + jms combination in native mode. During native image build, Quarkus's JaxbProcessor scans @XmlRootElement annotations on Camel route definitions. because of CXF is there, this creates a deep reference chain: CxfEndpoint → JmsEndpoint → AbstractMessageListenerContainer → ObservationFactory (inner class). GraalVM then initializes ObservationFactory at build-time, execute it's static block which requires DefaultJmsProcessObservationConvention from micrometer-jakarta9. JMS integration tests don't have this issue because they don't use CXF. Without CXF, the scanning is shallow and ObservationFactory is not included. I also verified this by adding cxf-soap dependency to the jms-jpa example, and it reproduced the same error. Please correct if im wrong. and also Is this kind of issue caused by combination need to be fixed in camel quarkus project? or need to mentioned somewhere? -- 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]
