Author |
Message
|
jean.senden |
Posted: Tue Nov 27, 2007 4:48 am Post subject: PERL : MQPUT failed Reason = 2097 MQRC_CONTEXT_HANDLE_ERROR |
|
|
Newbie
Joined: 27 Nov 2007 Posts: 6 Location: Belgium
|
Hi All,
I'm currently testing a Perl script to move messages from one queue to the other and I get error 2097 MQRC_CONTEXT_HANDLE_ERROR. I am using the OO interface.
The script has been tested ok without the Context passing Options and related Context handle.
Now I have added the Context as from IBM MQSeries APG doc (I also looked into non-OO sample AdminMove.pl) and can't figure out what's wrong.
Thanks for your help,
Jean
Queue In
======
my $QueueIn = MQSeries::Queue->new (
QueueManager => $qmgrIn,
Queue => $QueueNIn,
Options => MQOO_INPUT_AS_Q_DEF | MQOO_FAIL_IF_QUIESCING | MQOO_SAVE_ALL_CONTEXT
);
Queue Out
=======
my $targetqueue = MQSeries::Queue->new
(
QueueManager => $qmgr,
Queue => $Queue,
Options => MQOO_INQUIRE | MQOO_OUTPUT | MQOO_FAIL_IF_QUIESCING | MQOO_PASS_ALL_CONTEXT
);
Get msg
=====
$QueueIn->Get('Message' => $myMessage, 'GetMsgOpts' => {Options => MQGMO_FAIL_IF_QUIESCING | MQGMO_SYNCPOINT | MQGMO_NO_WAIT}, 'Sync' => TRUE);
Put msg
=====
$targetqueue->Put( 'Message'=> $myMessage, 'PutMsgOpts' => {Options => MQPMO_FAIL_IF_QUIESCING | MQPMO_SYNCPOINT | MQPMO_PASS_ALL_CONTEXT, Context => $QueueIn}, 'Convert' => FALSE); |
|
Back to top |
|
 |
jean.senden |
Posted: Fri Nov 30, 2007 12:51 am Post subject: |
|
|
Newbie
Joined: 27 Nov 2007 Posts: 6 Location: Belgium
|
A PMR has been opened at IBM (source Ross Lonstein at Morgan Stanley : "tests show that the behavior for the underlying C-based MQI used by the Perl MQSeries module differs from the documentation and that the Java-based MQI behaves correctly"). |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Nov 30, 2007 7:05 am Post subject: |
|
|
Guest
|
You didn't say where in your app you received the context handle error.
Quote: |
Queue Out
=======
my $targetqueue = MQSeries::Queue->new
(
QueueManager => $qmgr,
Queue => $Queue,
Options => MQOO_INQUIRE | MQOO_OUTPUT | MQOO_FAIL_IF_QUIESCING | MQOO_PASS_ALL_CONTEXT
); |
Your code comment says you are opening the queue for output; yet your options say MQOO_INQUIRE |
|
Back to top |
|
 |
jean.senden |
Posted: Fri Nov 30, 2007 7:45 am Post subject: |
|
|
Newbie
Joined: 27 Nov 2007 Posts: 6 Location: Belgium
|
Thanks for your remarks
"You didn't say where in your app you received the context handle error. "
--> this is when the Put runs
"Your code comment says you are opening the queue for output; yet your options say MQOO_INQUIRE"
--> I do an Inquire and I also write to the queue. The Inquire is useful to track the progress and f.i. check that we don't try to move above the MaxQDepth targetqueue. The Inquire works ok.
I checked a similar script without the MQOO_INQUIRE option and it also failed at the Put level. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 30, 2007 7:51 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Did you build the modules yourself, or get them from somewhere?
Did you contact the authors?
Does the same code work if you don't specify the context options? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jean.senden |
Posted: Fri Nov 30, 2007 8:03 am Post subject: |
|
|
Newbie
Joined: 27 Nov 2007 Posts: 6 Location: Belgium
|
"Did you build the modules yourself, or get them from somewhere? "
We wrote the code ourselves.
"Did you contact the authors?"
Yes I contacted them and this is why I recorded this :
A PMR has been opened at IBM (source Ross Lonstein at Morgan Stanley : "tests show that the behavior for the underlying C-based MQI used by the Perl MQSeries module differs from the documentation and that the Java-based MQI behaves correctly").
"Does the same code work if you don't specify the context options?"
Yes the same code works but of course what we expect is the saving of the MQMD from the QueueIn and thus currently this code without Context is useless. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 30, 2007 8:11 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No, I mean did you compile the MQSeries modules locally, or did you get a compiled version of them from somewhere else? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jean.senden |
Posted: Fri Nov 30, 2007 9:05 am Post subject: |
|
|
Newbie
Joined: 27 Nov 2007 Posts: 6 Location: Belgium
|
- for MQ we took what IBM supplied for V5 and when shifting to V6 we had to copy a new version of amqdlls
- for Perl we are now at this
C:\Perl\Tools>ppm query mqseries
Querying target 1 (ActivePerl 5.8.6.811)
1. MQSeries [1.25] Perl Interface for Websphere MQSeries 6.0 API
If I remember well MQSeries-1.25.tar.tar was downloaded from CPAN. |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Nov 30, 2007 9:40 am Post subject: |
|
|
Guest
|
Quote: |
- for MQ we took what IBM supplied for V5 and when shifting to V6 we had to copy a new version of amqdlls |
And, by "shifting" you mean what? Did you install MQ V6 as described in the Quick Beginnings manual? |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 30, 2007 9:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I didn't know that ActiveState was shipping a ppm of the MQ modules these days... that's interesting to know.
I'd thought you still had to compile them yourself on Windows.
If you don't have a full and valid MQ Client or MQ Server install on the machine you're trying to run this code on, then you should not be surprised that you are getting weird issues.
Also note that these modules - the last I knew - DO NOT use the .NET managed client or the Java libraries - and so do REQUIRE the full MQ client or MQ Server install. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jean.senden |
Posted: Fri Dec 07, 2007 5:35 am Post subject: |
|
|
Newbie
Joined: 27 Nov 2007 Posts: 6 Location: Belgium
|
A workaround has been supplied by Ross Lonstein from Morgan Stanley (Context => $inputq->{Hobj} instead of Context => $inputq).
However there is well a bug within the OO interface (since Context => $inputq should eventually work : a queue object should be allowed to be passed).
Probably a new version will be CPANed after the New Year. |
|
Back to top |
|
 |
|