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
* Changed structures so that most applications will not need to use cgo to imbed the MQ C headers
7
-
* Go programs will now use int32 where C programs use MQLONG
8
-
* Use of message handles, distribution lists require cgo for now
9
-
* Package ibmmq now includes the numeric #defines as a Go file, cmqc.go, for easier use
10
-
* Removed "src/" prefix from tree in github repo
11
-
* Removed need for buffer length parm on Put/Put1
12
-
* Updated comments
13
-
* Added MQINQ
14
-
* Added MQItoString function for some maps of values to constant names
5
+
* Corrected package imports
6
+
* Formatted go code with `go fmt`
7
+
* Rearranged this file
8
+
* Removed logging from golang package `mqmetric`
9
+
* Moved samples to a separate repository
15
10
16
-
25 Jul 2016
17
-
* Added functions to handle basic PCF creation and parsing
18
-
* Added a monitor command for exporting MQ V9 queue manager data to Prometheus. See
19
-
the [README](cmd/mq_prometheus/README.md) for more details
20
-
21
-
04 Aug 2016
22
-
* Added a monitor command for exporting MQ data to InfluxDB. See the [README]
23
-
(cmd/mq_influx/README.md) for more details
24
-
* Restructured the monitoring code to put common material in the mqmetric
25
-
package, called from the Influx and Prometheus monitors.
26
-
27
-
12 Aug 2016
28
-
* Added a OpenTSDB monitor. See the [README](cmd/mq_opentsdb/README.md) for
29
-
more details.
30
-
* Added a Collectd monitor. See the [README](cmd/mq_coll/README.md) for
31
-
more details.
32
-
* Added MQI MQCNO/MQCSP structures to support client connections and password authentication
33
-
with MQCONNX.
34
-
* Allow client-mode connections from the monitor programs
35
-
* Added Grafana dashboards for the different monitors to show how to query them
36
-
* Changed database password mechanism so that "exec" maintains the PID for MQ services
11
+
## March 2018 - v1.0.0
37
12
38
-
23 Aug 2016
39
-
* Added a collector for Amazon AWS CloudWatch monitoring. See the [README](cmd/mq_aws/README.md)
40
-
for more details.
13
+
* Added V9.0.5 constant definitions
14
+
* Changed #cgo directives for Windows now the compiler supports standard path names
15
+
* Added mechanism to set MQ userid and password for Prometheus monitor
16
+
* Released v1.0.0 of this repository for use with golang dependency management tools
41
17
42
-
17 Oct 2016
43
-
* Added some Windows support. An example batch file is included in the mq_influx directory;
44
-
changes would be needed to the MQSC script to call it. The other monitor programs can be
45
-
supported with similar modifications.
46
-
* Added a "getting started" section to this README.
18
+
## October 2017
47
19
48
-
07 Nov 2016
49
-
* Added a collector that prints metrics in a simple JSON format.
50
-
See the [README](cmd/mq_json/README.md) for more details.
51
-
* Fixed bug where freespace metrics were showing as non-integer bytes, not percentages
20
+
* Added V9.0.4 constant definitions - now generated from original MQ source code
21
+
* Added MQSC script to show how to redefine event queues for pub/sub
22
+
* Prometheus collector has new parameter to override the first component of the metric name
23
+
* Prometheus collector can now process channel-level statistics
24
+
25
+
## 18 May 2017
26
+
27
+
* Added the V9.0.3 constant definitions.
28
+
* Reinstated 64-bit structure "length" fields in cmqc.go after fixing a bug in the base product C source code generator.
29
+
30
+
## 25 Mar 2017
31
+
32
+
* Added the metaPrefix option to the Prometheus monitor. This allows selection of non-default resources such as the MQ Bridge for Salesforce included in MQ 9.0.2.
33
+
34
+
## 15 Feb 2017
35
+
36
+
* API BREAKING CHANGE: The MQI verbs have been changed to return a single error indicator instead of two separate values. See mqitest.go for examples of how MQRC/MQCC codes can now be tested and extracted. This change makes the MQI implementation a bit more natural for Go environments.
37
+
38
+
## 10 Jan 2017
39
+
40
+
* Added support for the MQCD and MQSCO structures to allow programmable client connectivity, without requiring a CCDT. See the clientconn sample program for an example of using the MQCD.
41
+
* Moved sample programs into subdirectory
42
+
43
+
## 14 Dec 2016
52
44
53
-
14 Dec 2016
54
45
* Minor updates to this README for formatting
55
46
* Removed xxx_CURRENT_LENGTH definitions from cmqc
56
47
57
-
10 Jan 2017
58
-
* Added support for the MQCD and MQSCO structures to allow programmable client
59
-
connectivity, without requiring a CCDT. See the clientconn sample program
60
-
for an example of using the MQCD.
61
-
* Moved sample programs into subdirectory
48
+
## 07 Nov 2016
62
49
63
-
15 Feb 2017
64
-
* API BREAKING CHANGE: The MQI verbs have been changed to return a single
65
-
error indicator instead of two separate values. See mqitest.go for
66
-
examples of how MQRC/MQCC codes can now be tested and extracted. This change
67
-
makes the MQI implementation a bit more natural for Go environments.
50
+
* Added a collector that prints metrics in a simple JSON format. See the [README](cmd/mq_json/README.md) for more details.
51
+
* Fixed bug where freespace metrics were showing as non-integer bytes, not percentages
68
52
69
-
25 Mar 2017
70
-
* Added the metaPrefix option to the Prometheus monitor. This allows selection of non-default resources such as the MQ Bridge for Salesforce included in MQ 9.0.2.
53
+
## 17 Oct 2016
71
54
72
-
18 May 2017
73
-
* Added the V9.0.3 constant definitions.
74
-
* Reinstated 64-bit structure "length" fields in
75
-
cmqc.go after fixing a bug in the base product C source code generator.
55
+
* Added some Windows support. An example batch file is included in the mq_influx directory; changes would be needed to the MQSC script to call it. The other monitor programs can be supported with similar modifications.
56
+
* Added a "getting started" section to this README.
76
57
77
-
October 2017
78
-
* Added V9.0.4 constant definitions - now generated from original MQ source code
79
-
* Added MQSC script to show how to redefine event queues for pub/sub
80
-
* Prometheus collector has new parameter to override the first component of the metric name
81
-
* Prometheus collector can now process channel-level statistics
58
+
## 23 Aug 2016
82
59
83
-
March 2018
84
-
* Added V9.0.5 constant definitions
85
-
* Changed #cgo directives for Windows now the compiler supports standard path names
86
-
* Added mechanism to set MQ userid and password for Prometheus monitor
60
+
* Added a collector for Amazon AWS CloudWatch monitoring. See the [README](cmd/mq_aws/README.md) for more details.
61
+
62
+
## 12 Aug 2016
63
+
64
+
* Added a OpenTSDB monitor. See the [README](cmd/mq_opentsdb/README.md) for more details.
65
+
* Added a Collectd monitor. See the [README](cmd/mq_coll/README.md) for more details.
66
+
* Added MQI MQCNO/MQCSP structures to support client connections and password authentication with MQCONNX.
67
+
* Allow client-mode connections from the monitor programs
68
+
* Added Grafana dashboards for the different monitors to show how to query them
69
+
* Changed database password mechanism so that "exec" maintains the PID for MQ services
70
+
71
+
## 04 Aug 2016
72
+
73
+
* Added a monitor command for exporting MQ data to InfluxDB. See the [README](cmd/mq_influx/README.md) for more details
74
+
* Restructured the monitoring code to put common material in the mqmetric package, called from the Influx and Prometheus monitors.
75
+
76
+
## 25 Jul 2016
77
+
78
+
* Added functions to handle basic PCF creation and parsing
79
+
* Added a monitor command for exporting MQ V9 queue manager data to Prometheus. See the [README](cmd/mq_prometheus/README.md) for more details
80
+
81
+
## 18 Jul 2016
82
+
83
+
* Changed structures so that most applications will not need to use cgo to imbed the MQ C headers
84
+
* Go programs will now use int32 where C programs use MQLONG
85
+
* Use of message handles, distribution lists require cgo for now
86
+
* Package ibmmq now includes the numeric #defines as a Go file, cmqc.go, for easier use
87
+
* Removed "src/" prefix from tree in github repo
88
+
* Removed need for buffer length parm on Put/Put1
89
+
* Updated comments
90
+
* Added MQINQ
91
+
* Added MQItoString function for some maps of values to constant names
This repository demonstrates how you can call IBM MQ from applications written in the Go language.
3
4
4
5
> **NOTICE**: Please ensure that you use a dependency management tool such as [dep](https://github.com/golang/dep) or [Glide](http://glide.sh/), and add a specific version dependency. The current content has been marked as version 1.0.0, and a new version with breaking changes will be released soon. By using a dependency manager, you can continue to use the old version if you want to.
5
6
6
-
The repository also includes programs to export MQ statistics to some monitoring
7
-
packages including Prometheus, InfluxDB and OpenTSDB.
7
+
This repository previously contained sample programs that exported MQ statistics to some monitoring packages. These have now been moved to a new [GitHub repository called mq-metric-samples](https://github.com/ibm-messaging/mq-metric-samples).
8
8
9
-
A minimum level of MQ V9 is required to build this package.
10
-
The monitoring data published by the queue manager is not available before
11
-
that version; the interface also assumes availability of
12
-
MQI structures from that level of MQ.
9
+
A minimum level of MQ V9 is required to build these packages.
10
+
The monitoring data published by the queue manager is not available before that version; the interface also assumes availability of MQI structures from that level of MQ.
13
11
14
12
## Health Warning
15
13
16
-
This package is provided as-is with no guarantees of support or updates. There are also no guarantees of compatibility
17
-
with any future versions of the package; the API is subject to change based on any feedback.
14
+
This package is provided as-is with no guarantees of support or updates. There are also no guarantees of compatibility with any future versions of the package; the API is subject to change based on any feedback.
18
15
19
16
## MQI Description
20
17
21
18
The ibmmq directory contains a Go package, exposing an MQI-like interface.
22
19
23
-
The intention is to give an API that is more natural for Go programmers than the common
24
-
procedural MQI. For example, fixed length string arrays from the C API such as MQCHAR48 are
25
-
represented by the native Go string type. Conversion between these types is handled within the ibmmq
26
-
package itself, removing the need for Go programmers to know about it.
20
+
The intention is to give an API that is more natural for Go programmers than the common procedural MQI. For example, fixed length string arrays from the C API such as MQCHAR48 are represented by the native Go string type. Conversion between these types is handled within the ibmmq package itself, removing the need for Go programmers to know about it.
27
21
28
-
A short program in the mqitest directory gives an example of using this interface, to put and get messages
29
-
and to subscribe to a topic.
22
+
A short program in the mqitest directory gives an example of using this interface, to put and get messages and to subscribe to a topic.
30
23
31
-
Feedback on the utility of this package, thoughts about whether it should be changed or extended are
32
-
welcomed.
24
+
Feedback on the utility of this package, thoughts about whether it should be changed or extended are welcomed.
33
25
34
26
## Using the package
35
27
36
-
To use code in this repository, you will need to be able to build Go applications, and
37
-
have a copy of MQ installed to build against. It uses cgo to access the MQI C structures and definitions. It assumes that MQ has been
38
-
installed in the default location on a Linux platform (/opt/mqm) but you can easily change the
39
-
cgo directives in the source files if necessary.
28
+
To use code in this repository, you will need to be able to build Go applications, and have a copy of MQ installed to build against. It uses cgo to access the MQI C structures and definitions. It assumes that MQ has been installed in the default location on a Linux platform (`/opt/mqm`) but you can easily change the cgo directives in the source files if necessary.
40
29
41
-
Some Windows capability is also included. This has been tested with Go 1.10
42
-
compiler, which now permits standard Windows paths (eg including spaces)
43
-
so the CGO directives can point at the normal MQ install path.
30
+
Some Windows capability is also included. This has been tested with Go 1.10 compiler, which now permits standard Windows paths (eg including spaces) so the CGO directives can point at the normal MQ install path.
44
31
45
32
## Getting started
46
33
47
-
If you are unfamiliar with Go, the following steps can help create a
48
-
working environment with source code in a suitable tree. Initial setup
49
-
tends to be platform-specific, but subsequent steps are independent of the
50
-
platform.
34
+
If you are unfamiliar with Go, the following steps can help create a working environment with source code in a suitable tree. Initial setup tends to be platform-specific, but subsequent steps are independent of the platform.
51
35
52
36
### Linux
53
37
54
-
* Install the Go runtime and compiler. On Linux, the packaging may vary
55
-
but a typical directory for the code is /usr/lib/golang.
56
-
* Create a working directory. For example, mkdir $HOME/gowork
38
+
* Install the Go runtime and compiler. On Linux, the packaging may vary but a typical directory for the code is `/usr/lib/golang`.
39
+
40
+
* Create a working directory. For example, ```mkdir $HOME/gowork```
41
+
57
42
* Set environment variables. Based on the previous lines,
58
43
59
-
export GOROOT=/usr/lib/golang
44
+
```export GOROOT=/usr/lib/golang```
45
+
46
+
```export GOPATH=$HOME/gowork```
60
47
61
-
export GOPATH=$HOME/gowork
48
+
* If using a version of Go from after 2017, you must set environment variables to permit some compile/link flags. This is due to a security fix in the compiler.
62
49
63
-
* If using a version of Go from after 2017, you must set environment variables
64
-
to permit some compile/link flags. This is due to a security fix in the compiler.
65
-
export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"
50
+
```export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"```
66
51
67
52
* Install the git client
68
53
69
54
### Windows
70
55
71
-
* Install the Go runtime and compiler. On Windows, the
72
-
common directory is c:\Go
73
-
* Ensure you have a gcc-based compiler, for example from the Cygwin
74
-
distribution. I use the mingw variation, to ensure compiled code can
75
-
be used on systems without Cygwin installed
76
-
* Create a working directory. For example, mkdir c:\Gowork
56
+
* Install the Go runtime and compiler. On Windows, the common directory is `c:\Go`
57
+
* Ensure you have a gcc-based compiler, for example from the Cygwin distribution. I use the mingw variation, to ensure compiled code can be used on systems without Cygwin installed
58
+
* Create a working directory. For example, ```mkdir c:\Gowork```
77
59
* Set environment variables. Based on the previous lines,
78
60
79
-
set GOROOT=c:\Go
61
+
```set GOROOT=c:\Go```
80
62
81
-
set GOPATH=c:\Gowork
63
+
```set GOPATH=c:\Gowork```
82
64
83
-
set CC=x86_64-w64-mingw32-gcc.exe
65
+
```set CC=x86_64-w64-mingw32-gcc.exe```
84
66
85
-
* The CGO_LDFLAGS_ALLOW variable is not needed on Windows
67
+
* The `CGO_LDFLAGS_ALLOW` variable is not needed on Windows
86
68
* Install the git client
87
-
* Make sure the MQ include files and libraries are in a path that does
88
-
not include spaces or other special characters, as discussed above.
69
+
* Make sure the MQ include files and libraries are in a path that does not include spaces or other special characters, as discussed above.
89
70
90
71
### Common
91
72
92
-
* Make sure your PATH includes routes to the Go compiler ($GOROOT/bin),
93
-
the Git client, and the C compiler.
94
-
* Change directory to the workspace you created earlier. (cd $GOPATH)
95
-
* Use git to get a copy of the MQ components into a new directory in the
96
-
workspace. Use "src" as the destination, to get the directory created
97
-
automatically; this path will then be searched by the Go compiler.
73
+
* Make sure your PATH includes routes to the Go compiler (`$GOROOT/bin`), the Git client, and the C compiler.
74
+
* Change directory to the workspace you created earlier. (`cd $GOPATH`)
75
+
* Use git to get a copy of the MQ components into a new directory in the workspace.
* Use Go to download prerequisite components for any monitors you are interested in running. The logrus package is required for all of the monitors; but not all of the monitors require further downloads.
0 commit comments