Workload-Management mit der IBM Integration-API konfigurieren

Die IBM® Integration-API stellt Methoden zum Erstellen, Abrufen, Aktualisieren und Löschen von Workload-Management-Richtlinien bereit.

Mustercodeausschnitte finden Sie in den Beschreibungen der folgenden Tasks:

Workload-Management-Richtlinie erstellen

public static void PolicyCreate(String hostname, int port, String qmgr) {
  BrokerProxy b = null;
  try {      
    System.out.println("Connecting to the Integration Node (Broker).");
    System.out.println("Hostname="+hostname+", Port="+port+", QueueManager="+qmgr);
    BrokerConnectionParameters bcp = new MQBrokerConnectionParameters(hostname, port, qmgr);
    b = BrokerProxy.getInstance(bcp);     
    String policyName = "ExamplePolicy";
    String policyType = "WorkloadManagement";
    String policyContent = "<wsp:Policy xmlns:wsp=\"http://www.w3.org/ns/ws-policy\">
                           <iwlm:workloadManagement xmlns:iwlm=\"http://www.ibm.com/xmlns/prod/websphere/iib/9.0.0/policy/wlm\">
                           <iwlm:notificationThresholdMsgsPerSec>75</iwlm:notificationThresholdMsgsPerSec>
                           <iwlm:maximumRateMsgsPerSec>100</iwlm:maximumRateMsgsPerSec>
                           <iwlm:processingTimeoutMsgsPerSec></iwlm:processingTimeoutMsgsPerSec>
                           <iwlm:processingTimeoutAction></iwlm:processingTimeoutAction>
                           <iwlm:additionalInstances>0</iwlm:additionalInstances>
                           <iwlm:startInstancesWhenFlowStarts>false</iwlm:startInstancesWhenFlowStarts>
                           <iwlm:commitCount>0</iwlm:commitCount>
                           <iwlm:commitInterval></iwlm:commitInterval>
                           <iwlm:startMode>maintained</iwlm:startMode>
                           </iwlm:workloadManagement>
                           </wsp:Policy>";	   			 
                           System.out.println("About to create a policy.");
    b.createPolicy(policyName, policyType, policyContent);    
    System.out.println("Disconnecting from the Integration Node (Broker).");
    b.disconnect();
  } catch (ConfigManagerProxyException ex) {
    ex.printStackTrace();
  }
}

Workload-Management-Richtlinie abrufen

public static void PolicyRetrieve(String hostname, int port, String qmgr) {
	BrokerProxy b = null;
	try {			 
		 System.out.println("Connecting to the Integration Node (Broker).");
		 System.out.println("Hostname="+hostname+", Port="+port+", QueueManager="+qmgr);
		 BrokerConnectionParameters bcp = new MQBrokerConnectionParameters(hostname, port, qmgr);
		 b = BrokerProxy.getInstance(bcp);			 
		 String policyName = "ExamplePolicy";
		 String policyType = "WorkloadManagement";			 	   		
		 System.out.println("About to retrieve a policy.");
		 PolicyProxy p = b.getPolicy(policyName, policyType);
		 System.out.println("Policy contents of retrieved policy:");
		 System.out.println(p.getPolicyContent());
		 System.out.println("Disconnecting from the Integration Node (Broker).");
		 b.disconnect();
	} catch (ConfigManagerProxyException ex) {
		 ex.printStackTrace();
	}
}	

Workload-Management-Richtlinie aktualisieren

public static void PolicyUpdate(String hostname, int port, String qmgr) {
  BrokerProxy b = null;
  try {      
    System.out.println("Connecting to the Integration Node (Broker).");
    System.out.println("Hostname="+hostname+", Port="+port+", QueueManager="+qmgr);
    BrokerConnectionParameters bcp = new MQBrokerConnectionParameters(hostname, port, qmgr);
    b = BrokerProxy.getInstance(bcp);     
    String policyName = "ExamplePolicy";
    String policyType = "WorkloadManagement";
    String policyContent = "<wsp:Policy xmlns:wsp=\"http://www.w3.org/ns/ws-policy\">
                           <iwlm:workloadManagement xmlns:iwlm=\"http://www.ibm.com/xmlns/prod/websphere/iib/9.0.0/policy/wlm\">
                           <iwlm:notificationThresholdMsgsPerSec>75</iwlm:notificationThresholdMsgsPerSec>
                           <iwlm:maximumRateMsgsPerSec>100</iwlm:maximumRateMsgsPerSec>
                           <iwlm:processingTimeoutMsgsPerSec></iwlm:processingTimeoutMsgsPerSec>
                           <iwlm:processingTimeoutAction></iwlm:processingTimeoutAction>
                           <iwlm:additionalInstances>0</iwlm:additionalInstances>
                           <iwlm:startInstancesWhenFlowStarts>false</iwlm:startInstancesWhenFlowStarts>
                           <iwlm:commitCount>0</iwlm:commitCount>
                           <iwlm:commitInterval></iwlm:commitInterval>
                           <iwlm:startMode>maintained</iwlm:startMode></iwlm:workloadManagement>
                           </wsp:Policy>";          
                           System.out.println("About to update a policy.");
    b.updatePolicy(policyName, policyType, policyContent);
    System.out.println("Disconnecting from the Integration Node (Broker).");
    b.disconnect();
  } catch (ConfigManagerProxyException ex) {
    ex.printStackTrace();
  }
} 

Workload-Management-Richtlinie löschen

public static void PolicyDelete(String hostname, int port, String qmgr) {
	BrokerProxy b = null;
	try {			 
		 System.out.println("Connecting to the Integration Node (Broker).");
		 System.out.println("Hostname="+hostname+", Port="+port+", QueueManager="+qmgr);
		 BrokerConnectionParameters bcp = new MQBrokerConnectionParameters(hostname, port, qmgr);
		 b = BrokerProxy.getInstance(bcp);	   
		 String policyName = "ExamplePolicy";
		 String policyType = "WorkloadManagement";			 	   		 
		 System.out.println("About to delete a policy.");
		 b.deletePolicy(policyName, policyType);
		 System.out.println("Disconnecting from the Integration Node (Broker).");
		 b.disconnect();
	} catch (ConfigManagerProxyException ex) {
		 ex.printStackTrace();
	}
}	
Bemerkungen | Marken | Downloads | Bibliothek | Support | Feedback

Copyright IBM Corporation 1999, 2013Copyright IBM Corporation 1999, 2013.

        
        Letzte Aktualisierung:
        
        Letzte Aktualisierung: 2013-07-18 03:08:51


TaskthemaTaskthema | IBM Integration Bus Version 9.0.0.0 | bn34264_