Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

MQSeries Put Options

by roperl (Beadle)
on Jun 05, 2018 at 18:35 UTC ( [id://1215952]=perlquestion: print w/replies, xml ) Need Help??

roperl has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to create a simple program to put a large messages onto a queue with MQSeries module.
I can put a message smaller than the MAXMSGL which is set to 4MB on my queue
I am trying to tell the program to allow the QMGR to segement the message. by using Message options MQMF_SEGMENTATION_ALLOWED
However I can't find where or how to add this option in
Here is my program output
./mqput.pl TQMGR PERL.MQI.TEST file2.txt MQPUT failed (Reason = 2030) +at ./mqput.pl line 45. Unable to put message onto queue. CompCode = 2 + Reason = 2030

My code
#!/opt/perl/bin/perl use MQSeries qw(:functions); use MQSeries::QueueManager; use MQSeries::Queue; use MQSeries::Message; use Storable; use Data::Dumper; $qmgr_obj=$ARGV[0]; $queue_obj=$ARGV[1]; $file = <$ARGV[2]>; open INPUT, "<$file" or die "Unable to open file, $!"; #change End of Record to undef undef $/; $data=<INPUT>; close INPUT; #change End of Record to back to \n $/ = "\n"; my $pmo = { Options => MQSeries::MQPMO_LOGICAL_ORDER }; my $queue = MQSeries::Queue->new ( QueueManager => $qmgr_obj, Queue => $queue_obj, Mode => output, ) or die("Unable to open queue.\n"); my $putmessage = MQSeries::Message->new( Data => $data ); $queue->Put( PutMsgOpts => $pmo, Message => $putmessage ) or die("Unable to put message onto queue.\n" . "CompCode = " . $queue->CompCode() . "\n" . "Reason = " . $queue->Reason() . "\n");

Can someone point me in the right direction?

Replies are listed 'Best First'.
Re: MQSeries Put Options
by morgon (Priest) on Jun 05, 2018 at 21:29 UTC
    Please format your code.

    And I think it should be an argument to the Put-call.

    Something along (I can't try it out, so this is only guess-work):

    $queue->Put( Message => $message, PutMsgOpts => { MQMF_SEGMENTATION_AL +LOWED => 1 } );
    so something along these lines... You need to double-check the documentation...
      I found what I was missing

      It's in the Message Descriptor options (MsgDesc)
      You need to specify allowing the QMGR to segment the message with MsgFlags => MQSeries::MQMF_SEGMENTATION_ALLOWED
      my $md = { MsgFlags => MQSeries::MQMF_SEGMENTATION_ALLOWED }; my $putmessage = MQSeries::Message->new( MsgDesc => $md ,Data => $data + );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1215952]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-26 08:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found