|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
CMP programs for stopping the Message Flow |
« View previous topic :: View next topic » |
Author |
Message
|
mvs |
Posted: Thu Jan 03, 2008 4:59 am Post subject: CMP programs for stopping the Message Flow |
|
|
Voyager
Joined: 06 Jul 2007 Posts: 85
|
Hi,
I am trying to stop the flow using Java programs which uses the ConfigManagerProxy.
I am getting the exception "com.ibm.broker.config.proxy.ConfigManagerProxyPropertyNotInitializedException".
Then i added ConfigManagerProxy.setRetryCharacteristics(10000);
but still getting the same exception.
The Exception looks below
------------------
C:\MBFlows_Java>java StopJavaF
com.ibm.broker.config.proxy.ConfigManagerProxyPropertyNotInitializedException: I
nformation on the Topology has not yet been supplied by the Configuration Manage
r; consequently the broker information could not be determined.
at com.ibm.broker.config.proxy.TopologyProxy.getBroker(TopologyProxy.jav
a:766)
at com.ibm.broker.config.proxy.TopologyProxy.getBrokerByName(TopologyPro
xy.java:801)
at StopJavaF.main(StopJavaF.java:25)
C:\MBFlows_Java>
------------------
And my Java program looks like below
Code: |
import com.ibm.broker.config.proxy.*;
import java.util.jar.*;
import java.util.GregorianCalendar;
import java.util.ListResourceBundle;
public class StopJavaF{
public static void main(String[] args) throws Exception
{
String b = "LMD6UMQI_BRKR";
String e = "debugger";
String m = "RequestFlow";
MQConfigManagerConnectionParameters conparams = new MQConfigManagerConnectionParameters("lib-mqsi-04",1415,"LMD6NMQI");
try {
// ----------------------------------------------------------
// Add user code below
ConfigManagerProxy cmp = ConfigManagerProxy.getInstance(conparams);
ConfigManagerProxy.setRetryCharacteristics(10000);
TopologyProxy tp = cmp.getTopology();
BrokerProxy bp = tp.getBrokerByName(b);
ExecutionGroupProxy ep = bp.getExecutionGroupByName(e);
MessageFlowProxy mp = ep.getMessageFlowByName(m);
// Wait for a maximum of 10 seconds
ConfigManagerProxy.setRetryCharacteristics(10000);
mp.stop(true);
if(mp.isRunning()){
System.out.println("The Flow stopped");
}else{
System.out.println("The Flow not stopped");
}
cmp.disconnect();
} catch (ConfigManagerProxyLoggedException e1) {
e1.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e1) {
e1.printStackTrace();
}catch (Exception e1){
e1.printStackTrace();
}
}
}
|
Any thing needs to add or change to the program?
Thanks and Regards
MVS |
|
Back to top |
|
 |
mqmatt |
Posted: Thu Jan 03, 2008 5:06 am Post subject: |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
Your application looks fine. Check that you have authority to access the Config Manager (i.e. mqsicreateaclentry) and that the Config Manager is running.
Can you run (for example) mqsideploy from the same userid? |
|
Back to top |
|
 |
mvs |
Posted: Thu Jan 03, 2008 5:55 am Post subject: |
|
|
Voyager
Joined: 06 Jul 2007 Posts: 85
|
Yes, i have an access to the configuration Manager and broker.
I am able to deploy the flow from the same user id using tool kit.
I am able to stop the flow using the same code in JavaComputeNode without any exceptions.
Thank and Regards
MVS |
|
Back to top |
|
 |
mqmatt |
Posted: Thu Jan 03, 2008 6:29 am Post subject: |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
Well, the toolkit uses (logically) the same code as you've described, so you need to find out what the difference is between the Toolkit environment and the environment in which your code is running.
First thing I'd do is check that the connection parameters you're using are identical (even down to the specification of the hostname parameter).
The error states that the CMP application didn't receive a response from the Config Manager. You could check out the Config Manager's version of events by running the Config Manager in the foreground; conveniently described by a clever chap here: http://www.ibm.com/developerworks/websphere/library/techarticles/0706_lucas/0706_lucas.html
With this on, should see the Config Manager receiving a message from your CMP application (of the type 'register PubSubTopology') and a successful response being sent back to the CMP.
Cheers
-Matt |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|