我正在创建一个自定义的SpringXD处理器。我正在尝试从SpringXD流定义中读取一些属性,并从属性文件中读取一些属性。我的模块的XML中有以下内容:
<context:property-placeholder location="classpath:config/myModule.properties" ignore-resource-not-found="true" system-properties-mode="OVERRIDE" />
<int:channel id="input"/>
<bean id="sessionProperties" class="com.mycompany.namespace.SomeConfigClassName">
<property name="hostNames" value="${hostNames}"/>
<property name="port" value="${port}"/>
</bean>
<int:transformer input-channel="input" output-channel="output">
<bean id="jmsTemplate" class="com.mycompany.namespace.ModuleClassName">
<property name="sessionProperties" ref="sessionProperties"/>
</bean>
</int:transformer>
<int:channel id="output"/>我正在定义我的流,如下所示:
stream create --name my-stream --definition "time | my-custom-module --port=1440 | log" --deploy并且我一直收到以下错误:
Command failed org.springframework.xd.rest.client.impl.SpringXDException: Error with option(s) for module my-custom-module of type processor:
port: option named 'port' is not supported这是我的属性文件的内容:
hostNames=foo.mycompany.com有什么想法吗?
发布于 2015-09-10 11:14:28
我找到了这个问题的解决方案。我将属性文件放在与模块的XML文件相同的路径中。Spring出于某种原因选择了属性文件,而忽略了XML文件。将属性文件移动到其他文件夹修复了此问题。
发布于 2017-08-07 23:04:46
尝试通过在部署流时输入以下内容来指定属性文件:
--propertiesFile myprops.properties https://stackoverflow.com/questions/32488278
复制相似问题