Skip to content

Commit 1b2a2ad

Browse files
authored
Merge pull request #51 from ibm-messaging/dev
Merge Dev into Master.
2 parents f0f3300 + 8e016fe commit 1b2a2ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+929
-8113
lines changed

CHANGES.md renamed to CHANGELOG.md

Lines changed: 81 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,97 @@
1+
# Changelog
12

2-
08 Jul 2016
3-
* Initial release
3+
## May 2018
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+
* 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
10+
* Added build scripts for `ibmmq` and `mqmetric` packages and `ibmmq` samples
11+
* Added unit tests for `ibmmq` and `mqmetric` packages
1512

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
13+
## March 2018 - v1.0.0
3714

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.
15+
* Added V9.0.5 constant definitions
16+
* Changed #cgo directives for Windows now the compiler supports standard path names
17+
* Added mechanism to set MQ userid and password for Prometheus monitor
18+
* Released v1.0.0 of this repository for use with golang dependency management tools
4119

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.
20+
## October 2017
4721

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
22+
* Added V9.0.4 constant definitions - now generated from original MQ source code
23+
* Added MQSC script to show how to redefine event queues for pub/sub
24+
* Prometheus collector has new parameter to override the first component of the metric name
25+
* Prometheus collector can now process channel-level statistics
26+
27+
## 18 May 2017
28+
29+
* Added the V9.0.3 constant definitions.
30+
* Reinstated 64-bit structure "length" fields in cmqc.go after fixing a bug in the base product C source code generator.
31+
32+
## 25 Mar 2017
33+
34+
* 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.
35+
36+
## 15 Feb 2017
37+
38+
* 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.
39+
40+
## 10 Jan 2017
41+
42+
* 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.
43+
* Moved sample programs into subdirectory
44+
45+
## 14 Dec 2016
5246

53-
14 Dec 2016
5447
* Minor updates to this README for formatting
5548
* Removed xxx_CURRENT_LENGTH definitions from cmqc
5649

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
50+
## 07 Nov 2016
6251

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.
52+
* Added a collector that prints metrics in a simple JSON format. See the [README](cmd/mq_json/README.md) for more details.
53+
* Fixed bug where freespace metrics were showing as non-integer bytes, not percentages
6854

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.
55+
## 17 Oct 2016
7156

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.
57+
* 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.
58+
* Added a "getting started" section to this README.
7659

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
60+
## 23 Aug 2016
8261

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
62+
* Added a collector for Amazon AWS CloudWatch monitoring. See the [README](cmd/mq_aws/README.md) for more details.
63+
64+
## 12 Aug 2016
65+
66+
* Added a OpenTSDB monitor. See the [README](cmd/mq_opentsdb/README.md) for more details.
67+
* Added a Collectd monitor. See the [README](cmd/mq_coll/README.md) for more details.
68+
* Added MQI MQCNO/MQCSP structures to support client connections and password authentication with MQCONNX.
69+
* Allow client-mode connections from the monitor programs
70+
* Added Grafana dashboards for the different monitors to show how to query them
71+
* Changed database password mechanism so that "exec" maintains the PID for MQ services
72+
73+
## 04 Aug 2016
74+
75+
* Added a monitor command for exporting MQ data to InfluxDB. See the [README](cmd/mq_influx/README.md) for more details
76+
* Restructured the monitoring code to put common material in the mqmetric package, called from the Influx and Prometheus monitors.
77+
78+
## 25 Jul 2016
79+
80+
* Added functions to handle basic PCF creation and parsing
81+
* Added a monitor command for exporting MQ V9 queue manager data to Prometheus. See the [README](cmd/mq_prometheus/README.md) for more details
82+
83+
## 18 Jul 2016
84+
85+
* Changed structures so that most applications will not need to use cgo to imbed the MQ C headers
86+
* Go programs will now use int32 where C programs use MQLONG
87+
* Use of message handles, distribution lists require cgo for now
88+
* Package ibmmq now includes the numeric #defines as a Go file, cmqc.go, for easier use
89+
* Removed "src/" prefix from tree in github repo
90+
* Removed need for buffer length parm on Put/Put1
91+
* Updated comments
92+
* Added MQINQ
93+
* Added MQItoString function for some maps of values to constant names
94+
95+
## 08 Jul 2016
8796

97+
* Initial release

