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 Java / JMS » Get segmental Messages

Post new topic  Reply to topic
 Get segmental Messages « View previous topic :: View next topic » 
Author Message
themvv
PostPosted: Tue Jul 22, 2003 8:58 pm    Post subject: Get segmental Messages Reply with quote

Novice

Joined: 22 Jul 2003
Posts: 15

hello

I'm using MQMF_SEGMENTATION_ALLOWED for big Message. when I put successfully, but when I get I doesn't

// when put message

mqMsg = New MQMessage
mqMsg.WriteString(strMessage)
mqMsg.Format = MQFMT_STRING
mqMsg.MessageFlags = MQMF_SEGMENTATION_ALLOWED

mqPutMsgOpts = New MQPutMessageOptions
mqPutMsgOpts.Version = MQMD_VERSION_2

mqQueue.Put(mqMsg, mqPutMsgOpts)

mqQMgr.Commit()

// It segment 3 messages
// But when I get ,

mqMsg = New MQMessage
mqGetMsgOpts = New MQGetMessageOptions
mqGetMsgOpts.WaitInterval = 15000
mqGetMsgOpts.Options = MQGMO_SYNCPOINT + MQGMO_ALL_SEGMENTS_AVAILABLE + MQGMO_WAIT
mqGetMsgOpts.Version = MQC.MQGMO_VERSION_2

Dim str As String

mqQueue.Get(mqMsg, mqGetMsgOpts)
str = mqMsg.ReadString(mqMsg.MessageLength)

//the result : str = MDE..
//althought message on Queue disappear but string reveived is MDE
if I change some option it show compcode=2257
Back to top
View user's profile Send private message
mqonnet
PostPosted: Wed Jul 23, 2003 5:35 am    Post subject: Reply with quote

Grand Master

Joined: 18 Feb 2002
Posts: 1114
Location: Boston, Ma, Usa.

Add the following to the get code.

mqMsg.setVersion(MQC.MQMD_VERSION_2)

Remember any grouped/segmenting of messages must be MD2. Should work after that.

Cheers
Kumar
Back to top
View user's profile Send private message Send e-mail Visit poster's website
EddieA
PostPosted: Wed Jul 23, 2003 5:42 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Is this on the same Queue Manager.

2257 says you are using options from a V2 MQMD but only supplying a V1.

Apart from the previous suggestion, you could try the latest version of the Java code. I seem to remember that the earlier versions always used a V1 MQMD by default, where the later ones used the 'highest' supported by the platform you connect to.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
themvv
PostPosted: Wed Jul 23, 2003 5:57 pm    Post subject: Reply with quote

Novice

Joined: 22 Jul 2003
Posts: 15

thank EddieA and mqonnet
I'm sorry, I have used VB.net for programming not Java. I see code in VB.net similar to JAVA so I ask you.
mqonnet tell me mqMsg.setVersion(MQC.MQMD_VERSION_2) but in VB.net it doesn't have that method. Only method mqMsg.version but readonly
today thank God I have passed it I set more messageflag when I get

this source:

mqMsg = New MQMessage
mqMsg.MessageFlags = MQMF_SEGMENTATION_ALLOWED
mqGetMsgOpts = New MQGetMessageOptions
mqGetMsgOpts.WaitInterval = 15000 '* 15 second limit for waiting
mqGetMsgOpts.Options = MQGMO_LOGICAL_ORDER
mqGetMsgOpts.Options = mqGetMsgOpts.Options + MQC.MQGMO_SYNCPOINT
mqGetMsgOpts.Options = mqGetMsgOpts.Options + MQGMO_ALL_MSGS_AVAILABLE
mqGetMsgOpts.Version = MQC.MQGMO_VERSION_2

While (mqe.Reason <> MQRC_NO_MSG_AVAILABLE)
Try
mqQueue.Get(mqMsg, mqGetMsgOpts)
str = mqMsg.ReadString(mqMsg.MessageLength)
Catch mqe
'* report the error
End Try
End While
mqQueue.Close()
End Sub
Back to top
View user's profile Send private message
mqonnet
PostPosted: Wed Jul 23, 2003 7:20 pm    Post subject: Reply with quote

Grand Master

Joined: 18 Feb 2002
Posts: 1114
Location: Boston, Ma, Usa.

I havent used VB.net myself, but i would expect VB to be on the same lines as C/C++ and be using similar function calls etc. Since your code looked more like Java, i gave you the method in java that does the job for you.

From your recent post it is not very clear if your problem is solved or not. But in any case, i would recommend going through the sample apps supplied for VB. It looked more like C samples. In which case, you may as well do something like Md.Version = 2. Double check this in the respective manuals/samples.

Cheers
Kumar
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Get segmental Messages
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.