I have an application.yml
file which contains a broker-url
parameter
artemis:
broker-url: "tcp://localhost:61616?consumerWindowSize=1048576&ha=true&retryInterval=100&retryIntervalMultiplier=1.5&maxRetryInterval=60000&reconnectAttempts=10000"
My question is how can I separate tcp://localhost:61616
part from ?consumerWindowSize=1048576&ha=true&retryInterval=100&retryIntervalMultiplier=1.5&maxRetryInterval=60000&reconnectAttempts=10000"
Update NO. 1 my project layout
Update NO. 2
So, what I was after was something like this
ActiveMQJMSConnectionFactory f =
new ActiveMQJMSConnectionFactory(brokerUrl + ":" +brokerPort + brokerParams);
and that I have achieved by changing my application.yml
like this
artemis:
broker-url: "tcp://localhost"
broker-port: "61616"
broker-params: "?consumerWindowSize=1048576&ha=true&retryInterval=100"
NOTES: I'm using spring boot 2.4.0
And now I can call my jar artifact like this
java myjar.jar --broker-params="?consumerWindowSize=1048576" --broker-port="1111" --broker-url="tcp://192.168.1.2"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…