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 » MQPMO_LOGICAL_ORDER, 2046 Return code

Post new topic  Reply to topic
 MQPMO_LOGICAL_ORDER, 2046 Return code « View previous topic :: View next topic » 
Author Message
Oscar
PostPosted: Mon Oct 03, 2005 2:51 pm    Post subject: MQPMO_LOGICAL_ORDER, 2046 Return code Reply with quote

Newbie

Joined: 03 Oct 2005
Posts: 6

I am using VB6 to write to a queue manager on Version 5.3. I don't seem to be setting the options correctly as I always get the 2046 return code. Here's the code where I set up the Message Descriptor and the Put Message Options:

MQMsgDesc.Format = MQFMT_STRING
MQMsgDesc.Version = MQMD_VERSION_2
MQMsgDesc.MsgFlags = MQMF_MSG_IN_GROUP
MQMsgDesc.GroupId = MQGI_NONE
MQPutOpts.Version = MQPMO_CURRENT_VERSION
MQPutOpts.Options = MQPMO_LOGICAL_ORDER

Do I have to set something else up as well?
_________________
Oscar Hopper
Jack of all trades, master of None
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Oct 03, 2005 7:29 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Isn't LOGICAL_ORDER a GET option ??

Enjoy
Back to top
View user's profile Send private message Send e-mail
hopsala
PostPosted: Mon Oct 03, 2005 8:08 pm    Post subject: Reply with quote

Guardian

Joined: 24 Sep 2004
Posts: 960

fjb_saper wrote:
Isn't LOGICAL_ORDER a GET option ??

Not exclusively. If you use MQPMO_LOGICAL_ORDER with MQPUT, MQ will set MsgSeqNumber (and Offset, if applicable) automatically to 1,2,3 etc; if you do not use it, you have to handle indexing manually.

Application Programming Guide, Chapter 10 wrote:
For example, assume that the group consists of four logical messages. The putting
application looks like this:

PMO.Options = MQPMO_LOGICAL_ORDER

MQPUT MD.MsgFlags = MQMF_MSG_IN_GROUP
MQPUT MD.MsgFlags = MQMF_MSG_IN_GROUP
MQPUT MD.MsgFlags = MQMF_MSG_IN_GROUP
MQPUT MD.MsgFlags = MQMF_LAST_MSG_IN_GROUP
Back to top
View user's profile Send private message
mqmhr
PostPosted: Mon Oct 03, 2005 8:13 pm    Post subject: Reply with quote

Centurion

Joined: 28 Dec 2004
Posts: 105

MQPMO_LOGICAL_ORDER is a put option to specify that the message is part of a message group, whch is what Oscar is trying to do. But the null group identifier MQGI_NONE might not be a valid group identifier for a message in a group and hence this option conflicts with MQMF_MSG_IN_GROUP.

The AP Reference says that a message group is a
Quote:
...a set of one or more logical messages that have the same nonnull group identifier
Back to top
View user's profile Send private message
hopsala
PostPosted: Mon Oct 03, 2005 8:22 pm    Post subject: Reply with quote

Guardian

Joined: 24 Sep 2004
Posts: 960

mqmhr wrote:
MQPMO_LOGICAL_ORDER is a put option to specify that the message is part of a message group, whch is what Oscar is trying to do. But the null group identifier MQGI_NONE might not be a valid group identifier for a message in a group and hence this option conflicts with MQMF_MSG_IN_GROUP.

That's incorrect - setting the groupId to NONE simply means that MQ will choose a GroupId for you, exactly as in CorrlId and MsgId; see the sample in the upcoming link.

Concerning the original poster's question - There is a sample code at the repository (MQSeries.net C/C++ repository - choose "putgroup"); a quick look shows that you didn't use "pmo.Version = MQPMO_VERSION_2;", maybe that's you're prob, but I doubt it. Please post all relevant code and we'll have a look.

