Krista Valentine will be Speaking at MQTC v2.0.1.8

Krista Valentine of OpenLogix will be presenting the following sessions at MQ Technical Conference v2.0.1.8 (MQTC):

    Krista Valentine’s Vendor Sessions:

  • Licensing Lingo – The Users Guide to IBM Licensing

For more information about MQTC, please go to:
https://www.mqtechconference.com

Regards,
Roger Lacroix
Capitalware Inc.

Education, IBM MQ, MQ Technical Conference Comments Off on Krista Valentine will be Speaking at MQTC v2.0.1.8

IBM MQ Fix Pack 9.0.0.5 Released

IBM has just released Fix Pack 9.0.0.5 for IBM MQ V9.0 LTS
https://www.ibm.com/support/docview.wss?uid=ibm10720257

Regards,
Roger Lacroix
Capitalware Inc.

Fix Packs for MQ, IBM i (OS/400), IBM MQ, Linux, Unix, Windows Comments Off on IBM MQ Fix Pack 9.0.0.5 Released

Richard Nikula will be Speaking at MQTC v2.0.1.8

Richard Nikula of Nastel will be presenting the following sessions at MQ Technical Conference v2.0.1.8 (MQTC):

    Richard Nikula’s Technical Session:

  • Using IBM Activity Trace to better understand your application logic
    Richard Nikula’s Vendor Sessions:

  • Delivering improved service with Nastel AutoPilot
  • Tracking messages in your middleware environment with Nastel X-Ray
  • If you can’t clone yourself, Delegate!

For more information about MQTC, please go to:
https://www.mqtechconference.com

Regards,
Roger Lacroix
Capitalware Inc.

Education, IBM MQ, MQ Technical Conference Comments Off on Richard Nikula will be Speaking at MQTC v2.0.1.8

Avada Software’s Session at MQTC v2.0.1.8

Rob Sordillo of Avada Software will be doing the following vendor session at MQ Technical Conference v2.0.1.8 (MQTC):

    Rob Sordillo’s Vendor Sessions:

  • REST Easy with Infrared360

For more information about MQTC, please go to:
https://www.mqtechconference.com

Regards,
Roger Lacroix
Capitalware Inc.

Education, IBM MQ, MQ Technical Conference Comments Off on Avada Software’s Session at MQTC v2.0.1.8

MQ Visual Edit V2.4.0 Released

Capitalware Inc. would like to announce the official release of MQ Visual Edit v2.4.0. This is a FREE upgrade for ALL licensed users of MQ Visual Edit V2. MQ Visual Edit allows users to view, manipulate and manage messages in a queue and/or topic of a IBM MQ queue manager and presents the data in a simplified format similar to a database utility or spreadsheet program.

For more information about MQ Visual Edit go to:
https://www.capitalware.com/mqve_overview.html

    Changes for MQ Visual Edit v2.4.0:

  • Updated Backup and BackupTopic functions to support writing the messages to an SQLite database.
  • Updated Restore and RestoreTopic functions to support reading the messages from an SQLite database.
  • Updated PutServer, SIMClient, SIMServer and PublishServer functions to support reading the messages from an SQLite database.
  • Changed the web call to capitalware.com server for license registration from http to https.
  • Fixed an issue with Named Properties object being null on Message Edit window
  • Fixed an issue with Backup Queue, Backup Topic and message conversion
  • Fixed an issue with Export Message and message conversion
  • Fixed an issue with MQMD on the Message Edit window
  • Fixed an issue with Named Properties when creating a JMS message
  • Added extra code to handle issues with opening and/or writing to the logfile when the OS is using file redirection.
  • Fixed an issue with the message being deselected when the message is saved in the Message Edit window
  • For z/OS queue managers, added code to allow the user to select the indexing of the z/OS shared queue.
  • Added UserId compatibility mode on the UserId panel of the Queue Manager Access Profile window. Connectivity will use MQCSP structure by default.
  • Updated docs (English only)

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, IBM MQ, IBM MQ Appliance, Linux, macOS (Mac OS X), MQ Visual Edit, Windows Comments Off on MQ Visual Edit V2.4.0 Released

MQ Visual Browse V2.4.0 Released

Capitalware Inc. would like to announce the official release of MQ Visual Browse v2.4.0. This is a FREE upgrade for ALL licensed users of MQ Visual Browse V2. MQ Visual Browse allows users to view messages in a queue and/or topic of a IBM MQ queue manager and presents the data in a simplified format similar to a database utility or spreadsheet program.

