我创建了一个 spring 集成应用程序并将其托管在 PCF(Pivotal Cloud Foundry)环境中。
假设我的清单文件如下:
applications:
- name: test
memory: 1024M
instances: 1
domain: cfapps.pcf1.vc1.pcf.abc.com
path: target/test-0.1.0.jar
health-check-type: http
health-check-http-endpoint: /health
env:
SPRING_LOG_LEVEL:INFO
param1: value1
param2: value2
param3: value3
而我的 application.yml 文件如下:
# default properties
logging:
level:
org.springframework.integration: $SPRING_LOG_LEVEL
endpoints:
autoconfig.sensitive: false
configprops.sensitive: false
env.sensitive: false
loggers.sensitive: false
mq:
queues:
validation: queue1
authorization: queue2
channel: channel1
hostName: host1
port: 100
queueManager: QMGR
transportType: 1
max-concurrent-consumers: $param1
concurrent-consumers: $param2
max-messages-per-task: $param3
idle-consumer-limit: 1
idle-task-execution-limit: 1
我的问题是如何访问应用程序 .yml 或 spring 集成 xml 文件中的 MANIFEST .yml 文件中存在的 PCF 环境值,例如 SPRING_LOG_LEVEL、param1、param2 和 param3 值。
如果您需要更多详细信息,请告诉我。如果我是 PCF 的新手,有什么不清楚的地方,请原谅。