You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+64-89Lines changed: 64 additions & 89 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,10 @@
2
2
3
3
This repository demonstrates how you can call IBM MQ from applications written in the Go language.
4
4
5
-
This repository previously contained programs that exported MQ statistics to
6
-
some monitoring packages. These have now been moved to a
7
-
[GitHub repository called mq-metric-samples](https://github.com/ibm-messaging/mq-metric-samples).
5
+
The repository originally also contained programs that exported MQ statistics to
6
+
monitoring systems. These programs have been moved to a GitHub repository called [mq-metric-samples](https://github.com/ibm-messaging/mq-metric-samples).
8
7
9
-
A minimum level of MQ V8 is required to build these packages. However, note that
10
-
the monitoring data published by the queue manager and exploited in the mqmetric package
11
-
is not available before MQ V9. A limited set of metrics can be monitored for MQ V8 instances by setting `ibmmq.usePublications=false`.
8
+
A minimum level of MQ V8 is required to build these packages, although it should be possible to connect as a client to even older versions of queue manager.
12
9
13
10
## Health Warning
14
11
@@ -24,30 +21,31 @@ See the [DEPRECATIONS](DEPRECATIONS.md) file for any planned changes to the API.
24
21
25
22
## MQI Description
26
23
27
-
The ibmmq directory contains a Go package, exposing an MQI-like interface.
24
+
The `ibmmq` directory contains a Go package, exposing an MQI-like interface.
28
25
29
26
The intention is to give an API that is more natural for Go programmers than the
30
27
common procedural MQI. For example, fixed length string arrays from the C API such
31
28
as MQCHAR48 are represented by the native Go string type. Conversion between these
32
-
types is handled within the ibmmq package itself, removing the need for Go programmers
29
+
types is handled within the `ibmmq` package itself, removing the need for Go programmers
33
30
to know about it.
34
31
35
32
Sample programs are provided to demonstrate various features of using the MQI. See the
36
-
README in the `samples` directory for more information about those programs.
33
+
README in the `samples` directory for more information about those programs. Detailed information about the MQI and application design can be found in the MQ product
34
+
documentation. Although that doesn't mention Go as a language, the principles for all
35
+
applications apply.
37
36
38
-
The mqmetric directory contains functions to help monitoring programs access MQ status and
39
-
statistics. This package is not needed for general application programs.
37
+
The `mqmetric` directory contains functions to help monitoring programs access MQ status and statistics. This package is not needed for general application programs.
40
38
41
39
## Using the package
42
40
43
41
To use code in this repository, you will need to be able to build Go applications, and
44
-
have a copy of MQ installed to build against. It uses cgo to access the MQI C
42
+
have a copy of MQ installed to build against. It uses `cgo` to access the MQI C
45
43
structures and definitions. It assumes that MQ has been installed in the default
46
44
location (on a Linux platform this would be `/opt/mqm`) but this can be changed
47
45
with environment variables if necessary.
48
46
49
-
Windows compatibility is also included. This has been tested with Go 1.10 compiler,
50
-
which now permits standard Windows paths (eg including spaces) so the CGO directives
47
+
Windows compatibility is also included. Current versions of the Go compiler
48
+
permit standard Windows paths (eg including spaces) so the CGO directives
51
49
can point at the normal MQ install path.
52
50
53
51
## Getting started
@@ -56,129 +54,105 @@ If you are unfamiliar with Go, the following steps can help create a working env
56
54
with source code in a suitable tree. Initial setup tends to be platform-specific,
57
55
but subsequent steps are independent of the platform.
58
56
59
-
### Linux
60
-
61
-
* Install the Go runtime and compiler. On Linux, the packaging may vary but a typical
62
-
directory for the code is `/usr/lib/golang`. If you see an error similar to "ld: NULL not defined"
63
-
when building a program then it is likely you need to upgrade your compiler.
64
-
65
-
66
-
* Create a working directory. For example, ```mkdir $HOME/gowork```
67
-
68
-
* Set environment variables. Based on the previous lines,
57
+
### MQ Client SDK
58
+
The MQ Client SDK for C programs is required in order to compile and run Go programs. You may have this from an MQ Client installation image (eg rpm, dep for Linux; msi for
59
+
Windows).
69
60
70
-
```
71
-
export GOROOT=/usr/lib/golang
72
-
export GOPATH=$HOME/gowork
73
-
```
61
+
For Linux x64 and Windows systems, you may also choose to use the
62
+
MQ Redistributable Client package which is a simple zip/tar file that does not need
63
+
any privileges to install:
74
64
75
-
* On Linux, some versions of the compiler have required that you set environment variables to permit some compile/link flags. Recent versions of Go seem to effectively include this fix in the compiler so that the export is no longer necessary.
@@ -192,6 +166,7 @@ of these packages. For example, you can continue to use `dep` with `Gopkg.toml`
192
166
name = "github.com/ibm-messaging/mq-golang"
193
167
version = "4.1.4"
194
168
```
169
+
Those older versions are not maintained, so it is strongly recommended you do move to using modules.
195
170
196
171
## Related Projects
197
172
@@ -209,15 +184,15 @@ let me know, via an issue, if you have another project that might be suitable fo
209
184
## Limitations
210
185
211
186
### Package 'ibmmq'
212
-
All regular MQI verbs are now available through the `ibmmq` package.
213
-
214
-
The only unimplemented area of MQI function is the use of Distribution Lists: they were
187
+
* All regular MQI verbs are available through the `ibmmq` package.
188
+
* The only unimplemented area of MQI function is the use of Distribution Lists: they were
215
189
rarely used, and the Publish/Subscribe operations provide similar capability.
190
+
* Go is not supported for writing MQ Exits, so structures and methods for those features
191
+
are not included.
216
192
217
193
### Package 'mqmetric'
218
-
* There is currently a queue manager limitation which does not permit resource publications to
219
-
be made about queues whose name includes '/'. Attempting to monitor such a queue will result in a warning
220
-
logged by the mqmetric package.
194
+
* The monitoring data published by the queue manager and exploited in the mqmetric package is not available before MQ V9. A limited set of metrics can be monitored for MQ V8 instances by setting the `ConnectionConfig.UsePublications` configuration option to `false`.
195
+
* There is currently a queue manager limitation which does not permit resource publications to be made about queues whose name includes '/'. Attempting to monitor such a queue will result in a warning logged by the mqmetric package.
0 commit comments