Updates to My ByteArray Class

Last year, I posted a blog item called Java’s Missing Byte Array Class regarding the missing ByteArray class in Java and I published my ByteArray class for all to use.

I have fixed a bug in the getBytes method and added 2 new methods:

  • public int convertToInt_BE()
  • public void replaceAndResize(byte[] oldByteArray, byte[] newByteArray)

I have generated the JavaDocs for the ByteArray class. I zipped up the JavaDocs, Test_ByteArray.java program and the ByteArray class. You can download the source code from here.

Simply copy the ByteArray class to your utility (or handler) package of your application and then start using it.

Regards,
Roger Lacroix
Capitalware Inc.

HPE NonStop, IBM i (OS/400), Java, JMS, Linux, macOS (Mac OS X), Open Source, Programming, Raspberry Pi, Unix, Windows, z/OS Comments Off on Updates to My ByteArray Class

Ubuntu 21.04 Released

Canonical has just released Ubuntu v21.04.
http://releases.ubuntu.com/21.04/

Super-fast, easy to use and free, the Ubuntu operating system powers millions of desktops, netbooks and servers around the world. Ubuntu does everything you need it to. It’ll work with your existing PC files, printers, cameras and MP3 players. And it comes with thousands of free apps.

Regards,
Roger Lacroix
Capitalware Inc.

Linux, Open Source, Operating Systems Comments Off on Ubuntu 21.04 Released

Programmatically Get IBM MQ Version for Both Client and Queue Manager

Recently, on both StackOverflow and mqseries.net, people have been asking about getting both the client and queue manager versions numbers for MQ.

It is pretty easy to get both the client and queue manager from the command line.

For the IBM MQ installation that is running the queue manager, you simply issue the following command:

dspmqver

To determine the MQ JAR file version number, you simply issue the following command:

java -jar com.ibm.mq.jar

or if you are using the com.ibm.mq.allclient.jar MQ JAR then do:

java -jar com.ibm.mq.allclient.jar

Now in theory, an MQ application should not care about what version of the queue manager it is connecting to or what MQ JAR files the application is using but sometimes it is nice to have all of the information in an application log file, so that you don’t have chase for the information after the fact.

IBM has done a terrible job making this kind of information available from the MQJavaLevel class file found in the found in com.ibm.mq.jar and com.ibm.mq.allclient.jar files.

A long time ago, I stumbled across the MQJavaLevel class and did a bunch of testing to figure how to programmatically get the version information from it and write it to the application’s log file.

Note: The following is undocumented and is from me beating MQ up a little bit. 🙂

The MQJavaLevel class has a method called queryValue. It takes an integer parameter between 0 to 4 and returns a String value.

  • 0 – will retrieve the MQ name i.e. IBM MQ classes for Java
  • 1 – will retrieve the MQ version i.e. 9.1.3.0
  • 2 – will retrieve the MQ level value i.e. p913-L190628
  • 3 – will retrieve the MQ build type i.e. Production
  • 4 – will retrieve the MQ JAR file location i.e. D:/Program Files/IBM/MQ/java/lib/com.ibm.mq.jar

The problem is, IBM never exposed the queryValue method. It is so weird. So, the only way around it is to create your own Java class that extends the MQJavaLevel class. You can have a look at the MQLevel class in the open source project called Universal File Mover (UFM).

It is a simple class:

package com.capitalware.ufm.mq;

import com.ibm.mq.MQJavaLevel;

public class MQLevel extends MQJavaLevel
{
   /**
    * The constructor
    */
   public MQLevel()
   {
      super();
   }

   /**
    * Get the IBM name for the MQ JAR class.
    * @return
    */
   public String getName()
   {
      return queryValue(0);
   }

   /**
    * Get the version of the MQ JAR class.
    * @return
    */
   public String getVersion()
   {
      return queryValue(1);
   }
}

Therefore, at the top/beginning of your Java and/or Java/JMS code, if you want to dump out the MQ name and version then do the following:

try
{
   ClassLoader classLoader = ClassLoader.getSystemClassLoader();
   Class.forName("com.ibm.mq.MQJavaLevel", false, classLoader);
   MQLevel mql = new MQLevel();
   System.out.println("MQ JAR Version = " + mql.getName()+" V"+mql.getVersion());
}
catch(ClassNotFoundException e)
{
   System.out.println("MQ is not in the CLASSPATH.");
}

The output will look like:

MQ JAR Version = IBM MQ classes for Java V9.1.3.0

The above code will work for both Java and Java/JMS applications.

Getting the queue manager’s version number is a little different. You cannot directly get the version number from the MQQueueManager class or JMS Connection class. But you can get the queue manager’s command level which is the first 3 digits of the version number. 9.1.3 vs 9.1.3.0

For a Java (non-JMS) programs, you can do the following:

MQQueueManager qMgr = new MQQueueManager(qMgrName);
System.out.println("MQ Command Level: " + qMgr.getCommandLevel());

For a Java/JMS programs, you can do the following:

Connection conn = cf.createConnection(userid, password);
JmsPropertyContext propertyContext = (JmsPropertyContext) conn;
System.out.println("MQ Command Level: " + propertyContext.getIntProperty(WMQConstants.WMQ_COMMAND_LEVEL));

If you truly want the queue manager’s version number then you will need to use MQ PCF command.

Here is how to do it:

MQQueueManager qMgr = new MQQueueManager(qMgrName);
PCFMessageAgent agent = new PCFMessageAgent(qMgr);
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_MGR);
request.addParameter(CMQCFC.MQIACF_Q_MGR_ATTRS, new int [] { CMQC.MQCA_VERSION });
PCFMessage[] responses = agent.send(request);

