cciGetBrokerInfo

Esta función consulta el entorno de intermediario actual (por ejemplo, para obtener información sobre el nombre de intermediario, el nombre del grupo de ejecución y el nombre del gestor de colas). La información se devuelve en una estructura de tipo CCI_BROKER_INFO_ST.
Nota: Esto es diferente de la cniGetBrokerInfo existente, ya que no es necesario proporcionar un manejador CciNode* y que cciGetBrokerInfo no devuelve ninguna información acerca de un flujo de mensajes. Por lo tanto, se puede invocar cciGetBrokerInfo desde las funciones de inicialización, por ejemplo, bipInitializeUserExits, bipGetMessageParserFactory y bipGetMessageFlowNodeFactory.

Sintaxis

void cciGetBrokerInfo(
                      int*                        returnCode,
                      CCI_BROKER_INFO_ST* broker_info_st);

Parámetros

returnCode (salida)
Recibe el código de retorno de la función (salida).
Los códigos de retorno posibles son:
  • CCI_SUCCESS
  • CCI_INV_BROKER_INFO_ST
  • CCI_EXCEPTION
broker_info_st (salida=
La dirección de una estructura CCI_BROKER_INFO_ST que se ha de rellenar con los valores relevantes una vez finalizada correctamente.

Valores de retorno

Ninguno. Si se produce un error, el parámetro returnCode indica la razón del mismo.

Ejemplo

int          rc = CCI_SUCCESS;

CCI_BROKER_INFO_ST brokerInfo = {CCI_BROKER_INFO_ST_DEFAULT};

#define INTITIAL_STR_LEN 256
CciChar brokerNameStr[INTITIAL_STR_LEN];
CciChar executionGroupNameStr[INTITIAL_STR_LEN];
CciChar queueManagerNameStr[INTITIAL_STR_LEN];

brokerInfo.brokerName.bufferLength = INTITIAL_STR_LEN;
brokerInfo.brokerName.buffer       = brokerNameStr;

brokerInfo.executionGroupName.bufferLength = INTITIAL_STR_LEN;
brokerInfo.executionGroupName.buffer = executionGroupNameStr;

brokerInfo.queueManagerName.bufferLength = INTITIAL_STR_LEN;
brokerInfo.queueManagerName.buffer = queueManagerNameStr;

cciGetBrokerInfo(&rc,&brokerInfo);

/* por si se da el caso de que los almacenamientos intermedios sean muy cortos*/
if ((brokerInfo.brokerName.bytesOutput         < brokerInfo.brokerName.dataLength)  ||
    (brokerInfo.executionGroupName.bytesOutput <  brokerInfo.executionGroupName.dataLength) ||
    (brokerInfo.queueManagerName.bytesOutput   <  brokerInfo.queueManagerName.dataLength))  {

  /*al menos uno de los almacenamientos intermedios era demasiado corto, se ha de reintentar*/
  /* Tenga en cuenta que es improbable ya que los tamaños iniciales eran lo suficientemente grandes*/

  brokerInfo.brokerName.bufferLength =
     brokerInfo.brokerName.dataLength;
  brokerInfo.brokerName.buffer       =
    (CciChar*)malloc (brokerInfo.brokerName.bufferLength * sizeof(CciChar));

  brokerInfo.executionGroupName.bufferLength =
    brokerInfo.executionGroupName.dataLength;
  brokerInfo.executionGroupName.buffer       =
    (CciChar*)malloc (brokerInfo.executionGroupName.bufferLength * sizeof(CciChar));

  brokerInfo.queueManagerName.bufferLength =
    brokerInfo.queueManagerName.dataLength;
  brokerInfo.queueManagerName.buffer       =
    (CciChar*)malloc (brokerInfo.queueManagerName.bufferLength * sizeof(CciChar));

  cciGetBrokerInfo(&rc,&brokerInfo);

  /*ahora efectúe algo razonable con las series antes de que los almacenamientos intermedios queden fuera de ámbito*/
  /* por ejemplo, llame a una función escrita por el usuario para grabarlas fuera*/
  copyBrokerInfo(brokerInfo.brokerName.buffer,
                 brokerInfo.executionGroupName.buffer,
                 brokerInfo.queueManagerName.buffer);

  free((void*)brokerInfo.brokerName.buffer);
  free((void*)brokerInfo.executionGroupName.buffer);
  free((void*)brokerInfo.queueManagerName.buffer);

}else{
  /*ahora efectúe algo razonable con las series antes de que los almacenamientos intermedios queden fuera de ámbito*/
  /* por ejemplo, llame a una función escrita por el usuario para grabarlas fuera*/
  copyBrokerInfo(brokerInfo.brokerName.buffer,
                 brokerInfo.executionGroupName.buffer,
                 brokerInfo.queueManagerName.buffer);
}
Conceptos relacionados
Desarrollo de salidas de usuario
Avisos | Marcas registradas | Descargas | Biblioteca | Soporte | Su opinión
Copyright IBM Corporation 1999, 2006 Última actualización: 22/08/2006
as36040_