For more information about MQ Visual Browse go to:
https://www.capitalware.com/mqvb_overview.html

    Changes for MQ Visual Browse v2.4.0:

  • Updated Restore and RestoreTopic functions to support reading the messages from an SQLite database.
  • Changed the web call to capitalware.com server for license registration from http to https.
  • Fixed an issue with Named Properties object being null on Message Edit window
  • Fixed an issue with Backup Topic and message conversion
  • Fixed an issue with Export Message and message conversion
  • Fixed an issue with MQMD on the Message Edit window
  • Fixed an issue with Named Properties when creating a JMS message
  • Added extra code to handle issues with opening and/or writing to the logfile when the OS is using file redirection.
  • Added UserId compatibility mode on the UserId panel of the Queue Manager Access Profile window. Connectivity will use MQCSP structure by default.
  • Updated docs (English only)

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, IBM MQ, IBM MQ Appliance, Linux, macOS (Mac OS X), MQ Visual Browse, Windows Comments Off on MQ Visual Browse V2.4.0 Released

MQ Batch Toolkit v3.1.0 Released

Capitalware Inc. would like to announce the official release of MQ Batch Toolkit v3.1.0. This is a FREE upgrade for ALL licensed users of MQ Batch Toolkit. MQ Batch Toolkit allows users to manipulate, monitor and manage messages in a queue of an IBM MQ (formally WebSphere MQ & MQSeries) queue manager from a command-line or shell scripting environment.

For more information about MQ Batch Toolkit go to:
https://www.capitalware.com/mqbt_overview.html

    Changes for MQ Batch Toolkit v3.1.0:

  • Updated Backup and BackupTopic functions to support writing the messages to an SQLite database.
  • Updated Restore and RestoreTopic functions to support reading the messages from an SQLite database.
  • Updated PutServer, SIMClient, SIMServer and PublishServer functions to support reading the messages from an SQLite database.
  • Changed the web call to capitalware.com server for license registration from http to https.
  • Updated AddProfile and AlterProfile to support UserId compatibility mode to send the UserId and Password as done in releases prior to IBM MQ V8.
  • Updated docs (English only)

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, IBM MQ, IBM MQ Appliance, Linux, macOS (Mac OS X), MQ Batch Toolkit, Windows Comments Off on MQ Batch Toolkit v3.1.0 Released

WebSphere MQ Fix Pack 5.3.1.15 for HP NonStop Server Released

IBM has just released Fix Pack 5.3.1.15 for WebSphere MQ for HP NonStop Server:
https://www.ibm.com/support/docview.wss?uid=ibm10719657

Regards,
Roger Lacroix
Capitalware Inc.

Fix Packs for MQ, HPE NonStop, IBM MQ Comments Off on WebSphere MQ Fix Pack 5.3.1.15 for HP NonStop Server Released

MQTC v2.0.1.8 Platinum Sponsor: Nastel Technologies

Capitalware would like to announce that Nastel Technologies is a Platinum Sponsor of MQ Technical Conference v2.0.1.8 (MQTC).

For more information, please go to: https://www.mqtechconference.com

Regards,
Roger Lacroix
Capitalware Inc.

Education, IBM MQ, MQ Technical Conference Comments Off on MQTC v2.0.1.8 Platinum Sponsor: Nastel Technologies

Java MQ Code to List Queue Status

The other day I answered a question on StackOverflow about getting the LGETIME and LPUTIME attributes of queue status command. I figured I should also post the code here for everyone to read & use.

If you have done the runmqsc command for Queue Status of Type ‘Queue’ for all queues of a queue manager as follows:

DIS QSTATUS(*) TYPE(QUEUE)

And you wanted to do the same thing via a program, here is a fully functioning Java MQ example that will connect to a remote queue manager, issue a PCF “Inquire Queue Status” command, get the PCF response messages, loop through the PCF responses and output the information. You can download the source code from here.

For more information about the PCF “Inquire Queue Status” command, go to MQ KnowLedge Center here.

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Hashtable;

import com.ibm.mq.MQException;
import com.ibm.mq.MQQueueManager;
import com.ibm.mq.constants.CMQC;
import com.ibm.mq.constants.CMQCFC;
import com.ibm.mq.headers.MQDataException;
import com.ibm.mq.headers.pcf.PCFMessage;
import com.ibm.mq.headers.pcf.PCFMessageAgent;

