Skip to content

Commit ee49384

Browse files
committed
Update README/CHANGES
1 parent c4f8728 commit ee49384

File tree

2 files changed

+139
-128
lines changed

2 files changed

+139
-128
lines changed

CHANGES.md

Lines changed: 87 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,74 @@
1+
# Changelog
12

2-
08 Jul 2016
3-
* Initial release
3+
## May 2018 - v1.0.0
44

5-
18 Jul 2016
6-
* 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+
* Released v1.0.0 of this repository for use with golang dependency management tools
6+
* Corrected package imports
7+
* Formatted go code with `go fmt`
8+
* Added glide files and vendor directory to handle content dependencies
9+
* Rearranged this file
1510

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
11+
## March 2018
2012

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.
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+
17+
##October 2017
18+
19+
* Added V9.0.4 constant definitions - now generated from original MQ source code
20+
* Added MQSC script to show how to redefine event queues for pub/sub
21+
* Prometheus collector has new parameter to override the first component of the metric name
22+
* Prometheus collector can now process channel-level statistics
23+
24+
## 18 May 2017
25+
26+
* Added the V9.0.3 constant definitions.
27+
* Reinstated 64-bit structure "length" fields in
28+
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+
* API BREAKING CHANGE: The MQI verbs have been changed to return a single
36+
error indicator instead of two separate values. See mqitest.go for
37+
examples of how MQRC/MQCC codes can now be tested and extracted. This change
38+
makes the MQI implementation a bit more natural for Go environments.
39+
40+
## 10 Jan 2017
41+
42+
* Added support for the MQCD and MQSCO structures to allow programmable client
43+
connectivity, without requiring a CCDT. See the clientconn sample program
44+
for an example of using the MQCD.
45+
* Moved sample programs into subdirectory
46+
47+
## 14 Dec 2016
48+
49+
* Minor updates to this README for formatting
50+
* Removed xxx_CURRENT_LENGTH definitions from cmqc
51+
52+
## 07 Nov 2016
53+
54+
* Added a collector that prints metrics in a simple JSON format.
55+
See the [README](cmd/mq_json/README.md) for more details.
56+
* Fixed bug where freespace metrics were showing as non-integer bytes, not percentages
57+
58+
## 17 Oct 2016
59+
60+
* Added some Windows support. An example batch file is included in the mq_influx directory;
61+
changes would be needed to the MQSC script to call it. The other monitor programs can be
62+
supported with similar modifications.
63+
* Added a "getting started" section to this README.
64+
65+
## 23 Aug 2016
66+
67+
* Added a collector for Amazon AWS CloudWatch monitoring. See the [README](cmd/mq_aws/README.md)
68+
for more details.
69+
70+
## 12 Aug 2016
2671

27-
12 Aug 2016
2872
* Added a OpenTSDB monitor. See the [README](cmd/mq_opentsdb/README.md) for
2973
more details.
3074
* Added a Collectd monitor. See the [README](cmd/mq_coll/README.md) for
@@ -35,53 +79,31 @@ with MQCONNX.
3579
* Added Grafana dashboards for the different monitors to show how to query them
3680
* Changed database password mechanism so that "exec" maintains the PID for MQ services
3781

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.
41-
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.
47-
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
52-
53-
14 Dec 2016
54-
* Minor updates to this README for formatting
55-
* Removed xxx_CURRENT_LENGTH definitions from cmqc
82+
## 04 Aug 2016
5683

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
84+
* Added a monitor command for exporting MQ data to InfluxDB. See the [README]
85+
(cmd/mq_influx/README.md) for more details
86+
* Restructured the monitoring code to put common material in the mqmetric
87+
package, called from the Influx and Prometheus monitors.
6288

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.
89+
## 25 Jul 2016
6890

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.
91+
* Added functions to handle basic PCF creation and parsing
92+
* Added a monitor command for exporting MQ V9 queue manager data to Prometheus. See
93+
the [README](cmd/mq_prometheus/README.md) for more details
7194

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.
95+
## 18 Jul 2016
7696

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
97+
* Changed structures so that most applications will not need to use cgo to imbed the MQ C headers
98+
* Go programs will now use int32 where C programs use MQLONG
99+
* Use of message handles, distribution lists require cgo for now
100+
* Package ibmmq now includes the numeric #defines as a Go file, cmqc.go, for easier use
101+
* Removed "src/" prefix from tree in github repo
102+
* Removed need for buffer length parm on Put/Put1
103+
* Updated comments
104+
* Added MQINQ
105+
* Added MQItoString function for some maps of values to constant names
82106

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
107+
## 08 Jul 2016
87108