for (PCFMessage response : responses)
{
   if (response.getCompCode() == CMQC.MQCC_OK)
   {
      System.out.println("MQ Version: " + response.getStringParameterValue(CMQC.MQCA_VERSION));
   }
}

Regards,
Roger Lacroix
Capitalware Inc.

HPE NonStop, IBM i (OS/400), IBM MQ, IBM MQ Appliance, Java, JMS, Linux, macOS (Mac OS X), Open Source, PCF, Programming, Raspberry Pi, Unix, Windows Comments Off on Programmatically Get IBM MQ Version for Both Client and Queue Manager

FreeBSD v13.0 Released

The FreeBSD Release Engineering Team has just released FreeBSD v13.0.
https://www.freebsd.org/releases/13.0R/announce.html

FreeBSD is an advanced operating system for modern server, desktop, and embedded computer platforms. FreeBSD’s code base has undergone over thirty years of continuous development, improvement, and optimization. It is developed and maintained by a large team of individuals. FreeBSD provides advanced networking, impressive security features, and world class performance and is used by some of the world’s busiest web sites and most pervasive embedded networking and storage devices.

Regards,
Roger Lacroix
Capitalware Inc.

Open Source, Operating Systems Comments Off on FreeBSD v13.0 Released

WebSphere MQ Fix Pack 5.3.1.17 for HP NonStop Server Released

IBM has just released Fix Pack 5.3.1.17 for WebSphere MQ for HP NonStop Server:
https://www.ibm.com/support/pages/node/6427757

Regards,
Roger Lacroix
Capitalware Inc.

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

IBM is Open Sourcing Watson IoT Platform Message Gateway (formerly IBM MessageSight)

Back in November 2020, IBM announced that they would be withdrawing/discontinuing IBM IoT MessageSight and IBM Watson IoT Platform Message Gateway.

The other day, IBM announced that they would be donating the source code for Watson IoT Platform Message Gateway (formerly IBM MessageSight) to Eclipse.

You can read about the new Eclipse project here: https://projects.eclipse.org/proposals/eclipse-amlen

Regards,
Roger Lacroix
Capitalware Inc.

Linux, MQTT, Unix, Windows Comments Off on IBM is Open Sourcing Watson IoT Platform Message Gateway (formerly IBM MessageSight)

IBM MQ Fix Pack 9.2.0.2 Released

IBM has just released Fix Pack 9.2.0.2 for IBM MQ V9.2 LTS:
https://www.ibm.com/support/pages/node/6434245

Regards,
Roger Lacroix
Capitalware Inc.

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

All Java and JVM features since JDK 8 to 16

David Csakvari has a blog posting called: A categorized list of all Java and JVM features since JDK 8 to 16

If you ever wondered or needed to know what has changed between releases of Java, David Csakvari’s blog posting has an excellent list of changes.

On the flip side, if you are a new Java or Java/JMS developer and need tutorials and/or examples of the different Java libraries and how they work then check out Jenkov’s web page called: Tutorials for Software Developers and Technopreneurs. The web page has the various features of Java categorized into useful topics.

Regards,
Roger Lacroix
Capitalware Inc.

HPE NonStop, IBM i (OS/400), Java, JMS, Linux, macOS (Mac OS X), Programming, Raspberry Pi, Unix, Windows, z/OS Comments Off on All Java and JVM features since JDK 8 to 16

IBM MQ V9.2.2 Announced

IBM has announced IBM MQ V9.2.2:
https://www.ibm.com/common/ssi/cgi-bin/ssialias?infotype=AN&subtype=CA&htmlfid=897/ENUS221-075

Highlights:

MQ 9.2.2:
– Advanced Message Queuing Protocol (AMQP) browse support

MQ Advanced 9.2.2:
– The capabilities listed in MQ 9.2.2
– New ordering options for nonproduction workloads
– An early release of “native high-availability”, which is made available for demonstration purposes for clients deploying container-based queue managers to IBM Cloud Pak for Integration using the MQ certified container
– MQ Managed File Transfer commands to start and stop resource monitors and assets to simplify deployment in containers
– MQ Advanced Message Security password protection enhancements
– RDQM HA failed resource action identification and resolution, and high availability (HA) and disaster recovery (DR) last “in sync” time information.

MQ Appliance 9.2.2 firmware:
– The capabilities in MQ 9.2.2
– HA failed resource action identification and resolution
– MQ Appliance 9.2.2 firmware available for MQ Appliance M2001 and MQ Appliance M2002

Planned availability for IBM MQ V9.2.2 is March 25, 2021 for Electronic software delivery.

IBM MQ (aka WebSphere MQ) homepage
https://www.ibm.com/products/mq

Regards,
Roger Lacroix
Capitalware Inc.

Fix Packs for MQ, IBM MQ, IBM MQ Appliance, Unix, Windows, z/OS Comments Off on IBM MQ V9.2.2 Announced

Java 16 Released

Oracle has just released Java 16.
https://blogs.oracle.com/java-platform-group/the-arrival-of-java-16

Java Platform, Standard Edition (Java SE) lets you develop and deploy Java applications on desktops and servers, as well as in today’s demanding embedded environments. Java offers the rich user interface, performance, versatility, portability, and security that today’s applicationsrequire.

Regards,
Roger Lacroix
Capitalware Inc.

IBM i (OS/400), Java, JMS, Linux, macOS (Mac OS X), Programming, Raspberry Pi, Unix, Windows, z/OS Comments Off on Java 16 Released