Join Microsoft and the Java developer community at Devnexus 2021

Microsoft is sponsoring and participating in Devnexus 2021, you can read more about it here:
https://techcommunity.microsoft.com/t5/apps-on-azure/join-microsoft-and-the-java-developer-community-at-devnexus-2021/ba-p/2114247?WT.mc_id=appsonazure-twitter-shboyer

Microsoft is excited to be sponsoring and participating in Devnexus 2021, and you might be wondering—what is Microsoft doing with Java? Quite a bit actually! We’ve been busy releasing new features and functionality to support Java apps on Azure, contributing to open-source projects, and improving our developer tools experience. Read on to find out more about Java at Microsoft and a get a preview of our sessions at Devnexus this year.

Java on Azure

Regards,
Roger Lacroix
Capitalware Inc.

Education, Java, JMS, Programming, Windows Comments Off on Join Microsoft and the Java developer community at Devnexus 2021

Part 2: Customer Question Regarding Automation with MQ Visual Edit

So, continuing with the customer, after they successfully tested MQ Batch Toolkit on Windows with a scheduled Windows batch script, they had a new question:

how can we be sure that the file.txt are send in the proper order ( chronological) from the 1 to last ( by time)

So, here are the batch/scripts files from this blog posting updated to handle getting a list of files by sorted date.

Windows Batch File:

@echo off
setlocal

cd /D C:\Capitalware\MQBT\

for /F %%f in ( 'dir C:\app\some\place\*.txt  /A-D-H /O:D /B' ) do (
  mqbt insert -p MQWT1 -q TEST.Q1 -S -f %%f
  move /Y %%f C:\app\some\place\backup\
)

endlocal

Notes:
– The “/A-D-H” parameter says do not include directories or hidden files.
– The “/O:D” parameter says sort by date.
– The “/B” parameter says only output the file name.

Linux/macOS/Raspberry Pi Script:

#!/bin/sh

PATH="/home/mqm/Capitalware/MQBT:$PATH"
export PATH

cd /home/mqm/Capitalware/MQBT/

ls -tr /app/some/place/*.txt | while read entry
do
  if [ -f "$entry" ];then
     mqbt insert -p MQWT1 -q TEST.Q1 -S -f "$entry"
     mv -f "$entry" /app/some/place/backup/
  fi
done

Notes:
– The “-tr” parameter of the ls command says sort files by time oldest first.

Hope that helps.

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, IBM MQ, IBM MQ Appliance, Linux, macOS (Mac OS X), MQ Batch Toolkit, MQ Visual Edit, Programming, Raspberry Pi, Windows Comments Off on Part 2: Customer Question Regarding Automation with MQ Visual Edit

Video: How to boost your business with IBM MQ

Marcus Kaye of IBM has created and posted a video on IBM MQ titled: “How to boost your business with IBM MQ

Regards,
Roger Lacroix
Capitalware Inc.

HPE NonStop, IBM i (OS/400), IBM MQ, IBM MQ Appliance, Linux, Unix, Windows, z/OS Comments Off on Video: How to boost your business with IBM MQ

Customer Question Regarding Automation with MQ Visual Edit

Yesterday, I got the following question from a customer:

We have a system that generates files every couple of minutes, they are stored in a folder. Can we send those message contents using MQ visual edit to an mq server as soon as they become available in that folder?

My answer to the customer was:

MQ Visual Edit is a GUI program and does not have any scripting abilities.

We have another program called MQ Batch Toolkit that is a command-line version of MQ Visual Edit (so to speak). You could create a schedule event for every minute or 2 which would list the files of the directory and pass each file to MQ Batch Toolkit for processing. After processing the script can move or delete the file.

The reason I decided to write about this question is because the question and answer seem super simple to implement but the devil is always in the details. The gotcha that some people may not think about is the timing issue when using wildcards for path and file names.

Example script/batch file:

mqbt import -p MQWT1 -q TEST.Q1 -f /app/some/place/*
mv /app/some/place/* /app/some/place/backup/

The script file seems to do the job. First, it will load each file in the directory as a (separate) message to a queue then it will move all files in that directory to a backup directory.

Here’s where support will get that 2:00AM phone call about missing messages. It doesn’t matter the tool/solution you are using, like MQBT, when they are invoked, they will retrieve a directory listing then iterate over that list of files, putting each file as a message to a queue. BUT what happens if 1 or more files arrive after the tool gets the directory listing and before the move command is executed? Well, the tool will not see the file but when the move command is executed, it will see the file and move it.

The other issue is what happens if the program writing the files to the directory is in the middle of writing a file when the script/batch file is started. You don’t want half a file to be put as a message to a queue!!!

Note: What if the script didn’t use a move command but rather a delete command? The evidence of what happened would be gone and of course, people would start claiming that MQ lost their message!!!

Sometimes the simplest solution is what is required. Have the script/batch file processor feed the programs 1 file at a time (the same file).

Solution: The issue with the putting of a partial file can be solved by having the other program write the file to a temporary directory and when it is done writing, move the file to the watched directory.

The examples below will have the script/batch processor retrieve a list of files that have a file extension of “txt” and on the MQPUT, MQBT will set the MQMD Format field as string (i.e. MQSTR) because of the ‘-S’ parameter. For a full list of MQBT parameters, see the MQ Batch Toolkit Installation and Operation manual.

Windows Batch File:

@echo off
setlocal

cd /D C:\Capitalware\MQBT\

for %%f in (C:\app\some\place\*.txt) do (
  mqbt insert -p MQWT1 -q TEST.Q1 -S -f %%f
  move /Y %%f C:\app\some\place\backup\
)

endlocal

Linux/macOS/Raspberry Pi Script:

#!/bin/sh

PATH="/home/mqm/Capitalware/MQBT:$PATH"
export PATH

cd /home/mqm/Capitalware/MQBT/

for entry in "/app/some/place/"*.txt
do
  if [ -f "$entry" ];then
     mqbt insert -p MQWT1 -q TEST.Q1 -S -f "$entry"
     mv -f "$entry" /app/some/place/backup/
  fi
done

Hope that helps.

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, IBM MQ, IBM MQ Appliance, Linux, macOS (Mac OS X), MQ Batch Toolkit, MQ Visual Edit, Programming, Raspberry Pi, Windows Comments Off on Customer Question Regarding Automation with MQ Visual Edit

IBM MQ fix access from IBM Fix Central requires S&S Entitlement in 2021

IBM has posted a support document stating that starting on February 1, 2021, your IBM ID will require Software Subscription and Support entitlement in order to download Fix Packs.
https://www.ibm.com/support/pages/node/6402575

Regards,
Roger Lacroix
Capitalware Inc.

Fix Packs for MQ, HPE NonStop, IBM i (OS/400), IBM MQ, IBM MQ Appliance, Linux, Unix, Windows, z/OS Comments Off on IBM MQ fix access from IBM Fix Central requires S&S Entitlement in 2021

Putting a File as a Message to a Queue

IBM has posted a support document describing the various ways to put a file as a message to a queue.
https://www.ibm.com/support/pages/node/6409594

I would like to point out that both MQ Visual Edit and MQ Batch Toolkit can put a file as a message to a queue.

MQ Visual Edit is a GUI program, so you simply point and click to load the files as messages to a queue whereas MQ Batch Toolkit is designed to be run from a command-line or script.

Both programs are available for Windows, macOS (Mac OS X), Linux 64-bit and Raspberry Pi (ARM).

A long time ago, I posted C source code (and compiled version for Windows) for 2 programs called: File2Msg and Msg2File. File2Msg will put a file as a message to a queue and Msg2File will write the contents of a message to a file. Basic stuff, but they get the job done.

Regards,
Roger Lacroix
Capitalware Inc.

C, Capitalware, HPE NonStop, IBM i (OS/400), IBM MQ, IBM MQ Appliance, Linux, macOS (Mac OS X), MQ Batch Toolkit, MQ Visual Edit, Programming, Raspberry Pi, Unix, Windows Comments Off on Putting a File as a Message to a Queue

IBM MQ: What is it, and why do developers need it?

Max Kahan of IBM has created and posted a video on IBM MQ titled: “IBM MQ: What is it, and why do developers need it?

Regards,
Roger Lacroix
Capitalware Inc.

HPE NonStop, IBM i (OS/400), IBM MQ, IBM MQ Appliance, Linux, macOS (Mac OS X), Programming, Unix, Windows, z/OS Comments Off on IBM MQ: What is it, and why do developers need it?

Back to Basics on Java with Azure Series

Microsoft Reactor has a Back to Basics on Java Series. It is offering 5 events on Java for Azure.

The Reactor is excited to launch a six-part series covering the basics of Java. The bitesize weekly episodes will cover topics including Containers, Databases, App Services and Serverless. By the end of the series you will have a comprehensive understanding of the basics of Java.

Java on Azure

Regards,
Roger Lacroix
Capitalware Inc.

Java, JMS, Programming, Windows Comments Off on Back to Basics on Java with Azure Series

Spring Boot Java Applications for CICS Tutorial Series

IBM has published a 5 part tutorial series on using Spring Boot with CICS on IBM Z (z/OS).

Regards,
Roger Lacroix
Capitalware Inc.

IBM MQ, IBM MQ Appliance, Java, JMS, Programming, Security, z/OS Comments Off on Spring Boot Java Applications for CICS Tutorial Series

How to Perform Common IBM MQ Management Certificate Tasks

IBM has published a technical note on how to perform common IBM MQ management certificate tasks.
https://www.ibm.com/support/pages/node/6382940

This document is intended to help with IBM MQ certificate management. It lists some of the most common commands needed to do basic certificate management tasks.
In IBM MQ you can performed such tasks through the IBM Key Management GUI (iKeyman) or through the command line using runmqckm and runmqakm commands.
This document provides examples for certificate management using the command line. There is a corresponding link to the IBM MQ documentation to perform the same task using iKeyman.

    List of topics:

  • How to check a certificate expiration
  • How to list the content of a MQ keystore
  • How to view the content of a certificate
  • How to (process) create a certificate signing request (CSR) and to receive a CA signed personal certificate
  • How to renew an existing certificate before it expires
  • How to rename a certificate
  • How to export and import a personal certificate
  • How to check/verify that you have a personal certificate for your queue manager or client
  • How to tell if the certificate has OCSP/CRL validation
  • How to combine public certifcate and private key into PKCS12 file

Regards,
Roger Lacroix
Capitalware Inc.

Education, HPE NonStop, IBM i (OS/400), IBM MQ, IBM MQ Appliance, Linux, macOS (Mac OS X), Security, Unix, Windows, z/OS Comments Off on How to Perform Common IBM MQ Management Certificate Tasks