@@ -23,7 +23,7 @@ import (
2323//
2424// This method reads the following files;
2525// - $HOME/Downloads/connection_info.json for host/port/channel information
26- // - $HOME/Downloads/applicationApiKey .json for username/password information
26+ // - $HOME/Downloads/apiKey .json for username/password information
2727//
2828// If your queue manager is hosted on the IBM MQ on Cloud service then you can
2929// download these two files directly from the IBM Cloud service console.
@@ -42,7 +42,7 @@ func CreateConnectionFactoryFromDefaultJSONFiles() (cf ConnectionFactoryImpl, er
4242// the file as the two parameters. If empty string is provided then the default
4343// location and name is assumed as follows;
4444// - $HOME/Downloads/connection_info.json for host/port/channel information
45- // - $HOME/Downloads/applicationApiKey .json for username/password information
45+ // - $HOME/Downloads/apiKey .json for username/password information
4646//
4747// If your queue manager is hosted on the IBM MQ on Cloud service then you can
4848// download these two files directly from the IBM Cloud service console.
@@ -87,7 +87,7 @@ func CreateConnectionFactoryFromJSON(connectionInfoLocn string, apiKeyLocn strin
8787 return ConnectionFactoryImpl {}, err
8888 }
8989
90- var qmName , hostname , appChannel string
90+ var qmName , hostname , appChannel , appName string
9191 var port int
9292
9393 qmName , errQM := parseStringValueFromJSON ("queueManagerName" , connInfoMap , connectionInfoLocn )
@@ -110,6 +110,11 @@ func CreateConnectionFactoryFromJSON(connectionInfoLocn string, apiKeyLocn strin
110110 return ConnectionFactoryImpl {}, errChannel
111111 }
112112
113+ appName , errAppName := parseStringValueFromJSON ("applicationName" , connInfoMap , connectionInfoLocn )
114+ if errAppName != nil {
115+ return ConnectionFactoryImpl {}, errAppName
116+ }
117+
113118 // Now unmarshall and parse out the values from the api key file (that
114119 // contains the username/password credentials).
115120 var apiKeyMap map [string ]* json.RawMessage
@@ -140,6 +145,7 @@ func CreateConnectionFactoryFromJSON(connectionInfoLocn string, apiKeyLocn strin
140145 ChannelName : appChannel ,
141146 UserName : username ,
142147 Password : password ,
148+ ApplName : appName ,
143149 }
144150
145151 // Give the populated ConnectionFactory back to the caller.
0 commit comments