사용자 정의 통합 애플리케이션에서 배치 결과 검사

사용자 정의 통합 애플리케이션에서 배치할 때 해당 조치의 결과를 검사할 수 있습니다.

태스크 정보

애플리케이션을 코드화하여 수행하는 배치 조치의 결과를 테스트합니다. 예를 들어,
import com.ibm.integration.admin.model.common.LogEntry;
import com.ibm.integration.admin.model.server.DeployResult;
import com.ibm.integration.admin.proxy.IntegrationAdminException;
import com.ibm.integration.admin.proxy.IntegrationNodeProxy;
import com.ibm.integration.admin.proxy.IntegrationServerProxy;


public class DeployExample {

  public static void main(String[] args) {
    IntegrationNodeProxy node = new IntegrationNodeProxy("localhost",4414,"","",false);
    try {
      IntegrationServerProxy server = node.getIntegrationServerByName("server1");
      DeployResult result  = server.deploy("C:\\temp\\mybarfile.bar");
      int deployStatus = server.getLastHttpResponse().getStatusCode();
      if (deployStatus >= 400)
      {
        System.out.println("Http response error: " + deployStatus );
      }
      else
      { // deploy worked, check for any Log entries 
        LogEntry[] logEntries  = result.getLogEntry();
        if (logEntries != null)
        {
          for (LogEntry logEntry: logEntries)
          {
            System.out.println("Deploy log entry: "+logEntry.getDetailedText()); 
          }
        }
      }
    } catch (IntegrationAdminException e) {
      System.out.println("Error deploying: "+e);
    }
  }
}

배치 메시지를 통합 노드로 보낼 수 없으면 배치 시점에 IntegrationAdminException 예외가 발생합니다. 통합 노드가 배치 메시지를 수신하면 전체 배치에 대한 로그 메시지가 표시되고 그 다음에 배치로 영향을 받는 각 통합 노드의 특정 완료 코드가 표시됩니다.