|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem with MQGET |
« View previous topic :: View next topic » |
Author |
Message
|
sanjoo |
Posted: Wed Oct 26, 2005 4:42 am Post subject: Problem with MQGET |
|
|
 Acolyte
Joined: 26 Oct 2005 Posts: 65
|
Hi,
I am facing one problem with MQGET.
There is one C application program which reads one queue and writes into some file.
But sometimes what happens is after delivering MQGET successfully,it gets the message length but not writting the actual message in the file.
(Buffer size is 4MB.)
This happens exceptionally.
Any guess why?
Thanks. _________________ Sanjoo
Keep smiling
 |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 26, 2005 4:45 am Post subject: Re: Problem with MQGET |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
sanjoo wrote: |
Any guess why? |
It's a bug in your code.  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wmqiadmin |
Posted: Wed Oct 26, 2005 5:07 am Post subject: |
|
|
 Disciple
Joined: 19 Jun 2005 Posts: 163 Location: epping UK
|
Hi,
even i faced the same problem, i tried to change the location but the file was always blank.
Any buddy pls any inputs
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 26, 2005 5:11 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Look, if you're getting empty files then either the input message didn't have any data in it, or the program to put the message into a file has a bug in it.
You can't solve this kind of problem without troubleshooting it.
We can't help you solve this problem unless you help us, by telling us what you have done to troubleshoot it, and what the results were.
In order to be successful in IT work, you have to know how to solve problems in GENERAL, not just know specific steps to resolve specific things without knowing why or how those steps fix things.
Also, wmqiadmin, unless you actually work with Sanjoo, it's extremely unlikely that you actually have the same problem. So if you have a problem, you should start a new post that actually DESCRIBES it, and what you have done to troubleshoot it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sanjoo |
Posted: Thu Oct 27, 2005 12:40 am Post subject: |
|
|
 Acolyte
Joined: 26 Oct 2005 Posts: 65
|
Got the problem....
This has to do with null character. If message contains null (/0) character, then printf %s function will assume end of string and hence message will not br printed.
But not the solution ...
Anyway .. thanks for the help. _________________ Sanjoo
Keep smiling
 |
|
Back to top |
|
 |
sanjoo |
Posted: Thu Oct 27, 2005 2:45 am Post subject: |
|
|
 Acolyte
Joined: 26 Oct 2005 Posts: 65
|
Solved
printlen = strlen(buffer);
printf("\t%s\t%s\t%d\t%s-%s\t%s\t%s\t%s\t%d\t%d\t%d\t<%s>", timeBuffer, applName, md.PutApplType, putDate, putTime, RepQ, RepQM, userID, md.CodedCharSetId, md.Encoding, messlen, buffer);
while (printlen < messlen)
{
printf(" ");
printf("%s",buffer+printlen);
strbufflen=strlen(buffer+printlen);
if(strbufflen==0)
printlen++;
else
printlen=printlen+strbufflen;
} _________________ Sanjoo
Keep smiling
 |
|
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
|
|
|
|