(Hopefully, you didn't forget setting MQOO_OUTPUT... )
Back to top
View user's profile Send private message
Oscar
PostPosted: Tue Oct 04, 2005 7:13 am    Post subject: My code Reply with quote

Newbie

Joined: 03 Oct 2005
Posts: 6

I have a subroutine just for PUTting the message. I make the connection and set the output type in another sub. If I remove the MQPMO_LOGICAL_ORDER, the put works.

Both messages have the same group id, but they also have the same sequence number: 1. (According to MQ Explorer) The weird part about that is, every put seems to use the same group id? Even if I close the app and restart it. Anyway, that's the second part of my issue. I just thought that MQ would automatically handle the sequencing for me.

Public Sub PutMessage(hMQConn As Long, hMQObj As Long, _
sBuffer As String, lMesgLen As Long)
Dim MQMsgDesc As MQMD ' MQ Message Descriptor
Dim MQPutOpts As MQPMO ' MQPUT Options
Dim lCompCode As Long ' Completion code
Dim lReason As Long ' Reason code
Dim sCompMsg As String ' Message to display when PUT call finished

' Set Message Descriptor to default values
MQMD_DEFAULTS MQMsgDesc

' Set PUT options to default values
MQPMO_DEFAULTS MQPutOpts

MQPutOpts.Version = MQPMO_VERSION_2
MQPutOpts.Options = MQPMO_FAIL_IF_QUIESCING + _
MQPMO_NO_SYNCPOINT + _
MQPMO_LOGICAL_ORDER

MQMsgDesc.Format = MQFMT_STRING
MQMsgDesc.Version = MQMD_VERSION_2
MQMsgDesc.MsgFlags = MQMF_MSG_IN_GROUP
MQMsgDesc.GroupId = MQGI_NONE

' PUT message to queue
MQPUT hMQConn, hMQObj, MQMsgDesc, MQPutOpts, lMesgLen, _
sBuffer, lCompCode, lReason

If lCompCode <> MQCC_OK Then
ShowMQError Trim(cmbQMgr.Text), Trim(cmbQueue.Text), _
lCompCode, lReason, "PUT # 1"
End If

MQMsgDesc.MsgFlags = MQMF_LAST_MSG_IN_GROUP

MQPUT hMQConn, hMQObj, MQMsgDesc, MQPutOpts, lMesgLen, _
sBuffer, lCompCode, lReason

If lCompCode <> MQCC_OK Then
ShowMQError Trim(cmbQMgr.Text), Trim(cmbQueue.Text), _
lCompCode, lReason, "PUT #2"
End If
End Sub
_________________
Oscar Hopper
Jack of all trades, master of None
Back to top
View user's profile Send private message
Oscar
PostPosted: Tue Oct 04, 2005 7:56 am    Post subject: Reply with quote

Newbie

Joined: 03 Oct 2005
Posts: 6

Please disregard the part about MQ using the same group id. After I had some coffee in me, I found that the group id's were different

But, I'm still getting the 2046, MQRC_OPTIONS_ERROR when I specify MQPMO_LOGICAL_ORDER.
_________________
Oscar Hopper
Jack of all trades, master of None
Back to top
View user's profile Send private message
hopsala
PostPosted: Tue Oct 04, 2005 8:09 am    Post subject: Reply with quote

Guardian

Joined: 24 Sep 2004
Posts: 960

Well, I don't see anything wrong in casual glance, and I haven't the time to start debugging your code, plus it really isn't my job look at the sample I posted and try to locate the differences...

Don't forget to post the solution when you come across it, Luck!
Back to top
View user's profile Send private message
Oscar
PostPosted: Tue Oct 04, 2005 9:27 am    Post subject: I found it Reply with quote

Newbie

Joined: 03 Oct 2005
Posts: 6

This is a very funky problem, and I don't know if it's specific to me or not.

I set a breakpoint in the code where I set the options, and moused over each of my options to see the values:

MQPMO_FAIL_IF_QUIESCING = 8192
MQPMO_NO_SYNCPOINT = 4
MQPMO_LOGICAL_ORDER = -32768

I looked up MQPMO_LOGICAL_ORDER in the cmqb.bas, and it is defined as &H8000 (32768) ... positive. So, somewhere in my system (VB, Windows XP, the little gnomes in that box), the conversion for the logical order constants (MQGMO_LOGICAL_ORDER is defined the same way) are being incorrectly converted.

When I change the put options to:
MQPutOpts.Options = MQPMO_FAIL_IF_QUIESCING + _
MQPMO_NO_SYNCPOINT + _
32768

the program works just as I would expect it to.

Thanks to everyone who took a look and tried to help.
_________________
Oscar Hopper
Jack of all trades, master of None
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Tue Oct 04, 2005 10:05 am    Post subject: Re: I found it Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

Oscar wrote:

MQPMO_LOGICAL_ORDER = -32768


Huh. Exactly what version of MQ are you compiling with? I know u said the QM was 5.3, but what about the libs that you are using for your app? What version, including CSD level? Maybe this is fixed in a later CSD?
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Oscar
PostPosted: Tue Oct 04, 2005 11:14 am    Post subject: Reply with quote

Newbie

Joined: 03 Oct 2005
Posts: 6

I'm usind CSD09. The cmqb.bas module from the tools directory has a last modified date of 12/13/2004.

I haven't found anything on IBM's support sight that anyone else has had this problem.
_________________
Oscar Hopper
Jack of all trades, master of None
Back to top
View user's profile Send private message
Oscar
PostPosted: Fri Oct 07, 2005 10:42 am    Post subject: Reply with quote

Newbie

Joined: 03 Oct 2005
Posts: 6

I found this on a VB message board. My problem was a VB limitation. I had to change the constants to read &H8000& and everything worked. Maybe IBM should distribute the shared modules with this definition?

Anyway, the explanation:
Philip Morley <philip.morley@bmb.com.bh> wrote in message
news:39bfde9c$3@news.devx.com...
>
> Hi,
>
> The following statement in VB
> &H8000
> gives a value of -32768, when the actual value is 32768
> (8 * 16 ^3).
>
> Does anyone have any ideal why VB behaves thus.

because the value fits into a 16bit Integer field but VB interprets the high
bit as the sign bit so it becomes a negative number. Use CLNG("&H8000") or
VAL("&H8000&") in expressions or just &H8000& when used as a constant - the
trailing & forces it to be typed as a 32-bit integer.
_________________
Oscar Hopper
Jack of all trades, master of None
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 » MQPMO_LOGICAL_ORDER, 2046 Return code
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.