@@ -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/apiKey .json for username/password information
26+ // - $HOME/Downloads/applicationApiKey .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/apiKey .json for username/password information
45+ // - $HOME/Downloads/applicationApiKey .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.
@@ -110,10 +110,8 @@ 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- }
113+ // app name is an optional field so we silently ignore if it is not present
114+ appName , _ = parseStringValueFromJSON ("applicationName" , connInfoMap , connectionInfoLocn )
117115
118116 // Now unmarshall and parse out the values from the api key file (that
119117 // contains the username/password credentials).
@@ -145,7 +143,7 @@ func CreateConnectionFactoryFromJSON(connectionInfoLocn string, apiKeyLocn strin
145143 ChannelName : appChannel ,
146144 UserName : username ,
147145 Password : password ,
148- ApplName : appName ,
146+ ApplName : appName ,
149147 }
150148
151149 // Give the populated ConnectionFactory back to the caller.
0 commit comments