ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexUser ExitsProblem with Message Exit on WMQ V7.0.1.3 running on zLinux

Post new topicReply to topic
Problem with Message Exit on WMQ V7.0.1.3 running on zLinux View previous topic :: View next topic
Author Message
arunsaha
PostPosted: Mon Mar 28, 2011 9:15 pm Post subject: Problem with Message Exit on WMQ V7.0.1.3 running on zLinux Reply with quote

Newbie

Joined: 28 Mar 2011
Posts: 2

Dear WMQ Gurus,

I am facing a typical issue with a Channel Message Exit (64 bit) on zLinux platform and using WMQ V7 (7.0.1.3). I am trying to extract the UserIdentifier from the MQMD of the incoming message at the receiver channel end and check whether that's an authorized user or not and pass or reject the message based on that.

The same MsgExit (written in C) works perfectly fine on AIX (with WMQ V7) and I can see that all the parameters are being passed to the exit from MCA properly - by printing them into a log file (using "sprintf" with %s and %d options).

However when I use the same code on zLinux (with WMQ V7) it does not work properly. I tried printing the parameters passed to the exit by MCA into the log file - but I only see one parameter (the "channel name") is being printed in the log file and all other parameters are printed as blanks. This gives me a feeling that probably the parameters are not being passed properly to the exit from the MCA on the zLinux platform. I have already opened a PMR with IBM and they are still working on it and could not provide me a solution yet to fix my issue.

On AIX (where it works perfectly) I used the C compiler "xlc_r" and on ZLINUX (where it does Not work), I used the C compiler "gcc". The following are the "gcc" compiler options I used on zLinux -

===========
# BUILD AN MQSERIES EXIT (64 bit) ON LINUX
PATH=/usr/bin:$PATH
MQIDIR="/usr/mqm"
USRLIBDIR="/usr/lib64"
MQILIBDIR="$MQIDIR/lib64"
MQIINCDIR="$MQIDIR/inc"
MSGEXITDIR="/home/mqm/msgexit_test"
LIBEXIT1="-lmqm_r"
LIBEXIT2="-lmqmcs_r"

gcc -m64 -shared -fpack-struct -fPIC -o "$MSGEXITDIR/MsgExit" "$MSGEXITDIR/MsgExit.c" -I $MSGEXITDIR -I $MQIINCDIR -L $MQILIBDIR -Wl,-rpath=$MQILIBDIR -Wl,-rpath=$USRLIBDIR $LIBEXIT1 -O1
==========

Can you please help me here to figure out why the behaviour is so different on zLinux and whether I am Not using the correct compiler options or is there any other specific settings I need to use in zLinux environment for the MsgExit to work as expected?

I am working at a client site and kind of stuck with this and need to make this work on zLinux environment ASAP. So a quick help will be truly appreciated.

I will be happy to provide any more details (including the source code itself), if required..

thanks and regards,
Arun
Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Mon Mar 28, 2011 10:24 pm Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

This is how i compile my CAD on z/Linux, maybe that helps.

Code:
gcc -m64 -c -fPIC cadexitp.c
gcc -m64 -shared -Wl,-soname,libcadexitp.so -o libcadexitp.so cadexitp.o
cp libcadexitp.so /var/mqm/exits64
chmod 750 /var/mqm/exits64/libcadexitp.so
chown mqm:mqm /var/mqm/exits64/libcadexitp.so

_________________
Regards, Butcher
Back to top
View user's profile Send private message
arunsaha
PostPosted: Tue Mar 29, 2011 5:24 am Post subject: Reply with quote

Newbie

Joined: 28 Mar 2011
Posts: 2

Mr Butcher wrote:
This is how i compile my CAD on z/Linux, maybe that helps.

Code:
gcc -m64 -c -fPIC cadexitp.c
gcc -m64 -shared -Wl,-soname,libcadexitp.so -o libcadexitp.so cadexitp.o
cp libcadexitp.so /var/mqm/exits64
chmod 750 /var/mqm/exits64/libcadexitp.so
chown mqm:mqm /var/mqm/exits64/libcadexitp.so


==============

Hi Butcher,
Thank you for your quick response. I used the compilation options that you suggested and tested my MsgExit code again. However I still keep getting the same issue - looks like it's getting a bad value in the parameter "pChannelExitParams->ExitReason") and so it's exiting with the following error message -

------------ DUring channel start up - it gives this ------

Tue Mar 29 08:40:41 2011 -> 1301402441.92
MsgExit error with invalid ReasonCode: 0.

Tue Mar 29 08:40:41 2011 -> 1301402441.92
Exiting MsgExit with ExitResponse: 0.

------------ and when I try to put a message - then it gives this -----

Tue Mar 29 08:40:07 2011 -> 1301402407.703
MsgExit error with invalid ReasonCode: 32758.

followed by -

Tue Mar 29 08:40:41 2011 -> 1301402441.92
MsgExit error with invalid ReasonCode: 0.

Tue Mar 29 08:40:41 2011 -> 1301402441.92
Exiting MsgExit with ExitResponse: 0.

------------

And also when I am trying to print the function parameter values (which are supposed to be passed from the MCA) in the log files - then except the channel name value - none of the other parmeters are showing proper values (most of them are blanks) - same as what was happening beofore.

One change that I observed by using your compiler options is that previously I was getting a SIGSEGV error and it was creating a FDC file - but that is Not hapening now - after compiling the code using your suggested opions / commands.

However as far as functioning of the message exit is concerned I am still stuck at the same point - none of the parameter values are showing proper values from inside the exit - when I print them in the log file using "sprintf with %s and %d options" - on zLinux (whereas as I said before - the same is printing correct values on AIX).

Any further suggestion to make this message exit work on zLinux platform will be really helpful. If you want I can send the source and header and input data files.

By the way - this is exactly the compilation commands I used - after your suggestion -

=============
# BUILD AN MQSERIES EXIT ON LINUX
PATH=/usr/bin:$PATH
MQIDIR="/usr/mqm"
USRLIBDIR="/usr/lib64"
MQILIBDIR="$MQIDIR/lib64"
MQIINCDIR="$MQIDIR/inc"
MSGEXITDIR="/home/mqm/msgexit_test"
LIBEXIT1="-lmqm_r"
LIBEXIT2="-lmqmcs_r"

gcc -m64 -c -fPIC "$MSGEXITDIR/MsgExit.c" -I $MSGEXITDIR -I $MQIINCDIR
gcc -m64 -shared -Wl,-soname,libMsgExit.so -o libMsgExit.so MsgExit.o -L $MQILIBDIR -Wl,-rpath=$MQILIBDIR -Wl,-rpath=$USRLIBDIR $LIBEXIT1
============
regards,
Arun
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Thu Mar 31, 2011 2:45 pm Post subject: Reply with quote

Padawan

Joined: 25 Mar 2003
Posts: 1738
Location: Melbourne, Australia

To help debug the situation, trying printing the character fields as hex bytes. That will reveal if there are nuls, spaces or other unexpected data in there.

It's Friday here, I'm feeling generous:

Code:

char *FormatHex( void *pData, int DataLen, char *pWorkBuffer )
{
int i;
unsigned char *pUData;
static char HexDigits[16] = "0123456789ABCDEF";

  pUData = (unsigned char *)pData;
  for( i = 0 ; i < DataLen ; i++ )
    {
      *pWorkBuffer++ = HexDigits[ *pUData / 16 ];
      *pWorkBuffer++ = HexDigits[ *pUData++ % 16 ];
    }
  *pWorkBuffer = '\0';
  return pWorkBuffer;
}

char WorkBuff[256];

fprintf( fLog, "chl=%s\n", FormatHex( pChDef->ChannelName, MQ_CHANNEL_NAME_LENGTH, WorkBuff ) );

_________________
Glenn
Back to top
View user's profile Send private message
mvic
PostPosted: Thu Mar 31, 2011 3:50 pm Post subject: Re: Problem with Message Exit on WMQ V7.0.1.3 running on zLi Reply with quote

Padawan

Joined: 09 Mar 2004
Posts: 1981

arunsaha wrote:
However when I use the same code on zLinux (with WMQ V7) it does not work properly. I tried printing the parameters passed to the exit by MCA into the log file - but I only see one parameter (the "channel name") is being printed in the log file and all other parameters are printed as blanks.

Hmm. I do not suspect your build, as it seems unlikely to be a cause for this syptom.

If you dump the whole MQMD in hex, maybe using code like gbaddeley's sample, what do you see? Please post some real output (you should obscure any sensitive names/ids to protect your company data.)

Apart from the MQMD, is the "user data" of the message intact?
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexUser ExitsProblem with Message Exit on WMQ V7.0.1.3 running on zLinux
Jump to:



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
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.