| <div class="wiki-content maincontent"><p>From version 5.9.0 a new broker plugin will allow selective changes to a broker xml configuration to take effect without broker restart.<br clear="none"> |
| Consider a retail environment where there are central processors (hubs) and stores(spokes). It is advantageous to be able to add a new store<br clear="none"> |
| without any down time.<br clear="none"> |
| The addition of a new store could entail a new network connector and some new authorization policies, both of which can now be modified on the fly.</p> |
| |
| <p>The plugin is configured via the broker xml configuration as follows:</p> |
| <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> |
| <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<broker xmlns="http://activemq.apache.org/schema/core" start="false" ... > |
| <plugins> |
| <runtimeConfigurationPlugin checkPeriod="1000" /> |
| </plugins> |
| ... |
| </broker> |
| ]]></script> |
| </div></div> |
| <p>Note: the start="false" attribute. It ensures that xbean-spring does not auto start the broker when the application context is loading. <br clear="none"> |
| This ensures that the plugins reference to the broker is fully initialized before it is used and the xml configuration location can be successfully resolved.</p> |
| |
| <p>The checkPeriod when > 0 is the time in milliseconds between checks for changes to the lastupdate timestamp of the broker xml configuration url.<br clear="none"> |
| If checkPeriod is 0 (default) there is no automatic check for changes but a manual check can be triggered via JMX.</p> |
| |
| <p>Configuration elements that support runtime modification</p> |
| <ul><li><networkConnectors></li><li><destinationPolicy><policyMap><policyEntries></li><li><plugins><authorizationPlugin><map><authorizationMap><authorizationEntries></li><li><destinationInterceptors><virtualDestinationInterceptor><virtualDestinations></li></ul> |
| |
| |
| |
| <p>Some more implementation detail and links to the tests can be found in <a shape="rect" class="external-link" href="https://issues.apache.org/jira/browse/AMQ-4682">AMQ-4682</a></p></div> |
| |