Author |
Message
|
kunal07 |
Posted: Thu Feb 06, 2014 6:11 am Post subject: Configurable Services |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
Hi,
My requirement is to create the user defined configurable service and pass certain values ex: HTTP URL etc to run it dynamically.
can anyone tell how to implement this requirement.
Currently i am creating one UDP and try to access it from the JCN .
please provide the better approach to do the same |
|
Back to top |
|
 |
codemonkey85 |
Posted: Thu Feb 06, 2014 7:06 am Post subject: |
|
|
 Novice
Joined: 06 Feb 2014 Posts: 11 Location: UK
|
Hi,
Here is some java that worked for me -
Code: |
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); }
//As we have defined the configurable service with type 'UserDefined'; Add following code:
ConfigurableService CS_set = b.getConfigurableService("UserDefined", "MyConfigService");
String age = CS_set.getProperties().getProperty("MyAge"); |
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Feb 06, 2014 7:07 am Post subject: Re: Configurable Services |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kunal07 wrote: |
Hi,
My requirement is to create the user defined configurable service and pass certain values ex: HTTP URL etc to run it dynamically.
can anyone tell how to implement this requirement.
Currently i am creating one UDP and try to access it from the JCN .
please provide the better approach to do the same |
How dynamic is this value?
Would mqsiapplybaroverride do?
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
codemonkey85 |
Posted: Thu Feb 06, 2014 7:09 am Post subject: |
|
|
 Novice
Joined: 06 Feb 2014 Posts: 11 Location: UK
|
Hi,
Would you not be better off storing the URL's in a table and accessing them from there? |
|
Back to top |
|
 |
zpat |
Posted: Thu Feb 06, 2014 7:24 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Once again - this is NOT a requirement - it is an option for meeting a requirement.
State the underlying functional requirement first. Then choose the best solution.
Read the infocenter. Only then ask for coding hints if stuck.
That's what I would do. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
kunal07 |
Posted: Thu Feb 06, 2014 7:35 am Post subject: |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
BrokerProxy b = BrokerProxy.getLocalInstance();
// To ensure that the BrokerProxy object has been populated with
// data from the broker before we access the configurable
while (!b.hasBeenPopulatedByBroker()) {
Thread.sleep(100); }
// As we have defined the configurable service with type
// 'UserDefined'; Add following code:
configurationSrvArr = b.getConfigurableServices("UserDefined");
i am using this code and values get stored im configurationSrvArr.
but not able to use .
can anyone tell how to use these values now? as there is not straight forward way to access the objects . |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Feb 06, 2014 7:36 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It's almost as if you want us to give you free code and free training.
Surely you're much too professional to ask for that? |
|
Back to top |
|
 |
kunal07 |
Posted: Thu Feb 06, 2014 7:47 am Post subject: |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
working now for me.
thanks all |
|
Back to top |
|
 |
|