Author |
Message
|
AlexeiSkate |
Posted: Thu Apr 11, 2002 7:20 am Post subject: |
|
|
Centurion
Joined: 10 Apr 2002 Posts: 123
|
Hi,
I'm trying to write a program that will load the content of a large file onto a queue as a single message. Since this message can be potentially large, I would like to apply MQSeries segmentation and put segments of the logical msg onto the queue. I've seen a C programming example using MQI that directly manipulate the MQMD structure to set the MsgFlag to MQMF_SEGMENT for each segment and set the MsgFlag to MQMF_LAST_SEGMENT for the final segment. I'm thinking that I have to do something similar on the Java side but don't quite know how. I've read and re-read the "MQseries Using Java" (SC34-5456-07) redbook , but it doesn't list any getter or setter methods that will allow me to get access to the MQMD structure that is encapsulated within the MQMessage object so that I can manipulate the desired fields for segmentation.
If someone can provide some guidance as to how I should proceed and/or point me to some segmentation using Java samples, it would be greatly appreciated. Thanks for anyone's help.
[ This Message was edited by: AlexeiSkate on 2002-04-12 10:53 ]
[ This Message was edited by: AlexeiSkate on 2002-04-12 11:03 ] |
|
Back to top |
|
 |
AlexeiSkate |
Posted: Tue Apr 16, 2002 7:56 am Post subject: |
|
|
Centurion
Joined: 10 Apr 2002 Posts: 123
|
Ok, I was able to bypass my problem for now. You can set the putMessageOption variable 'options'to MQC.MQPMO_LOGICAL_ORDER so that the queue manager will automatically keep track of each segment's offset, group id, and message sequence number. Each segment of the logical message will have different offset, but they will all have the same group id and msg sequence number. Before putting each segment onto the queue, set its messageFlag value to MQC.MQMF_SEGMENT. The last segment will need to have its messageFlag value set to MQC.MQMF_LAST_SEGMENT. The problem I had was the the redbook "MQSeries using Java" did not specify what are the valid values to set the messageFlag to when doing a Put command. I had to do some digging in other redbooks to find my solution.
|
|
Back to top |
|
 |
deneb |
Posted: Wed Apr 17, 2002 8:06 pm Post subject: |
|
|
 Novice
Joined: 15 Apr 2002 Posts: 18
|
Hi
Did u try receiving the segmentation messages.. ? Since i am facing some problems
There are 2 ways to achieve this
1- Let QueueManager do the segmentation [i was successful in this]
2- Let the Application do the segmentation [not successful]
any inputs ... |
|
Back to top |
|
 |
AlexeiSkate |
Posted: Thu Apr 18, 2002 5:52 am Post subject: |
|
|
Centurion
Joined: 10 Apr 2002 Posts: 123
|
Hi Deneb,
I'm not sure I understand your question. Are you asking me if I've tried to get the segments back from the queue, or are you asking me if I was able to do a put onto the queue with the application doing its own segmentation ?
I did a put onto a queue with the application doing the segmentation. My Java program read each record from a file, put it onto a queue with the messageFlag set to MQMF_SEGMENT, except for the last record where it was put onto the queue with the messageFlag set to LAST_MQMF_SEGMENT. I've been trying to play around with the get method to retrieve back my segments from the queue, but I haven't figure out how I can do a loop to get back each segment indivdually. Although I could get back indivdual segment using a single get command, or I could get back the entire logica message when I set the getMessageOption to MQGMO_COMPLETE_MSG. |
|
Back to top |
|
 |
deneb |
Posted: Tue Apr 23, 2002 8:49 pm Post subject: |
|
|
 Novice
Joined: 15 Apr 2002 Posts: 18
|
Hi
Actually i meant receiving the segmented messages.
i was successful in retrieving the whole message but not parts of it . the same thing that u achieved.
thnx for your reply. if u r successful in retrieving the segment messages through a loop do lemme know
deneb |
|
Back to top |
|
 |
arunmakhija |
Posted: Wed Nov 06, 2002 5:00 pm Post subject: |
|
|
 Novice
Joined: 17 Jun 2002 Posts: 20 Location: Sydney
|
Hi AlexeiSkate
Can you please send me the java program you used to do a put with application segmenation
regards
arun
arunmakhija@yahoo.com _________________ In Celebration of Being Alive !!! |
|
Back to top |
|
 |
|