title: Looking for a way to override application.properties values during application runtime
body: <p>I have written a small application to publish messages to IBM MQ using Spring boot.I have following properties in my applications.properties. Code is working when I input a destination queue name and the message without any issue, Now I want to input the queue manager name and based on the queue manager name ibm.mq.QueueManager,ibm.mq.connName should be changed. Appreciate if someone give me a suggestion. Do I need to come up with a separate method with a MQ connection initiation?</p>
  <pre><code>ibm.mq.QueueManager=KAU.TST
  ibm.mq.channel=KAU.CONN
  ibm.mq.connName=192.168.1.26(1540)
  ibm.mq.user=
  ibm.mq.password=
  </code></pre>
  <p>I have included following setter in my controller class, but it seems it does not overriding the property file as I intended.</p>
  <pre><code>    @Value(&quot;${ibm.mq.QueueManager:KAU.TST}&quot;)
      String destQM;
  
  
      public void setQueueManager(String destQM) {
          this.destQM= destQM;
      }
  
  </code></pre>
  <p>current method of publishing messages</p>
  <pre><code>    @Autowired
      private JmsTemplate jmsTemplate;
      public String dropmessage()
      {
          
            try{
                //String msg=&quot;IBM MQ integration testing with spring boot&quot;;
                jmsTemplate.convertAndSend(qname, msg);
                System.out.println(&quot;Message Sent :&quot;+msg);
                return &quot;OK&quot;;
            }catch(JmsException ex){
                ex.printStackTrace();
                return &quot;FAIL&quot;;
            }     
          
      }
  </code></pre>