109+
* Initial release

README.md

Lines changed: 52 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,111 @@
11
# mq-golang
2+
23
This repository demonstrates how you can call IBM MQ from applications written in the Go language.
34

45
> **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.
56
6-
The repository also includes programs to export MQ statistics to some monitoring
7-
packages including Prometheus, InfluxDB and OpenTSDB.
7+
The repository also includes programs to export MQ statistics to some monitoring packages including Prometheus, InfluxDB and OpenTSDB.
88

99
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.
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.
1311

1412
## Health Warning
1513

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.
1815

1916
## MQI Description
2017

2118
The ibmmq directory contains a Go package, exposing an MQI-like interface.
2219

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.
2721

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.
3023

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.
3325

3426
## Using the package
3527

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.
4029

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.
4431

4532
## Getting started
4633

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.
5135

5236
### Linux
5337

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+
5742
* Set environment variables. Based on the previous lines,
5843

59-
export GOROOT=/usr/lib/golang
44+
```export GOROOT=/usr/lib/golang```
6045

61-
export GOPATH=$HOME/gowork
46+
```export GOPATH=$HOME/gowork```
6247

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.*"
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.
49+
50+
```export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"```
6651

6752
* Install the git client
6853

6954
### Windows
7055

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```
7759
* Set environment variables. Based on the previous lines,
7860

79-
set GOROOT=c:\Go
61+
```set GOROOT=c:\Go```
8062

81-
set GOPATH=c:\Gowork
63+
```set GOPATH=c:\Gowork```
8264

83-
set CC=x86_64-w64-mingw32-gcc.exe
65+
```set CC=x86_64-w64-mingw32-gcc.exe```
8466

85-
* The CGO_LDFLAGS_ALLOW variable is not needed on Windows
67+
* The `CGO_LDFLAGS_ALLOW` variable is not needed on Windows
8668
* 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.
8970

9071
### Common
9172

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 "src" as the destination, to get the directory created automatically; this path will then be searched by the Go compiler.
76+
77+
```git clone https://github.com/ibm-messaging/mq-golang.git src/github.com/ibm-messaging/mq-golang```
78+
79+
* 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.
9880

99-
git clone https://github.com/ibm-messaging/mq-golang.git src/github.com/ibm-messaging/mq-golang
81+
```go get -u github.com/Sirupsen/logrus```
10082

101-
* Use Go to download prerequisite components for any monitors you are interested
102-
in running. The logrus package is required for all of the monitors; but not
103-
all of the monitors require further downloads.
83+
```go get -u github.com/prometheus/client_golang/prometheus```
10484

105-
go get -u github.com/Sirupsen/logrus
85+
```go get -u github.com/influxdata/influxdb/client/v2```
10686

107-
go get -u github.com/prometheus/client_golang/prometheus
87+
```go get -u github.com/aws/aws-sdk-go/service```
10888

109-
go get -u github.com/influxdata/influxdb/client/v2
89+
* Compile the `ibmmq` component:
11090

111-
go get -u github.com/aws/aws-sdk-go/service
91+
```go install ./src/github.com/ibm-messaging/mq-golang/ibmmq```
92+
93+
* Compile the `mqmetric` component:
94+
95+
```go install ./src/github.com/ibm-messaging/mq-golang/mqmetric```
11296

11397
* Compile the components you are interested in. For example
11498

115-
go install ./src/github.com/ibm-messaging/mq-golang/cmd/mq_prometheus
99+
```go install ./src/github.com/ibm-messaging/mq-golang/cmd/mq_prometheus```
116100

117-
At this point, you should have a compiled copy of the code in $GOPATH/bin.
101+
At this point, you should have a compiled copy of the code in `$GOPATH/bin`.
118102

119103
## Limitations
120104

121-
Not all of the MQI verbs are available through the ibmmq package. This
105+
Not all of the MQI verbs are available through the `ibmmq` package. This
122106
implementation concentrates on the core API calls needed to put and get messages.
123107
Currently unavailable verbs include:
108+
124109
* MQSET
125110
* All of the message property manipulators
126111
* MQCB
@@ -138,3 +123,7 @@ For feedback and issues relating specifically to this package, please use the [G
138123
Contributions to this package can be accepted under the terms of the IBM Contributor License Agreement,
139124
found in the [CLA file](CLA.md) of this repository. When submitting a pull request, you must include a statement stating
140125
you accept the terms in the CLA.
126+
127+
## Copyright
128+
129+
© Copyright IBM Corporation 2016, 2018

0 commit comments

Comments
 (0)