/**
 * Program Name
 *  MQListQueueStatus01
 *
 * Description
 *  This java class issues a PCF "inquire queue status" request message for all ("*") queues 
 *  of a remote queue manager. 
 *
 * Sample Command Line Parameters
 *  -m MQA1 -h 127.0.0.1 -p 1414 -c TEST.CHL -q TEST.Q1 -u UserID -x Password
 *
 * @author Roger Lacroix
 */
public class MQListQueueStatus01
{
   private static final SimpleDateFormat  LOGGER_TIMESTAMP = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS");

   private Hashtable<String,String> params;
   private Hashtable<String,Object> mqht;
   private String qMgrName;

   public MQListQueueStatus01()
   {
      super();
      params = new Hashtable<String,String>();
      mqht = new Hashtable<String,Object>();
   }

   /**
    * Make sure the required parameters are present.
    * @return true/false
    */
   private boolean allParamsPresent()
   {
      boolean b = params.containsKey("-h") && params.containsKey("-p") &&
                  params.containsKey("-c") && params.containsKey("-m") &&
                  params.containsKey("-u") && params.containsKey("-x");
      if (b)
      {
         try
         {
            Integer.parseInt((String) params.get("-p"));
         }
         catch (NumberFormatException e)
         {
            b = false;
         }
      }

      return b;
   }

   /**
    * Extract the command-line parameters and initialize the MQ HashTable.
    * @param args
    * @throws IllegalArgumentException
    */
   private void init(String[] args) throws IllegalArgumentException
   {
      int port = 1414;
      if (args.length > 0 && (args.length % 2) == 0)
      {
         for (int i = 0; i < args.length; i += 2)
         {
            params.put(args[i], args[i + 1]);
         }
      }
      else
      {
         throw new IllegalArgumentException();
      }

      if (allParamsPresent())
      {
         qMgrName = (String) params.get("-m");
         
         try
         {
            port = Integer.parseInt((String) params.get("-p"));
         }
         catch (NumberFormatException e)
         {
            port = 1414;
         }
         
         mqht.put(CMQC.CHANNEL_PROPERTY, params.get("-c"));
         mqht.put(CMQC.HOST_NAME_PROPERTY, params.get("-h"));
         mqht.put(CMQC.PORT_PROPERTY, new Integer(port));
         mqht.put(CMQC.USER_ID_PROPERTY, params.get("-u"));
         mqht.put(CMQC.PASSWORD_PROPERTY, params.get("-x"));

         // I don't want to see MQ exceptions at the console.
         MQException.log = null;
      }
      else
      {
         throw new IllegalArgumentException();
      }
   }
   
