Skip to content

Commit 2ed93ed

Browse files
committed
Add channel status discovery
1 parent 8035722 commit 2ed93ed

File tree

7 files changed

+665
-98
lines changed

7 files changed

+665
-98
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# Changelog
22

3+
## October 2018 - v3.0.0
4+
* Added functions to the mqmetric package to assist with collecting channel status
5+
* Better handle truncated messages when listing the queues that match a pattern
6+
37
## October 2018
48
* Corrected heuristic for generating metric names
59

610
## August 2018
711
* Added V9.1 constant definitions
812
* Updated build comments
913

10-
## May 2018
14+
## July 2018 - v2.0.0
1115

1216
* Corrected package imports
1317
* Formatted go code with `go fmt`

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This repository demonstrates how you can call IBM MQ from applications written in the Go language.
44

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+
> **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.
66
77
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).
88

@@ -21,6 +21,9 @@ The intention is to give an API that is more natural for Go programmers than the
2121

2222
A short program in the samples/mqitest directory gives an example of using this interface, to put and get messages and to subscribe to a topic.
2323

24+
The mqmetric directory contains functions to help monitoring programs access MQ status and
25+
statistics. This package is not needed for general application programs.
26+
2427
Feedback on the utility of this package, thoughts about whether it should be changed or extended are welcomed.
2528

2629
## Using the package
@@ -41,28 +44,31 @@ If you are unfamiliar with Go, the following steps can help create a working env
4144

4245
* Set environment variables. Based on the previous lines,
4346

44-
```export GOROOT=/usr/lib/golang```
45-
46-
```export GOPATH=$HOME/gowork```
47+
```
48+
export GOROOT=/usr/lib/golang
49+
export GOPATH=$HOME/gowork
50+
```
4751

4852
* 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.
4953

50-
```export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"```
54+
```
55+
export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"
56+
```
5157

5258
* Install the git client
5359

5460
### Windows
5561

5662
* Install the Go runtime and compiler. On Windows, the common directory is `c:\Go`
5763
* 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```
64+
* Create a working directory. For example, `mkdir c:\Gowork`
5965
* Set environment variables. Based on the previous lines,
6066

61-
```set GOROOT=c:\Go```
62-
63-
```set GOPATH=c:\Gowork```
64-
65-
```set CC=x86_64-w64-mingw32-gcc.exe```
67+
```
68+
set GOROOT=c:\Go
69+
set GOPATH=c:\Gowork
70+
set CC=x86_64-w64-mingw32-gcc.exe
71+
```
6672

6773
* The `CGO_LDFLAGS_ALLOW` variable is not needed on Windows
6874
* Install the git client
@@ -73,15 +79,15 @@ If you are unfamiliar with Go, the following steps can help create a working env
7379
* Change directory to the workspace you created earlier. (`cd $GOPATH`)
7480
* Use git to get a copy of the MQ components into a new directory in the workspace.
7581

76-
```git clone https://github.com/ibm-messaging/mq-golang.git src/github.com/ibm-messaging/mq-golang```
82+
`git clone https://github.com/ibm-messaging/mq-golang.git src/github.com/ibm-messaging/mq-golang`
7783

7884
* Compile the `ibmmq` component:
7985

80-
```go install ./src/github.com/ibm-messaging/mq-golang/ibmmq```
86+
`go install ./src/github.com/ibm-messaging/mq-golang/ibmmq`
8187

82-
* Compile the `mqmetric` component:
88+
* If you plan to use monitoring functions, then compile the `mqmetric` component:
8389

84-
```go install ./src/github.com/ibm-messaging/mq-golang/mqmetric```
90+
`go install ./src/github.com/ibm-messaging/mq-golang/mqmetric`
8591

8692
* Follow the instructions in the [mq-metric-samples repository](https://github.com/ibm-messaging/mq-metric-samples) to compile the sample programs you are interested in.
8793

ibmmq/mqistr.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ func MQItoString(class string, value int) string {
6868

6969
case "CC":
7070
s = C.GoString(C.MQCC_STR(v))
71+
case "CHT":
72+
s = C.GoString(C.MQCHT_STR(v))
7173
case "CMD":
7274
s = C.GoString(C.MQCMD_STR(v))
7375

0 commit comments

Comments
 (0)