WebSphere Message Broker, Versión 8.0.0.5 Sistemas operativos: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

Consulte la información sobre la última versión del producto en IBM Integration Bus, Versión 9.0

Trabajar con registros de actividades en una aplicación CMP

Visualizar entradas del Registro de actividad para flujos de mensajes y tipos de mensajes en las aplicaciones de CMP.

Antes de empezar:
Puede crear aplicaciones CMP para examinar y analizar los registros de actividades.
Comprobar qué tipos de recursos pueden generar registros de actividades
/*
 * Sample CMP API code that connects to a local broker
 * called 'testbrk' and lists the available
 * resource types on the execution group 'exgp' that can 
 *  generate Registro de actividads.
 */
try {
  BrokerProxy b = BrokerProxy.getLocalInstance("testbrk");
  if (b != null) {
    ExecutionGroupProxy e = b.getExecutionGroupByName("exgp");
    if (e != null) {
      Properties rms = new Properties();
      rms.setProperty(AttributeConstants.ACTIVITYLOG_SUPPORTED_PROPERTY, AttributeConstants.TRUE);
      Enumeration <ResourceManagerProxy> rmps = e.getResourceManagers(rms);
      while (rmps.hasMoreElements()) {
        ResourceManagerProxy rmp = rmps.nextElement();
        String name = rmp.getName();
        System.out.println(name);
      }
    }
  }
} catch (ConfigManagerProxyException ex) {
    ex.printStackTrace();
}
Recuperar entradas del Registro de actividad para un tipo de recurso particular
/*
 * Sample CMP API code that connects to a local broker
 * called 'testbrk' and retrieves and prints out Registro de actividad
 * entries for resource type 'JMS' on execution group 'exgp'.
 */
try {
  BrokerProxy b = BrokerProxy.getLocalInstance("testbrk");
  if (b != null) {
    ExecutionGroupProxy = b.getExecutionGroupByName("exgp");
    if (e != null) {
      ResourceManagerProxy rmp = e.getResourceManagerByName("JMS");
      if(rmp != null) {
        ActivityLogProxy al = rmp.getActivityLog();
        if (al != null) {
          for (int i = 1; i <= al.getSize(); i++) {
            ActivityLogEntry ale = al.getLogEntry(i);
            System.out.println(ale);
            System.out.println(ale.getMessageNumber());
          }
        }
      }
    }
  }
} catch (ConfigManagerProxyException ex) {
    ex.printStackTrace();
}
Recuperar entradas del Registro de actividad para un flujo de mensajes concreto
/*	
 * Sample CMP API code that connects to a local broker
 * called 'testbrk' and gets references to the execution
 * group called 'default', the application belonging to this execution group called 'app', 
 * and the message flow in the application called 'msgflow'. 
 * It prints out the Registro de actividad entries for message flow 'msgflow'.
 */
try {
  BrokerProxy b = BrokerProxy.getLocalInstance("testbrk");
  if (b != null) {
        ExecutionGroupProxy e = b.getExecutionGroupByName("default");
    if (e != null) {
      ApplicationProxy ap = e.getApplicationByName("app");
      if (ap != null) {
        MessageFlowProxy mf = ap.getMessageFlowByName("msgflow");
        if (mf != null) {
                    ActivityLogProxy al = mf.getActivityLog();
          if (al != null) {
            for (int i = 1; i <= al.getSize(); i++) {
              ActivityLogEntry ale = al.getLogEntry(i);
              System.out.println(ale);
              System.out.println(ale.getMessageNumber());
            }
          }
        }
      }
    }
  }
} catch (ConfigManagerProxyException ex) {
	ex.printStackTrace();
} 
Avisos | Marcas registradas | Descargas | Biblioteca | Soporte | Comentarios

Copyright IBM Corporation 1999, 2014Copyright IBM Corporation 1999, 2014.

        
        Última actualización:
        
        Última actualización: 2015-02-28 17:01:27


Tema de tareaTema de tarea | Versión 8.0.0.5 | bj55160_