flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raikarsunil <rsunil...@gmail.com>
Subject Re: Flink Run command :Replace placeholder value in spring xml
Date Wed, 18 Jan 2017 06:40:54 GMT
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





--
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-tp11109p11124.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.

Mime
View raw message