Note that there are some explanatory texts on larger screens.

plurals
  1. POperl mqseries read event messages
    primarykey
    data
    text
    <p>I want to read SYSTEM.ADMIN.QMGR.EVENT event messages. I can receive the messages, but the output format is not readable.</p> <p>This is the PERL sub I use for reading:</p> <pre><code> sub readEventMessage() { my $self = shift; my $qmgr = shift; # the name of the queue manager my $sourceq = shift; my $nmessages = shift; my $count = 0; my $sourcequeue = MQSeries::Queue-&gt;new ( QueueManager =&gt; $qmgr, Queue =&gt; $sourceq, #Mode =&gt; 'input', Options =&gt; MQOO_INPUT_SHARED | MQOO_BROWSE, )|| die ("Unable to instantiate $qmgr::$sourceq object\n"); while (1) { #my $returned_message = MQSeries::Message-&gt;new( Data =&gt;"" ); my $returned_message = MQSeries::Message-&gt;new(), #Data =&gt; { # Format =&gt; MQEVENT, #}, GetMsgOpts =&gt; { Options =&gt; MQSeries::MQGMO_BROWSE_NEXT | MQSeries::MQGMO_ACCEPT_TRUNCATED_MSG | MQSeries::MQGMO_FAIL_IF_QUIESCING } ; my $rc=$sourcequeue-&gt;Get( Message =&gt; $returned_message); if ($rc == 1) { my $msg_data = $returned_message-&gt;Data(); #print "returned EVENT message\t======&gt;\n"; #print Dumper($msg_data); #print $msg_data."\n"; $count++; my $msg_header = $returned_message-&gt;MsgDesc(); $msg_header-&gt;{Data}=$msg_data; foreach (keys %$msg_header) { my $arg = "$_:$msg_header-&gt;{$_}"; # # encode the data # $arg=~s/\\/\\\\/g; $arg=~s/\n/\\n/g; if ( $arg=~/^\s*$/ ) { next; } print "\n$arg"; } if ( defined $nmessages ) { if ( $nmessages &lt; ($count +1)) { last; } } } elsif ($rc == -1) { my $status="\nNo more messages found on $sourceq\n \n"; last; } else { my $status="\nError retrieving messages from $sourceq." . "\nCompCode =" . $sourcequeue-&gt;CompCode() . "\nReason =" . $sourcequeue-&gt;Reason() . "\n"; last; } } } </code></pre> <p>The output I'm getting is:</p> <pre> PutTime:12065823 ReplyToQ: GroupId: UserIdentifier: Encoding:546 ApplIdentityData: BackoutCount:0 Format:MQEVENT MsgFlags:0 ApplOriginData: PutApplName:QM_H35299 MsgType:8 MsgSeqNumber:1 CodedCharSetId:850 AccountingToken: Offset:0 CorrelId: ReplyToQMgr:QM_H35299 Persistence:1 PutDate:20120607 OriginalLength:-1 PutApplType:7 Expiry:-1 Version:2 Priority:0 Data: $ ☺ , ☺ ☺ ☺ ☻ ♦ D ▀ 0 QM_H35299 ♥ ► ³♥ ♣ </pre> <p>Data format is MQEVENT, CCSI is 850, and encoding is 546.</p> <p>Any help is appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload