zoukankan      html  css  js  c++  java
  • perl 读取消息 队列深度不变

    [mqm@node01 queue]$ cat t1.pl 
     use MQSeries qw(:functions);
      use MQSeries::QueueManager;
      use MQSeries::Queue;
      use MQSeries::Message;
    
      #
      # Open a queue for input, loop getting messages, updating some
      # database with the data.
      #
      my $qmgr_obj = MQSeries::QueueManager->
        new(QueueManager => 'YWJZZF_CZCB_SEND');
      my $queue = MQSeries::Queue->
        new(QueueManager => $qmgr_obj,
            Queue        => 'CZ_RSP',
            Mode         => 'input_exclusive',
           ) or die("Unable to open queue.
    ");
        my $getmessage = MQSeries::Message->new();
    
        $queue->
          Get(Message => $getmessage,
              Sync    => 1,
             ) or die("Unable to get message
    " .
                      "CompCode = " . $queue->CompCode() . "
    " .
                      "Reason = " . $queue->Reason() . "
    ");
          print "第一条消息:===";
          print $getmessage->Data();
          print "
    ";
         # $qmgr_obj->Commit();
    
    
    
    
    读一条消息 队列深度不变;
    
    [mqm@node01 queue]$ perl t1.pl 
    第一条消息:===147258369

  • 相关阅读:
    linux ipsec
    inotify+rsync
    多实例tomcat
    Http和Nginx反代至Tomcat(LNMT、LAMT)
    cisco ipsec
    ansible基础
    Qt 汉字乱码
    Model/View
    面对焦虑
    QT中QWidget、QDialog及QMainWindow的区别
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349848.html
Copyright © 2011-2022 走看看