Author |
Message
|
jj.unlimit |
Posted: Tue Sep 23, 2008 4:52 am Post subject: Logging Message Content |
|
|
Novice
Joined: 17 Sep 2008 Posts: 12
|
Currently working on a channel rcv exit using C programming. I have tested the my exit program and its working fine except for the printing of the 1st 32 bytes of the msg content into the log file >> for timelog purpose of the arrival
From wat I noe this set of data is within the variable AgentBuffer, but how to i convert them to string so that I can print them in my log file? |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Sep 23, 2008 7:49 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
They are probably unprintable characters, so don't try to print them !
You can write some code to ignore unprintables or convert them to a dummy character. eg.
if( ! isprint( *pCh ) )
*pCh = '?';
Copy them from the agent buffer before changing them! _________________ Glenn |
|
Back to top |
|
 |
jj.unlimit |
Posted: Tue Sep 23, 2008 8:05 pm Post subject: |
|
|
Novice
Joined: 17 Sep 2008 Posts: 12
|
The message content that im refering is as below:
A send a message "12345678990ABCDEF...Z"
B rcv the message, log the received time and the 1st 32bytes of the message.
Log file shld have the 1st 32 byte of the message like "1234657890..." which is of 32 byte in length. And they hav to be readable/printable characters.
Sorry if I have misled anyone. |
|
Back to top |
|
 |
jj.unlimit |
Posted: Tue Sep 23, 2008 10:38 pm Post subject: |
|
|
Novice
Joined: 17 Sep 2008 Posts: 12
|
is it impossible to get the message content i intended to? Free feel to share your views. |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Sep 24, 2008 9:20 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
The message data is in the agent buffer. There is probably a MQXQH structure in there before the message data. MQXQH contains some unprintable bytes.
Also, if the data is being received from a platform with completely different CCSID and the sender channel has CONVERT(NO), you will need to convert the data to the local character set in the exit before printing it.
 _________________ Glenn |
|
Back to top |
|
 |
jj.unlimit |
Posted: Sun Sep 28, 2008 11:14 pm Post subject: |
|
|
Novice
Joined: 17 Sep 2008 Posts: 12
|
Hi ppl,
I have just completed my exit program. And I realise that the information that is in the object differ in different exits.
Take for example MsgId. I try to extract the msgId in MsgExit is different from RcvExit. This is just one of the things I realise which also affect my Exit program.
Just want to share a bit of my findings when develop. Hope it helps.
And thks to gbaddeley who hav been promptly to ans my queries and definately set a direction for me! |
|
Back to top |
|
 |
David.Partridge |
Posted: Mon Sep 29, 2008 6:34 am Post subject: |
|
|
 Master
Joined: 28 Jun 2001 Posts: 249
|
The data you are returned in AgentBuffer in a receive exit isn't what you seem to be expecting, it is the content of the frame (typically 32kB) currently being sent across the channel at the level just above the transport level.
Using a receive exit to log message data isn't really appropriate. If you are looking at data coming over a server to server channel, then the message exit is the appropriate place.
If you really need to log message data for a svrconn channel, then you need to either reverse engineer the data in the buffers delivered to the receive exit (not impossible, but not documented), or consider the use of an API exit. _________________ Cheers,
David C. Partridge |
|
Back to top |
|
 |
jj.unlimit |
Posted: Wed Oct 01, 2008 10:35 pm Post subject: |
|
|
Novice
Joined: 17 Sep 2008 Posts: 12
|
AFter some other consideration we made, we have decided not to log the message due to space constraints. Plus, its alot of work which might nt really be necssary to my user requirement. We ended up getting the msg id which will be unique.
Thanks David. |
|
Back to top |
|
 |
gbaddeley |
Posted: Thu Oct 02, 2008 3:28 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
FYI, there is an upcoming IBM SupportPac that includes a MQ channel message exit to log selected details of messages to disk files. I'm the author. _________________ Glenn |
|
Back to top |
|
 |
jj.unlimit |
Posted: Mon Oct 06, 2008 5:57 pm Post subject: |
|
|
Novice
Joined: 17 Sep 2008 Posts: 12
|
Wow... will love to look @ the exits.
Thks for informing, waiting anxiously for it, so as to do a comparison with the exits I created which I think is very basic. |
|
Back to top |
|
 |
gbaddeley |
Posted: Mon Oct 06, 2008 6:39 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
It is the result of many years of experimentation and experience with logging message data in live siutations. The SupportPac will include compiled exit modules for a range of platforms but not the source code. _________________ Glenn |
|
Back to top |
|
 |
|