   private void doPCF()
   {
      MQQueueManager qMgr = null;
      PCFMessageAgent agent = null;
      PCFMessage   request = null;
      PCFMessage[] responses = null;
      
      try
      {
         qMgr = new MQQueueManager(qMgrName, mqht);
         MQListQueueStatus01.logger("successfully connected to "+ qMgrName);

         agent = new PCFMessageAgent(qMgr);
         MQListQueueStatus01.logger("successfully created agent");
      
         // https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.ref.adm.doc/q087880_.htm
         request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_STATUS);
         
         /**
          * You can explicitly set a queue name like "TEST.Q1" or
          * use a wild card like "TEST.*"
          */
         request.addParameter(CMQC.MQCA_Q_NAME, "*");
         
         // Add a parameter to select TYPE of QUEUE (rather than HANDLE i.e. MQIACF_Q_HANDLE)
         request.addParameter(CMQCFC.MQIACF_Q_STATUS_TYPE, CMQCFC.MQIACF_Q_STATUS);

         // Add a parameter that selects all of the attributes we want
         request.addParameter(CMQCFC.MQIACF_Q_STATUS_ATTRS,
                              new int [] { CMQC.MQCA_Q_NAME,
                                           CMQC.MQIA_CURRENT_Q_DEPTH,
                                           CMQC.MQIA_OPEN_INPUT_COUNT,
                                           CMQC.MQIA_OPEN_OUTPUT_COUNT,
                                           CMQCFC.MQCACF_LAST_PUT_DATE,
                                           CMQCFC.MQCACF_LAST_PUT_TIME,
                                           CMQCFC.MQCACF_LAST_GET_DATE,
                                           CMQCFC.MQCACF_LAST_GET_TIME,
                                         });
         /**
          * Other attributes that can be used for TYPE(QUEUE)
          * - MQIA_MONITORING_Q
          * - MQCACF_MEDIA_LOG_EXTENT_NAME
          * - MQIACF_OLDEST_MSG_AGE
          * - MQIACF_Q_TIME_INDICATOR
          * - MQIACF_UNCOMMITTED_MSGS
          */

         responses = agent.send(request);
         
         for (int i = 0; i < responses.length; i++)
         {
            if ( ((responses[i]).getCompCode() == CMQC.MQCC_OK) &&
                 ((responses[i]).getParameterValue(CMQC.MQCA_Q_NAME) != null) )
            {
               String name = responses[i].getStringParameterValue(CMQC.MQCA_Q_NAME);
               if (name != null)
                  name = name.trim();

               int depth = responses[i].getIntParameterValue(CMQC.MQIA_CURRENT_Q_DEPTH);
               int iprocs = responses[i].getIntParameterValue(CMQC.MQIA_OPEN_INPUT_COUNT);
               int oprocs = responses[i].getIntParameterValue(CMQC.MQIA_OPEN_OUTPUT_COUNT);
               
               String lastPutDate = responses[i].getStringParameterValue(CMQCFC.MQCACF_LAST_PUT_DATE);
               if (lastPutDate != null)
                  lastPutDate = lastPutDate.trim();

               String lastPutTime = responses[i].getStringParameterValue(CMQCFC.MQCACF_LAST_PUT_TIME);
               if (lastPutTime != null)
                  lastPutTime = lastPutTime.trim();

               String lastGetDate = responses[i].getStringParameterValue(CMQCFC.MQCACF_LAST_GET_DATE);
               if (lastGetDate != null)
                  lastGetDate = lastGetDate.trim();

               String lastGetTime = responses[i].getStringParameterValue(CMQCFC.MQCACF_LAST_GET_TIME);
               if (lastGetTime != null)
                  lastGetTime = lastGetTime.trim();

               MQListQueueStatus01.logger("Name="+name + " : depth="+depth + " : iprocs="+iprocs+" : oprocs="+oprocs+" : lastPutDate='"+lastPutDate+"' : lastPutTime='"+lastPutTime+"' : lastGetDate='"+lastGetDate+"' : lastGetTime='"+lastGetTime+"'");
            }
         }
      }
      catch (MQException e)
      {
         MQListQueueStatus01.logger("CC=" +e.completionCode + " : RC=" + e.reasonCode);
      }
      catch (IOException e)
      {
         MQListQueueStatus01.logger("IOException:" +e.getLocalizedMessage());
      }
      catch (MQDataException e)
      {
         MQListQueueStatus01.logger("MQDataException:" +e.getLocalizedMessage());
      }
      finally
      {
         try
         {
            if (agent != null)
            {
               agent.disconnect();
               MQListQueueStatus01.logger("disconnected from agent");
            }
         }
         catch (MQDataException e)
         {
            MQListQueueStatus01.logger("CC=" +e.completionCode + " : RC=" + e.reasonCode);
         }

         try
         {
            if (qMgr != null)
            {
               qMgr.disconnect();
               MQListQueueStatus01.logger("disconnected from "+ qMgrName);
            }
         }
         catch (MQException e)
         {
            MQListQueueStatus01.logger("CC=" +e.completionCode + " : RC=" + e.reasonCode);
         }
      }
   }

   /**
    * A simple logger method
    * @param data
    */
   public static void logger(String data)
   {
      String className = Thread.currentThread().getStackTrace()[2].getClassName();

      // Remove the package info.
      if ( (className != null) && (className.lastIndexOf('.') != -1) )
         className = className.substring(className.lastIndexOf('.')+1);

      System.out.println(LOGGER_TIMESTAMP.format(new Date())+" "+className+": "+Thread.currentThread().getStackTrace()[2].getMethodName()+": "+data);
   }

   public static void main(String[] args)
   {
      MQListQueueStatus01 mqlqs = new MQListQueueStatus01();
      
      try
      {
         mqlqs.init(args);
         mqlqs.doPCF();
      }
      catch (IllegalArgumentException e)
      {
         MQListQueueStatus01.logger("Usage: java MQListQueueStatus01 -m QueueManagerName -h host -p port -c channel -u UserID -x Password");
         System.exit(1);
      }

      System.exit(0);
   }
}

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, HPE NonStop, IBM i (OS/400), IBM MQ, IBM MQ Appliance, Java, Linux, macOS (Mac OS X), Open Source, PCF, Programming, Unix, Windows Comments Off on Java MQ Code to List Queue Status