Hi,
I am not able to replace value into spring place holder .Below is the xml code snippet .
Cheers,
Sunil Raikar |
Hi Sunil,
what is the content of args[0] when you execute public static void main(String[] args) { System.out.println(args[0]); } Am 17/01/17 um 14:55 schrieb raikarsunil: Hi, I am not able to replace value into spring place holder .Below is the xml code snippet .
|
Hi,
args[0]=/home/myfilepath/file.properties Thanks, Sunil
Cheers,
Sunil Raikar |
I'm not sure what you want to do with this configuration. But you should
keep in mind that all properties you set are only valid in the Flink Client that submits the job to the JobManager, you cannot access this property within a Flink Function such as MapFunction. Maybe you could show us a bit more of your code (esp. the Flink-related parts). Am 17/01/17 um 15:51 schrieb raikarsunil: > Hi, > > > args[0]=/home/myfilepath/file.properties > > Thanks, > Sunil > > > > -- > View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Flink-Run-command-Replace-placeholder-value-in-spring-xml-tp11109p11112.html > Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com. |
Hi,
Let me give a overall picture : I am using properties file which contains values(passwords,kafkahostnames,schemaName etc..) related to DB,kafka ,flink etc.. which is Environment Specific(Dev,QA,Production) . Using this properties file in spring xml ,set values to beans . <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>file:#{systemProperties['configFileName']}</value> </property> <property name="systemPropertiesModeName"> <value>SYSTEM_PROPERTIES_MODE_OVERRIDE</value> </property> </bean> <bean id="cassandraConnector" class="com.cme.clearing.pmapi.stp_data_core.datastore.connector.CassandraConnector" destroy-method="close" > <constructor-arg value="${cassandra.keyspace.name}" /> <constructor-arg value="${cassandra.username}" /> <constructor-arg value="${cassandra.password}" /> <constructor-arg value="${consul.cassandra.service.name}" /> </bean> NOTE: the ${} values are in properties file I bundle this into a jar containing a main class which takes arguments. By using System.setProperty("configFileName", args[0]) , try to set value for configFileName. By using below java command I am able to successfully run the code . java -jar my-code-1.0.0-SNAPSHOT.jar "/home/MyFileLocation/property.properties" But using below Flink command it fails. ./flink run ../../my-code-1.0.0-SNAPSHOT.jar "/home/MyFileLocation/property.properties" Thanks, Sunil
Cheers,
Sunil Raikar |
Free forum by Nabble | Edit this page |