简体   繁体   English

启动时如何将System.getProperty(“ skipIndexing”)值传递给Java Server?

[英]How to pass System.getProperty(“skipIndexing”) value to a Java Server while starting?

We are using Mule Server but this question is generally for all server. 我们正在使用Mule Server,但此问题通常适用于所有服务器。

In constructor we have following property named skipindexing. 在构造函数中,我们具有以下名为skipindexing的属性。

if (!Boolean.parseBoolean(System.getProperty("skipIndexing"))) {
            //searchIndexer.doIndexing(propertyIndexing, threadsToLoadObjects, threadsForSubsequentFetching);
         }

Every time i need to comment this code to run on server because i do not know how to pass this skipIndexing property on runtime. 每次我需要注释此代码以在服务器上运行时,因为我不知道如何在运行时传递此skipIndexing属性。

Could anyone suggest how to pass this value as false? 谁能建议如何将此值传递为false?

mule/conf/wrapper.conf设置属性

I am not sure what you mean by pass it to server, but setting that system property "skipIndex" could be set on the command line of your app by adding it with the -D flag as 我不确定将其传递给服务器的意思,但是可以通过在应用程序的命令行中添加-D标志,将其设置为系统属性“ skipIndex”

java -DskipIndexing=true -jar ....

HTH, Gal HTH,Gal

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM