Five Things Junior Developers Need to Know

If you’re a junior developer then have a view of this video

Regards,
Roger Lacroix
Capitalware Inc.

Education, Programming, Video Comments Off on Five Things Junior Developers Need to Know

MQTC v2.0.1.8 Platinum Sponsor: TxMQ

Capitalware would like to announce that TxMQ 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: TxMQ

MQTC v2.0.1.8 Platinum Sponsor: IBM

Capitalware would like to announce that IBM 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: IBM

Doyle Leabch will be Speaking at MQTC v2.0.1.8

Doyle Leabch of IBM will be presenting the following sessions at MQ Technical Conference v2.0.1.8 (MQTC):

    Doyle Leabch’s Technical Sessions:

  • ACEv11 the next generation of IBM Integration Bus and App Connect Professional

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

Regards,
Roger Lacroix
Capitalware Inc.

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

Here a cloud, there a cloud, MQ in the Cloud!!!

People are always asking me what is “new” this year at MQTC. Well, this year there will be lots of sessions on “MQ in the Cloud”. In case you hadn’t noticed, there will be 8 MQTC sessions on MQ in the Cloud. That’s as of right now, there may be more to come. 🙂

    MQ in the Cloud Sessions:

  • MQ in the Cloud – The New MQaaS offering by Matthew Whitehead
  • MQ Hybrid Cloud Architectures by Matthew Whitehead
  • Running MQ in the Cloud by Rob Parker
  • Running MQ in Containers by Rob Parker
  • MQ Monitoring on the Cloud by Suganya Rane
  • MQ on AWS by Suganya Rane
  • MQ and IIB Deployment Patterns using Docker on IBM Cloud Private by Sandeep Chellingi
  • MQ, IIB, Docker, Kubernetes and the IBM Cloud by Glen Brumbaugh

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

Regards,
Roger Lacroix
Capitalware Inc.

Education, IBM MQ, MQ Technical Conference Comments Off on Here a cloud, there a cloud, MQ in the Cloud!!!

First Draft of MQTC v2.0.1.8 Schedule

I have posted the first draft of the MQ Technical Conference v2.0.1.8 (MQTC) schedule.You can find it at http://www.mqtechconference.com/schedule.html

Regards,
Roger Lacroix
Capitalware Inc.

Education, IBM MQ, MQ Technical Conference Comments Off on First Draft of MQTC v2.0.1.8 Schedule

IBM Hursley UK is Sending 6 Speakers to MQTC v2.0.1.8

The IBM MQ Labs in Hursley, UK will be sending the following 6 speakers to MQTC v2.0.1.8: David Ware, Mark Taylor, Rob Parker, Matthew Whitehead, Sam Goulden and Andrew Schofield. And IBM USA will be sending: Lyn Elkins, Mitch Johnson & Jonathan Levell.

    David Ware’s Sessions:

  • What’s New in IBM MQ?
  • Building a highly available and scalable solution with MQ clusters
  • MQ High Availability
    Mark Taylor’s Sessions:

  • Connecting MQ to the Rest of the World
  • Using Open Source solutions to monitor your queue managers
  • Helping MQ developers with new language bindings and developer outreach material
    Rob Parker’s Sessions:

  • Running MQ in the Cloud
  • Running MQ in Containers
  • Securing your MQ environment
    Matthew Whitehead’s Sessions:

  • Where’s my message?
  • An Introduction to MQ Publish/Subscribe
  • MQ in the Cloud – The New MQaaS offering
  • MQ Hybrid Cloud Architectures
    Sam Goulden’s Sessions:

  • Introduction to MQ
  • Benefiting from the IBM MQ Appliance
  • MQ Administration, the Web Console, & REST API
    Mark Taylor & Lyn Elkins’s Session:

  • Using and Analysing SMF data
    Lyn Elkins & Mitch Johnson’s Session:

  • MQ for z/OS – An introduction to object authorization on that ‘other’ queue manager
    Lyn Elkins’s Session:

  • MQ for z/OS – Shared queues and why is my workload not running where I think it should
    Andrew Schofield’s Session:

  • Event Streams using Apache Kafka and how it relates to MQ
    Jonathan Levell’s Technical Sessions:

  • Connecting IoT Devices and Mobile Applications to your Enterprise with IBM IoT MessageSight & IBM MQ
  • MQTT: The Protocol for the Internet of Things

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

Regards,
Roger Lacroix
Capitalware Inc.

Education, IBM MQ, MQ Technical Conference Comments Off on IBM Hursley UK is Sending 6 Speakers to MQTC v2.0.1.8

SQLite v3.24.0 Released

D. Richard Hipp has just released SQLite v3.24.0.
http://www.sqlite.org/news.html

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.

Regards,
Roger Lacroix
Capitalware Inc.

C, Database, IBM i (OS/400), Linux, macOS (Mac OS X), Open Source, Programming, Unix, Windows, z/OS Comments Off on SQLite v3.24.0 Released

C# .NET Code to Get a Message from a Remote Queue Manager

In my previous posting here, I did a write up of putting a message to a queue in a remote queue manager using C# .NET. In this blog posting, I’ll show you how to get a message from a queue of a remote queue manager using C# .NET.

If you are familiar with IBM MQ Classes for Java then writing code with IBM MQ Classes for .NET will be very straightforward.

The only word of warning I have for C# developers is to make sure you do NOT use a .NET Framework higher than what IBM MQ supports. Otherwise, you may get weird errors.

Here is a fully functioning C# .NET MQ example that will connect to a remote queue manager and get a message from a queue using a managed .NET environment. You can download the source code from here.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using IBM.WMQ;

/// <summary> Program Name
/// MQTest02
///
/// Description
/// This C# class will connect to a remote queue manager
/// and get a message from a queue using a managed .NET environment.
///
/// Sample Command Line Parameters
/// -h 127.0.0.1 -p 1414 -c TEST.CHL -m MQA1 -q TEST.Q1 -u tester -x mypwd
/// </summary>
/// <author>  Roger Lacroix, Capitalware Inc.
/// </author>
namespace MQTest02
{
   class MQTest02
   {
      private Hashtable inParms = null;
      private Hashtable qMgrProp = null;
      private System.String qManager;
      private System.String outputQName;

      /*
      * The constructor
      */
      public MQTest02()
         : base()
      {
      }

      /// <summary> Make sure the required parameters are present.</summary>
      /// <returns> true/false
      /// </returns>
      private bool allParamsPresent()
      {
         bool b = inParms.ContainsKey("-h") && inParms.ContainsKey("-p") &&
                  inParms.ContainsKey("-c") && inParms.ContainsKey("-m") &&
                  inParms.ContainsKey("-q");
         if (b)
         {
            try
            {
               System.Int32.Parse((System.String)inParms["-p"]);
            }
            catch (System.FormatException e)
            {
               b = false;
            }
         }

         return b;
      }

      /// <summary> Extract the command-line parameters and initialize the MQ variables.</summary>
      /// <param name="args">
      /// </param>
      /// <throws>  IllegalArgumentException </throws>
      private void init(System.String[] args)
      {
         inParms = Hashtable.Synchronized(new Hashtable());
         if (args.Length > 0 && (args.Length % 2) == 0)
         {
            for (int i = 0; i < args.Length; i += 2)
            {
               inParms[args[i]] = args[i + 1];
            }
         }
         else
         {
            throw new System.ArgumentException();
         }

         if (allParamsPresent())
         {
            qManager = ((System.String)inParms["-m"]);
            outputQName = ((System.String)inParms["-q"]);

            qMgrProp = new Hashtable();
            qMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);

            qMgrProp.Add(MQC.HOST_NAME_PROPERTY, ((System.String)inParms["-h"]));
            qMgrProp.Add(MQC.CHANNEL_PROPERTY, ((System.String)inParms["-c"]));

            try
            {
               qMgrProp.Add(MQC.PORT_PROPERTY, System.Int32.Parse((System.String)inParms["-p"]));
            }
            catch (System.FormatException e)
            {
               qMgrProp.Add(MQC.PORT_PROPERTY, 1414);
            }

            if (inParms.ContainsKey("-u"))
               qMgrProp.Add(MQC.USER_ID_PROPERTY, ((System.String)inParms["-u"]));

            if (inParms.ContainsKey("-x"))
               qMgrProp.Add(MQC.PASSWORD_PROPERTY, ((System.String)inParms["-x"]));

            System.Console.Out.WriteLine("MQTest02:");
            Console.WriteLine("  QMgrName ='{0}'", qManager);
            Console.WriteLine("  Output QName ='{0}'", outputQName);

            System.Console.Out.WriteLine("QMgr Property values:");
            foreach (DictionaryEntry de in qMgrProp)
            {
               Console.WriteLine("  {0} = '{1}'", de.Key, de.Value);
            }
         }
         else
         {
            throw new System.ArgumentException();
         }
      }

      /// <summary> Connect, open queue, read a message, close queue and disconnect.
      ///
      /// </summary>
      /// <throws>  MQException </throws>
      private void testReceive()
      {
         MQQueueManager qMgr = null;
         MQQueue inQ = null;
         int openOptions = MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING;
         MQGetMessageOptions gmo = new MQGetMessageOptions();
         MQMessage receiveMsg = null;

         try
         {
            qMgr = new MQQueueManager(qManager, qMgrProp);
            System.Console.Out.WriteLine("MQTest02 successfully connected to " + qManager);

            inQ = qMgr.AccessQueue(outputQName, openOptions);
            System.Console.Out.WriteLine("MQTest02 successfully opened " + outputQName);

            receiveMsg = new MQMessage();

            inQ.Get(receiveMsg, gmo);
            System.Console.Out.WriteLine("Message Data>>>" + receiveMsg.ReadString(receiveMsg.MessageLength));
         }
         catch (MQException mqex)
         {
            System.Console.Out.WriteLine("MQTest02 cc=" + mqex.CompletionCode + " : rc=" + mqex.ReasonCode);
         }
         catch (System.IO.IOException ioex)
         {
            System.Console.Out.WriteLine("MQTest02 ioex=" + ioex);
         }
         finally
         {
            try
            {
                if (inQ != null)
                {
                    inQ.Close();
                    System.Console.Out.WriteLine("MQTest02 closed: " + outputQName);
                }
            }
            catch (MQException mqex)
            {
                System.Console.Out.WriteLine("MQTest02 CC=" + mqex.CompletionCode + " : RC=" + mqex.ReasonCode);
            }

            try
            {
                if (qMgr != null)
                {
                    qMgr.Disconnect();
                    System.Console.Out.WriteLine("MQTest02 disconnected from " + qManager);
                }
            }
            catch (MQException mqex)
            {
                System.Console.Out.WriteLine("MQTest02 CC=" + mqex.CompletionCode + " : RC=" + mqex.ReasonCode);
            }
         }
      }

      /// <summary> main line</summary>
      /// <param name="args">
      /// </param>
      //        [STAThread]
      public static void Main(System.String[] args)
      {
         MQTest02 mqt = new MQTest02();

         try
         {
            mqt.init(args);
            mqt.testReceive();
         }
         catch (System.ArgumentException e)
         {
            System.Console.Out.WriteLine("Usage: MQTest02 -h host -p port -c channel -m QueueManagerName -q QueueName [-u userID] [-x passwd]");
            System.Environment.Exit(1);
         }
         catch (MQException e)
         {
            System.Console.Out.WriteLine(e);
            System.Environment.Exit(1);
         }

         System.Environment.Exit(0);
      }
   }
}

Here is the batch file I used to compiled the code as a 32-bit executable:

@echo off
setlocal

if "%MQ_FILE_PATH%".=="". set MQ_FILE_PATH=C:\Program Files\IBM\WebSphere MQ

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe /nologo /t:exe /r:System.dll /r:"%MQ_FILE_PATH%\Tools\lib\amqmdnet.dll" /out:bin\Release\MQTest02.exe MQTest02.cs

endlocal

And here is the batch file I used to compiled the code as a 64-bit executable:

@echo off
setlocal

if "%MQ_FILE_PATH%".=="". set MQ_FILE_PATH=C:\Program Files\IBM\WebSphere MQ

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\csc.exe /nologo /t:exe /platform:x64 /r:System.dll /r:"%MQ_FILE_PATH%\Tools\lib64\amqmdnet.dll" /out:bin\Release\MQTest02_64.exe MQTest02.cs

endlocal

As I mentioned in my other C# .NET posting, I’m using the .NET V2 Framework. It might be old but for basic C# code, it works perfectly.

Regards,
Roger Lacroix
Capitalware Inc.

.NET, C#, IBM MQ, IBM MQ Appliance, Open Source, Programming, Windows Comments Off on C# .NET Code to Get a Message from a Remote Queue Manager

C# .NET Code to Put a Message to a Remote Queue Manager

I write a lot of C & Java code and I like to publish working examples of C and Java using MQ. So, I thought I should throw a little love towards C# .NET. 🙂

If you are familiar with IBM MQ Classes for Java then writing code with IBM MQ Classes for .NET will be very straightforward.

The only word of warning I have for C# developers is to make sure you do NOT use a .NET Framework higher than what IBM MQ supports. Otherwise, you may get weird errors.

Here is a fully functioning C# .NET MQ example that will connect to a remote queue manager and put a message to a queue using a managed .NET environment. You can download the source code from here.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using IBM.WMQ;

/// <summary> Program Name
/// MQTest01
///
/// Description
/// This C# class will connect to a remote queue manager
/// and put a message to a queue using a managed .NET environment.
///
/// Sample Command Line Parameters
/// -h 127.0.0.1 -p 1414 -c TEST.CHL -m MQA1 -q TEST.Q1 -u tester -x mypwd
/// </summary>
/// <author>  Roger Lacroix, Capitalware Inc.
/// </author>
namespace MQTest01
{
   class MQTest01
   {
      private Hashtable inParms = null;
      private Hashtable qMgrProp = null;
      private System.String qManager;
      private System.String outputQName;

      /*
      * The constructor
      */
      public MQTest01()
         : base()
      {
      }

      /// <summary> Make sure the required parameters are present.</summary>
      /// <returns> true/false
      /// </returns>
      private bool allParamsPresent()
      {
         bool b = inParms.ContainsKey("-h") && inParms.ContainsKey("-p") &&
                  inParms.ContainsKey("-c") && inParms.ContainsKey("-m") &&
                  inParms.ContainsKey("-q");
         if (b)
         {
            try
            {
               System.Int32.Parse((System.String)inParms["-p"]);
            }
            catch (System.FormatException e)
            {
               b = false;
            }
         }

         return b;
      }

      /// <summary> Extract the command-line parameters and initialize the MQ variables.</summary>
      /// <param name="args">
      /// </param>
      /// <throws>  IllegalArgumentException </throws>
      private void init(System.String[] args)
      {
         inParms = Hashtable.Synchronized(new Hashtable());
         if (args.Length > 0 && (args.Length % 2) == 0)
         {
            for (int i = 0; i < args.Length; i += 2)
            {
               inParms[args[i]] = args[i + 1];
            }
         }
         else
         {
            throw new System.ArgumentException();
         }

         if (allParamsPresent())
         {
            qManager = ((System.String)inParms["-m"]);
            outputQName = ((System.String)inParms["-q"]);

            qMgrProp = new Hashtable();
            qMgrProp.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);

            qMgrProp.Add(MQC.HOST_NAME_PROPERTY, ((System.String)inParms["-h"]));
            qMgrProp.Add(MQC.CHANNEL_PROPERTY, ((System.String)inParms["-c"]));

            try
            {
               qMgrProp.Add(MQC.PORT_PROPERTY, System.Int32.Parse((System.String)inParms["-p"]));
            }
            catch (System.FormatException e)
            {
               qMgrProp.Add(MQC.PORT_PROPERTY, 1414);
            }

            if (inParms.ContainsKey("-u"))
               qMgrProp.Add(MQC.USER_ID_PROPERTY, ((System.String)inParms["-u"]));

            if (inParms.ContainsKey("-x"))
               qMgrProp.Add(MQC.PASSWORD_PROPERTY, ((System.String)inParms["-x"]));

            System.Console.Out.WriteLine("MQTest01:");
            Console.WriteLine("  QMgrName ='{0}'", qManager);
            Console.WriteLine("  Output QName ='{0}'", outputQName);

            System.Console.Out.WriteLine("QMgr Property values:");
            foreach (DictionaryEntry de in qMgrProp)
            {
               Console.WriteLine("  {0} = '{1}'", de.Key, de.Value);
            }
         }
         else
         {
            throw new System.ArgumentException();
         }
      }

      /// <summary> Connect, open queue, write a message, close queue and disconnect.
      ///
      /// </summary>
      /// <throws>  MQException </throws>
      private void testSend()
      {
         MQQueueManager qMgr = null;
         MQQueue outQ = null;
         System.String line = "This is a test message embedded in the MQTest01 program.";
         int openOptions = MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING;
         MQPutMessageOptions pmo = new MQPutMessageOptions();

         try
         {
            qMgr = new MQQueueManager(qManager, qMgrProp);
            System.Console.Out.WriteLine("MQTest01 successfully connected to " + qManager);

            outQ = qMgr.AccessQueue(outputQName, openOptions);
            System.Console.Out.WriteLine("MQTest01 successfully opened " + outputQName);

            // Define a simple MQ message, and write some text in UTF format..
            MQMessage sendmsg = new MQMessage();
            sendmsg.Format = MQC.MQFMT_STRING;
            sendmsg.MessageType = MQC.MQMT_DATAGRAM;
            sendmsg.MessageId = MQC.MQMI_NONE;
            sendmsg.CorrelationId = MQC.MQCI_NONE;
            sendmsg.WriteString(line);

            // put the message on the outQ
            outQ.Put(sendmsg, pmo);
            System.Console.Out.WriteLine("Message Data>>>" + line);
         }
         catch (MQException mqex)
         {
            System.Console.Out.WriteLine("MQTest01 CC=" + mqex.CompletionCode + " : RC=" + mqex.ReasonCode);
         }
         catch (System.IO.IOException ioex)
         {
            System.Console.Out.WriteLine("MQTest01 ioex=" + ioex);
         }
         finally
         {
            try
            {
                if (outQ != null)
                {
                    outQ.Close();
                    System.Console.Out.WriteLine("MQTest01 closed: " + outputQName);
                }
            }
            catch (MQException mqex)
            {
                System.Console.Out.WriteLine("MQTest01 CC=" + mqex.CompletionCode + " : RC=" + mqex.ReasonCode);
            }

            try
            {
                if (qMgr != null)
                {
                    qMgr.Disconnect();
                    System.Console.Out.WriteLine("MQTest01 disconnected from " + qManager);
                }
            }
            catch (MQException mqex)
            {
                System.Console.Out.WriteLine("MQTest01 CC=" + mqex.CompletionCode + " : RC=" + mqex.ReasonCode);
            }
         }
      }

      /// <summary> main line</summary>
      /// <param name="args">
      /// </param>
      //        [STAThread]
      public static void Main(System.String[] args)
      {
         MQTest01 mqt = new MQTest01();

         try
         {
            mqt.init(args);
            mqt.testSend();
         }
         catch (System.ArgumentException e)
         {
            System.Console.Out.WriteLine("Usage: MQTest01 -h host -p port -c channel -m QueueManagerName -q QueueName [-u userID] [-x passwd]");
            System.Environment.Exit(1);
         }
         catch (MQException e)
         {
            System.Console.Out.WriteLine(e);
            System.Environment.Exit(1);
         }

         System.Environment.Exit(0);
      }
   }
}

Here is the batch file I used to compiled the code as a 32-bit executable:

@echo off
setlocal

if "%MQ_FILE_PATH%".=="". set MQ_FILE_PATH=C:\Program Files\IBM\WebSphere MQ

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe /nologo /t:exe /r:System.dll /r:"%MQ_FILE_PATH%\Tools\lib\amqmdnet.dll" /out:bin\Release\MQTest01.exe MQTest01.cs

endlocal

And here is the batch file I used to compiled the code as a 64-bit executable:

@echo off
setlocal

if "%MQ_FILE_PATH%".=="". set MQ_FILE_PATH=C:\Program Files\IBM\WebSphere MQ

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\csc.exe /nologo /t:exe /platform:x64 /r:System.dll /r:"%MQ_FILE_PATH%\Tools\lib64\amqmdnet.dll" /out:bin\Release\MQTest01_64.exe MQTest01.cs

endlocal

I used the .NET V2 Framework. It might be old but for basic C# code, it works perfectly. 🙂

Regards,
Roger Lacroix
Capitalware Inc.

.NET, C#, IBM MQ, IBM MQ Appliance, Programming, Windows Comments Off on C# .NET Code to Put a Message to a Remote Queue Manager