bframke commented on issue #467: Problem: Classes that should be initialized at 
run time got initialized during image building
URL: https://github.com/apache/camel-quarkus/issues/467#issuecomment-558143692
 
 
   Yes and we configure it via the key:value map.
   
   ```
   void registerActiveMqFactories() {
           Map<String, JmsConfig> activemqConnectionFactoriesConfig = 
getJmsConfigs(_activemqConfigsAsString);
           _logger.info("activemqConnectionFactoriesConfig : {}", 
activemqConnectionFactoriesConfig);
           if (activemqConnectionFactoriesConfig != null) {
               Registry registry = _camelMain.getCamelContext().getRegistry();
               activemqConnectionFactoriesConfig.forEach((name, config) -> {
                   registry.bind(name, 
_activeMqConnectionFactoryProducer.getConnectionFactory(config));
               });
           }
       }
   
       void registerIbmMqFactories() {
           Map<String, JmsConfig> ibmmqConnectionFactoriesConfig = 
getJmsConfigs(_ibmmqConfigsAsString);
           _logger.info("ibmmqConnectionFactoriesConfig : {}", 
ibmmqConnectionFactoriesConfig);
           if (ibmmqConnectionFactoriesConfig != null) {
               Registry registry = _camelMain.getCamelContext().getRegistry();
               ibmmqConnectionFactoriesConfig.forEach((name, config) -> {
                   registry.bind(name, 
_ibmMqConnectionFactoryProducer.getConnectionFactory(config));
               });
           }
       }
   
       private Map<String,JmsConfig> getJmsConfigs(String jsonValue) {
           try {
               return _jsonMapper.readValue(jsonValue,
                       
TypeFactory.defaultInstance().constructMapLikeType(HashMap.class, String.class, 
JmsConfig.class));
           } catch (IOException e) {
               _logger.error("cannot convert config value '" + jsonValue +"'", 
e);
           }
           return null;
       }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to