|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Search for an channel exit for sender chl logging incl. mess |
« View previous topic :: View next topic » |
Author |
Message
|
hugo_tille |
Posted: Fri Jan 13, 2006 12:04 am Post subject: Search for an channel exit for sender chl logging incl. mess |
|
|
Newbie
Joined: 12 Jan 2006 Posts: 3 Location: Mainhattan Germany
|
hi,
I´m searching for a channel exit how is logging the sender chl activity.
The exit must run on solaris and logs the complete activity incl. the messages.
The problem is, its not anath to say the channel is running and the logic says the message is commited.
thanks
frank t. from f. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 13, 2006 4:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You could use MirrorQ to mirror the transmit or remote queue to a local queue.
That would get you the app data.
But if it's not enough to say that the channel ran successfully and the messages are no longer on the transmit queue - then I don't think a logging Exit like you're asking for will be good enough either. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
LuisFer |
Posted: Fri Jan 13, 2006 12:13 pm Post subject: |
|
|
 Partisan
Joined: 17 Aug 2002 Posts: 302
|
This exit works on Tandem, Solaris, Linux(v51,v53) suposse that it will works on other platforms , the performance is good.
To compile look at Intercomunication Manual for every Platform.
Implement on the channel with:
ALT CHL(CHANNEL_NAME) CHLTYPE(CHLTYPE) MSGEXIT('MsgExit(MSGEXIT)') MSGDATA('QMGRNAME_OF_CHANNEL,DestQueue,')
Msgdata must end with a comma (","), the source is too at my Web Page
Please do a donation to an ONG (RedCross) and/or MQSERIES.NET.
Enjoy it:
Code: |
/*-------------------------------------------------------------------*/
/* */
/* Software: MsgExit - Logging de Mensajes */
/* */
/* Estado: Version 0 Release 2 Modificacion 3 */
/* Fecha: 26 Febrero 2005 */
/* Modificado: 02 Marzo 2005 */
/* */
/* Autor: LuisFer y Nacho (WWW.LUISFER.INFO, WWW.CIVO1.COM) */
/* */
/* */
/* Descripcion: Loggeo de Mensajes que pasan por un canal */
/* */
/* Parametros MsgData: Separados por comas "," y acabar con "," */
/* 1.- Nombre del QMgr en el que corre la Exit */
/* 2.- Cola de Destino de la copia del Mensaje */
/* */
/* Ej: alt chl(a.to.b) chltype(tipo) msgexit('MsgExit(MSGEXIT)') */
/* msgdata('QMGRA,COLAA,') */
/* */
/* Compilacion/LinkEdit Seguir Manual Intercomunicacion */
/* */
/* AVISO: Este programa es SoftWare Libre, esta permitida su redis- */
/* tribucion y/o modificacion, bajo los terminos de la */
/* GNU/GPL como esta publicado por The Free Software Fundation*/
/* en todas sus versiones (somos asi de cachondos). */
/* Por supuesto, no tiene ningun tipo de garantia por su uso. */
/* */
/* Nota de los Autores: Este software no se ha desarrollado con animo*/
/* de lucro pero si realizas una Donacion a alguna ONG (legal) */
/* habremos contribuido a mejorar la vida a muchas contact admin. Gracias */
/* */
/*WARNING This Program is free software; the Free Software Foundation*/
/* gives unlimited permission to copy and/or distribute it, */
/* with or without modifications, as long as this notice is */
/* preserved. */
/* This program is distributed in the hope that it will be */
/* useful,but WITHOUT ANY WARRANTY, to the extent permitted */
/* by law; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
/*********************************************************************/
/* Cabeceras estandard */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
/*#include <locale.h>
#include <sys/type.h>
#include <sys/time.h>
#include <time.h>
#include <math.h> */
/* Cabeceras WebSphere MQ*/
#include <cmqc.h>
#include <cmqxc.h>
int i=0,j=0,k=0;
MQCHAR Queue[24]="\x0";
MQHCONN hConn=0;
MQLONG Reason=0;
MQLONG CompCode=0;
MQLONG O_options=0;
MQLONG C_options=0;
MQHOBJ HobjPut=0;
MQOD od = {MQOD_DEFAULT}; /* Open Put */
MQMD md = {MQMD_DEFAULT}; /* Message Descriptor */
MQPMO pmo = {MQPMO_DEFAULT}; /* put message options */
MQCHAR QMgrName[7]="\x0";
char caracter[1]="\x0";
long DataLen=2048;
void MQENTRY MSGEXIT ( PMQCXP pChannelExitParams,
PMQCD pChannelDefinition,
PMQLONG pDataLength,
PMQLONG pAgentBufferLength,
PMQBYTE AgentBuffer,
PMQLONG pExitBufferLength,
PMQPTR pExitBufferAddr)
{
switch( pChannelExitParams-> ExitReason )
{
case MQXR_INIT:
if ( strlen(pChannelExitParams->ExitData) )
{
for (i=0;i<(short)strlen(pChannelExitParams->ExitData)-1;i++)
{
caracter[0] = pChannelExitParams->ExitData[i];
if (memcmp(caracter,",",1) == 0) {j++;k=i+1;}
if (j > 1) {break;}
if (j == 0)
{
QMgrName[i] = caracter[0];
}
if ((j == 1) && (memcmp(caracter,",",1) != 0))
{
Queue[i-k] = caracter[0];
}
}
MQCONN(QMgrName,
&hConn,
&CompCode,
&Reason);
if (hConn !=0 )
{
od.ObjectType = MQOT_Q;
strncpy(od.ObjectName, Queue, (size_t)MQ_Q_NAME_LENGTH);
O_options = MQOO_OUTPUT+
MQOO_BIND_AS_Q_DEF+
MQOO_FAIL_IF_QUIESCING;
MQOPEN(hConn,
&od,
O_options,
&HobjPut,
&CompCode,
&Reason);
}
if (HobjPut != 0)
{
pmo.Options = MQPMO_NO_SYNCPOINT;
md.Expiry=30000; /*5 Minutos*/
md.Persistence = MQPER_NOT_PERSISTENT; /*no persistentes */
}
}
break;
case MQXR_MSG:
if (HobjPut != 0)
{
MQPUT(hConn,
HobjPut,
&md,
&pmo,
(short)*pDataLength,
(char *)AgentBuffer,
&CompCode,
&Reason);
}
break;
case MQXR_TERM:
if (HobjPut != 0)
{
MQCLOSE(hConn,
&HobjPut,
C_options,
&CompCode,
&Reason);
}
break;
default:
break;
}
pChannelExitParams -> ExitResponse = MQXCC_OK; /*siempre ok*/
return;
|
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|