Dockerfile-build-packages

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# © Copyright IBM Corporation 2018
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
ARG BASE_IMAGE=mq-sdk:9.0.5.0-x86_64-ubuntu-16.04
16+
17+
FROM $BASE_IMAGE
18+
19+
ENV GO_VERSION=1.10
20+
21+
# Install the Go compiler and Git
22+
RUN export DEBIAN_FRONTEND=noninteractive \
23+
&& bash -c 'source /etc/os-release; \
24+
echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME} main restricted" > /etc/apt/sources.list; \
25+
echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME}-updates main restricted" >> /etc/apt/sources.list; \
26+
echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME}-backports main restricted universe" >> /etc/apt/sources.list;' \
27+
&& apt-get update \
28+
&& apt-get install -y --no-install-recommends golang-${GO_VERSION} git ca-certificates \
29+
&& rm -rf /var/lib/apt/lists/*
30+
31+
ENV PATH="${PATH}:/usr/lib/go-${GO_VERSION}/bin:/go/bin" \
32+
CGO_CFLAGS="-I/opt/mqm/inc/" \
33+
CGO_LDFLAGS_ALLOW="-Wl,-rpath.*" \
34+
GOPATH="/go" \
35+
OUTPUT_DIR="${OUTPUT_DIR}"
36+
37+
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" "$GOPATH/pkg" \
38+
&& chmod -R 777 "$GOPATH" \
39+
&& mkdir -p "$GOPATH/src/github.com/ibm-messaging/mq-golang"
40+
41+
WORKDIR $GOPATH/src/github.com/ibm-messaging/mq-golang
42+
43+
COPY ./ibmmq ibmmq
44+
COPY ./mqmetric mqmetric
45+
46+
RUN go build ./ibmmq \
47+
&& go test ./ibmmq \
48+
&& go build ./mqmetric \
49+
&& go test ./mqmetric

Dockerfile-build-samples

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# © Copyright IBM Corporation 2018
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
ARG BASE_IMAGE=mq-golang-build:9.0.5.0-x86_64-ubuntu-16.04
16+
17+
FROM $BASE_IMAGE
18+
19+
RUN mkdir -p "$GOPATH/src/github.com/ibm-messaging/mq-golang/samples"
20+
WORKDIR $GOPATH/src/github.com/ibm-messaging/mq-golang/samples
21+
22+
COPY ./samples/clientconn clientconn
23+
COPY ./samples/mqitest mqitest
24+
25+
RUN go install ./clientconn \
26+
&& go install ./mqitest

Makefile

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# © Copyright IBM Corporation 2018
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
###############################################################################
16+
# Conditional variables - you can override the values of these variables from
17+
# the command line
18+
###############################################################################
19+
# BASE_IMAGE is the MQ SDK base image to use
20+
BASE_IMAGE ?= mq-sdk:9.0.5.0-x86_64-ubuntu-16.04
21+
# GO_IMAGE is the GOLANG image to use for building samples
22+
GO_IMAGE ?= golang:1.10
23+
# DOCKER is the Docker command to run
24+
DOCKER ?= docker
25+
# BUILD_IMAGE is the name of the image that will be produced while building packages
26+
BUILD_IMAGE ?= mq-golang-build:9.0.5.0-x86_64-ubuntu-16.04
27+
# SAMPLE_BUILD_IMAGE is the name of the image that will be produced while building samples
28+
SAMPLE_BUILD_IMAGE ?= mq-sample-build:9.0.5.0-x86_64-ubuntu-16.04
29+
30+
###############################################################################
31+
# Other variables
32+
###############################################################################
33+
34+
ifneq (,$(findstring Microsoft,$(shell uname -r)))
35+
PLATFORM=WINDOWS
36+
else
37+
PLATFORM=UNIX
38+
endif
39+
40+
###############################################################################
41+
# Build targets
42+
###############################################################################
43+
44+
# Build all packages when on unix
45+
.PHONY: all
46+
ifeq ("$(PLATFORM)", "WINDOWS")
47+
all: unsupported-message
48+
else
49+
all: build-packages-unix build-samples-unix
50+
endif
51+
52+
.PHONY: clean
53+
clean:
54+
$(DOCKER) rmi -f $(BUILD_IMAGE)
55+
$(DOCKER) rmi -f $(SAMPLE_BUILD_IMAGE)
56+
57+
.PHONY: build-packages-unix
58+
build-packages-unix:
59+
$(info $(SPACER)$(shell printf $(TITLE)"Building packages in build container"$(END)))
60+
$(call docker-build,$(BUILD_IMAGE),Dockerfile-build-packages,$(BASE_IMAGE))
61+
62+
.PHONY: build-samples-unix
63+
build-samples-unix: build-packages-unix
64+
$(info $(SPACER)$(shell printf $(TITLE)"Building samples in build container"$(END)))
65+
$(call docker-build,$(SAMPLE_BUILD_IMAGE),Dockerfile-build-samples,$(BUILD_IMAGE))
66+
67+
.PHONY: unsupported-message
68+
unsupported-message:
69+
$(info $(SPACER)$(shell printf $(TITLE)"This makefile can only be ran on UNIX platforms"$(END)))
70+
71+
define docker-build
72+
# Build the image first to compile the package/samples
73+
$(DOCKER) build -t $1 \
74+
-f $2 \
75+
--build-arg BASE_IMAGE=$3 \
76+
.
77+
endef
78+
79+
include formatting.mk

0 commit comments

Comments
 (0)