The configurable service is a readily available to keep data that an integration message flow may need at runtime.
1.Create a User Defined Configurable Service using the web console and populate it.
2. The UserDefined Configurable Cervice properties can only be accessed using a JavaCompute node.
Import com.ibm.broker.config.proxy.* in your code.
import com.ibm.broker.config.proxy.*;
BrokerProxy b = BrokerProxy.getLocalInstance();
while(!b.hasBeenPopulatedByBroker())
{
Thread.sleep(100);
}
ConfigurableService vendorUDCS = b.getConfigurableService("UserDefined", "MyConfigService");
String vendorMQDetails = vendorUDCS.getProperties().getProperty("server");
This method below will return an instance of the BrokerProxy object for the integration node to which the message flow is deployed.
BrokerProxy b = BrokerProxy.getLocalInstance();
To ensure that the BrokerProxy object has been populated with data from the broker
before we access the configurable service, Add the following code:
while(!b.hasBeenPopulatedByBroker()) {
Thread.sleep(100);
}
The statement below will return a User Defined Configurable service called 'MyConfigService'
ConfigurableService vendorUDCS = b.getConfigurableService("UserDefined", "MyConfigService");
You maybe interested in this post:
Accessing a User Defined Configurable Service in Java