Title: Message
>>>I was under an impression that issuing one MQGET should reassemble all the segments and give me one single final message..
 
Usha
Yes its true If the Segmentations is done by Queue Manager and not the Application. The message is Large, not too large
for either the putting or the getting application to handle in a single buffer, but possibly too large for the queue manager
or a queue on which the message is to be put. In that case you just authorize the QM in your application to do segmentation
if neccesary.
NOTE: The application buffer must be large enough to contain the reassembled message. so ONE MQGET WORKS
 
Based on what you had sent, it looked like you are doing segmentation within the APPLICATION
sendmsg.messageFlags = MQC.MQMF_SEGMENT;(3 segments)
 
When you do a MQGET, it returns one segment from the queue, which I checked by printing out getOptions.segmentStatus.
 
So I go through a loop, reading each segment and writing it to a file. or You can take each segement and store
it in a buffer within the program and write it later to the file. It was long time back I did that, but I think it was
faster when I wrote each segement to file rather than a whole big buffer to the file.
 
I am answering your second posting here itself:
I loop through all segments and used follwing
 
do
{
 
}while ( getOptions.segmentStatus == MQC.MQSS_SEGMENT );

Other Options for segment status == MQSS_NOT_A_SEGMENT | MQSS_LAST_SEGMENT

This isn't the best way of doing it :) I know as it goes through all mesages and picks up those which are segments by checking for
Segment Status. there could be segments from different messages and also other individual messages. you have
to design your own filtering/retrieval criteria in your application.
 
Hope this helps
 
Arun

 -----Original Message-----
From: Usha Suryadevara [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 15, 2003 12:08 PM
To: [EMAIL PROTECTED]
Subject: Re: MQ Series Segmentation

Hi Arun,

        Thanks for the info, are you saying that i *have* to loop through till i get all the segments ?? I was under an impression that issuing one MQGET should reassemble all the segments and give me one single final message..

- Usha


At 10:05 AM 10/15/2003 -0700, you wrote:
HI Usha
 
I have used segmentation but only in Server to Server to scenario.
 
MQPUT
PMO MQPMO_LOGICAL_ORDER
MD MQMF_SEGMENT (all 3 segments)
MQMF_LAST_SEGMENT (last segment )

 
MQGET
1.  Instead of   GMO MQGMO_COMPLETE_MSG I have used following options

GMO MQGMO_LOGICAL_ORDER + MQGMO_ALL_SEGMENTS_AVAILABLE + MQGMO_WAIT;
2. MD No options set:
In this case if You have to re-set msg-id and correl id ,  when you loop through all the segments in the queue
to receive all the segments.
 
messageId      = MQMI_NONE;
correlationId   = MQCI_NONE;
 
This worked for me in Server to Server case. try it with client-server and let us know how it works.
 
Arun Makhija
Never argue with an idiot. They drag you down to their level and beat you with experience
-----Original Message-----
From: Usha Suryadevara [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 15, 2003 8:57 AM
To: [EMAIL PROTECTED]
Subject: MQ Series Segmentation

Greetings,

Have anyone used MQ segmentation ?

Is it possible to activate MQ segmentation in a client server scenario ? I mean between MQ client and MQ server.

This is what i am doing, say i have 3 segments,

MQPUT
PMO MQPMO_LOGICAL_ORDER
MD MQMF_SEGMENT (all 3 segments)
MQMF_LAST_SEGMENT (last segment )

MQGET
GMO MQGMO_COMPLETE_MSG
MD No options set

Also the Version number for MQMD to MQMD_VERSION_2.

Now when i put a message it segments it right, but when i do a MQGET it gets only the first segment, not the whole message. :(.

The documentation i was reading says that "QM upon receiving the segments reassembles it when an MQGET is issued.. ". Does this mean that the segments cannot be re-assembled if the receiving application is an MQ client ?

There is a work around that i can keep checking the for the
        mdDescriptor.MsgFlags = MQMF_LAST_SEGMENT
                        i think... didn't try this yet but might work.



Any information is appreciated.

Thanks in advance
Usha

Reply via email to