Интеграция приложений на основе WebSphere MQ


Example.9.2 - часть 3


memcpy(md.CorrelId, MQCI_NONE, sizeof(md.CorrelId));

MQGET(Hcon, Hrep, &md, &gmo, buflen, buffer, &replylen, &CompCode, &Reason);

if (CompCode != MQCC_FAILED)

{

if (md.MsgType == MQMT_REPLY) /* report feedback */

{ printf("Transaction % s=> %s successfully: %s\n", queue_input, queue_output, buffer);

MQCMIT( Hcon, &CompCode, &Reason ) ;

}

else

{

printf("Transaction % s=> %s successfully, REPLY message not deliver, reason code %ld CompCode %ld\n", queue_input, queue_output, queue_reply, Reason, CompCode );

MQBACK( Hcon, &CompCode, &Reason ) ;

CompCode = MQCC_FAILED ;

}

}

if (Reason == MQRC_NO_MSG_AVAILABLE)

{

printf("Transaction % s=> %s UNsuccessfully, REPLY message not deliver\n", queue_input, queue_output );

MQBACK( Hcon, &CompCode, &Reason ) ;

CompCode = MQCC_FAILED ;

}

}

}

}

}

C_options = 0;

MQCLOSE(Hcon, &Hobj, C_options, &CompCode, &Reason);

if (Reason != MQRC_NONE){printf("MQCLOSE %s ended with reason code %ld\n", queue_input, Reason); }

MQCLOSE(Hcon, &Hout, C_options, &CompCode, &Reason);

if (Reason != MQRC_NONE){printf("MQCLOSE %s ended with reason code %ld\n", queue_output, Reason); }

MQCLOSE(Hcon, &Hrep, C_options, &CompCode, &Reason);

if (Reason != MQRC_NONE){printf("MQCLOSE %s ended with reason code %ld\n", queue_reply, Reason); }

MQDISC(&Hcon, &CompCode, &Reason);

if (Reason != MQRC_NONE){ printf("MQDISC ended with reason code %ld\n", Reason); }

return(0);

}




Начало  Назад  Вперед



Книжный магазин