gemmellr commented on code in PR #4297: URL: https://github.com/apache/activemq-artemis/pull/4297#discussion_r1198813400
########## artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/Main.java: ########## @@ -0,0 +1,148 @@ +/* + * 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.activemq.artemis.core.server.embedded; + +import java.io.File; +import java.lang.invoke.MethodHandles; +import java.util.concurrent.CountDownLatch; + +import org.apache.activemq.artemis.core.config.FileDeploymentManager; +import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl; +import org.apache.activemq.artemis.core.config.impl.FileConfiguration; +import org.apache.activemq.artemis.core.config.impl.LegacyJMSConfiguration; +import org.apache.activemq.artemis.core.server.ActivateCallback; +import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Main { + + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + private static String workDir = "/app"; + private static volatile EmbeddedActiveMQ embeddedServer; + + public static void main(String[] args) throws Exception { + + if (args.length == 1) { + workDir = args[0]; + logger.debug("User supplied work dir {}", workDir); + } + + String propertiesConfigPath = "/config/," + workDir + "/etc/"; + if (args.length == 2) { + propertiesConfigPath = args[1]; + logger.debug("User supplied properties config path {}", propertiesConfigPath); + } + + FileConfiguration configuration = new FileConfiguration(); + + String dataDir = workDir + "/data"; + configureDataDirectory(configuration, dataDir); + + File bringYourOwnXml = new File(workDir + "/etc/broker.xml"); + if (bringYourOwnXml.exists()) { + logger.debug("byo config found {}", bringYourOwnXml); + configuration = loadFromXmlFile(bringYourOwnXml, configuration); + } Review Comment: I think that would stance be fine if it were at all obvious the disparity was there, and what the default behaviour in any case actually was, and there were jsut a few settings someone had to look into. It really isnt obvious its there, or what the default is, and there are lots of settings, people will likely not know to configure (or wont bother if they do). I know thatI couldnt could tell you what the behaviour of a lot of these things is just now in a given situation. I'm pretty sure many a regular user couldnt either. If only because the properties themselves also arent even documented yet, though there is an open PR for that...which I recall also commenting on saying that it really didnt make the defaults behaviours very clear, listing default values that often wouldnt be the effective default. At the very least it feels like this 'different behaviours'..behaviour...should be documented in the readme and byoc example, to clearly convey the general disparities that will occur. I think a user will be quite surprised that a new broker from the CLI and a new broker from this image behave differently out the box in any way except the auth stuff that the behaviour is stated for. -- 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]
