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 Index » IBM MQ API Support » Problem with MQGET

Post new topic  Reply to topic
 Problem with MQGET « View previous topic :: View next topic » 
Author Message
sanjoo
PostPosted: Wed Oct 26, 2005 4:42 am    Post subject: Problem with MQGET Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Oct 26, 2005 4:45 am    Post subject: Re: Problem with MQGET Reply with quote

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
View user's profile Send private message
wmqiadmin
PostPosted: Wed Oct 26, 2005 5:07 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Oct 26, 2005 5:11 am    Post subject: Reply with quote

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
View user's profile Send private message
sanjoo
PostPosted: Thu Oct 27, 2005 12:40 am    Post subject: Reply with quote

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
View user's profile Send private message
sanjoo
PostPosted: Thu Oct 27, 2005 2:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Problem with MQGET
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.