Skip to content

Commit

Permalink
Merge pull request #64 from ibm-messaging/channel-status
Browse files Browse the repository at this point in the history
Add channel status discovery
  • Loading branch information
parrobe authored Nov 6, 2018
2 parents 8035722 + 7e63565 commit da0625a
Show file tree
Hide file tree
Showing 7 changed files with 685 additions and 98 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Changelog

## October 2018 - v3.0.0
* Added functions to the mqmetric package to assist with collecting channel status
* Better handle truncated messages when listing the queues that match a pattern

## October 2018
* Corrected heuristic for generating metric names

## August 2018
* Added V9.1 constant definitions
* Updated build comments

## May 2018
## July 2018 - v2.0.0

* Corrected package imports
* Formatted go code with `go fmt`
Expand Down
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

> **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.
> **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.
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).

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

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.

The mqmetric directory contains functions to help monitoring programs access MQ status and
statistics. This package is not needed for general application programs.

Feedback on the utility of this package, thoughts about whether it should be changed or extended are welcomed.

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

* Set environment variables. Based on the previous lines,

```export GOROOT=/usr/lib/golang```

```export GOPATH=$HOME/gowork```
```
export GOROOT=/usr/lib/golang
export GOPATH=$HOME/gowork
```

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

```export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"```
```
export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"
```

* Install the git client

### Windows

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

```set GOROOT=c:\Go```

```set GOPATH=c:\Gowork```

```set CC=x86_64-w64-mingw32-gcc.exe```
```
set GOROOT=c:\Go
set GOPATH=c:\Gowork
set CC=x86_64-w64-mingw32-gcc.exe
```

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

```git clone https://github.com/ibm-messaging/mq-golang.git src/github.com/ibm-messaging/mq-golang```
`git clone https://github.com/ibm-messaging/mq-golang.git src/github.com/ibm-messaging/mq-golang`

* Compile the `ibmmq` component:

```go install ./src/github.com/ibm-messaging/mq-golang/ibmmq```
`go install ./src/github.com/ibm-messaging/mq-golang/ibmmq`

* Compile the `mqmetric` component:
* If you plan to use monitoring functions, then compile the `mqmetric` component:

```go install ./src/github.com/ibm-messaging/mq-golang/mqmetric```
`go install ./src/github.com/ibm-messaging/mq-golang/mqmetric`

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

Expand Down
2 changes: 2 additions & 0 deletions ibmmq/mqistr.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func MQItoString(class string, value int) string {

case "CC":
s = C.GoString(C.MQCC_STR(v))
case "CHT":
s = C.GoString(C.MQCHT_STR(v))
case "CMD":
s = C.GoString(C.MQCMD_STR(v))

Expand Down
Loading

0 comments on commit da0625a

Please sign in to comment.