Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
392025a
Fix imports for mqmetric and ibmmq
sdmarshall79 May 14, 2018
c4f8728
Readme fix
sdmarshall79 May 14, 2018
691ea52
Merge pull request #36 from sdmarshall79/dev
parrobe May 15, 2018
ee49384
Update README/CHANGES
parrobe May 15, 2018
8963f7d
Remove logrus dependency and remove logs from package
parrobe May 16, 2018
ccdf10c
Move samples to seperate repository
parrobe May 16, 2018
c874d56
Comments on PR
parrobe May 16, 2018
83109d2
Merge pull request #38 from parrobe/makefile
parrobe May 16, 2018
8b2e8ca
Remove references to dependencies, correct mistakes
parrobe May 16, 2018
199bcd8
Merge pull request #39 from parrobe/makefile
sdmarshall79 May 16, 2018
92c1d83
Fix issue with returning errors
sdmarshall79 May 17, 2018
a124ab8
Merge pull request #40 from sdmarshall79/dev
parrobe May 17, 2018
51271ee
Add an automated build
parrobe May 17, 2018
67c3955
Merge pull request #41 from parrobe/makefile
sdmarshall79 May 18, 2018
d75d4f1
Add unit tests for packages
parrobe May 21, 2018
294f0c9
Merge pull request #42 from parrobe/test
parrobe May 21, 2018
78c9cce
Update method to generate metric description
parrobe May 24, 2018
3541d35
Merge pull request #44 from parrobe/dev
sdmarshall79 May 25, 2018
d4a05b0
check rc incase it is not no_more_msg
parrobe May 30, 2018
f15a287
Merge pull request #47 from parrobe/errorhandle
parrobe May 31, 2018
0c405d2
Refactor and extend existing tests
riccardobiraghi Jun 21, 2018
47731a3
Merge pull request #49 from riccardobiraghi/dev
parrobe Jun 21, 2018
67617f8
merge master prior to master merge
parrobe Jul 12, 2018
e652495
remove bad merge
parrobe Jul 12, 2018
8e016fe
Merge pull request #52 from parrobe/dev
parrobe Jul 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 81 additions & 71 deletions CHANGES.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,97 @@
# Changelog

08 Jul 2016
* Initial release
## May 2018

18 Jul 2016
* Changed structures so that most applications will not need to use cgo to imbed the MQ C headers
* Go programs will now use int32 where C programs use MQLONG
* Use of message handles, distribution lists require cgo for now
* Package ibmmq now includes the numeric #defines as a Go file, cmqc.go, for easier use
* Removed "src/" prefix from tree in github repo
* Removed need for buffer length parm on Put/Put1
* Updated comments
* Added MQINQ
* Added MQItoString function for some maps of values to constant names
* Corrected package imports
* Formatted go code with `go fmt`
* Rearranged this file
* Removed logging from golang package `mqmetric`
* Moved samples to a separate repository
* Added build scripts for `ibmmq` and `mqmetric` packages and `ibmmq` samples
* Added unit tests for `ibmmq` and `mqmetric` packages

25 Jul 2016
* Added functions to handle basic PCF creation and parsing
* Added a monitor command for exporting MQ V9 queue manager data to Prometheus. See
the [README](cmd/mq_prometheus/README.md) for more details

04 Aug 2016
* Added a monitor command for exporting MQ data to InfluxDB. See the [README]
(cmd/mq_influx/README.md) for more details
* Restructured the monitoring code to put common material in the mqmetric
package, called from the Influx and Prometheus monitors.

12 Aug 2016
* Added a OpenTSDB monitor. See the [README](cmd/mq_opentsdb/README.md) for
more details.
* Added a Collectd monitor. See the [README](cmd/mq_coll/README.md) for
more details.
* Added MQI MQCNO/MQCSP structures to support client connections and password authentication
with MQCONNX.
* Allow client-mode connections from the monitor programs
* Added Grafana dashboards for the different monitors to show how to query them
* Changed database password mechanism so that "exec" maintains the PID for MQ services
## March 2018 - v1.0.0

23 Aug 2016
* Added a collector for Amazon AWS CloudWatch monitoring. See the [README](cmd/mq_aws/README.md)
for more details.
* Added V9.0.5 constant definitions
* Changed #cgo directives for Windows now the compiler supports standard path names
* Added mechanism to set MQ userid and password for Prometheus monitor
* Released v1.0.0 of this repository for use with golang dependency management tools

17 Oct 2016
* 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.
* Added a "getting started" section to this README.
## October 2017

07 Nov 2016
* Added a collector that prints metrics in a simple JSON format.
See the [README](cmd/mq_json/README.md) for more details.
* Fixed bug where freespace metrics were showing as non-integer bytes, not percentages
* Added V9.0.4 constant definitions - now generated from original MQ source code
* Added MQSC script to show how to redefine event queues for pub/sub
* Prometheus collector has new parameter to override the first component of the metric name
* Prometheus collector can now process channel-level statistics

## 18 May 2017

* Added the V9.0.3 constant definitions.
* Reinstated 64-bit structure "length" fields in cmqc.go after fixing a bug in the base product C source code generator.

## 25 Mar 2017

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

## 15 Feb 2017

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

## 10 Jan 2017

* 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.
* Moved sample programs into subdirectory

## 14 Dec 2016

14 Dec 2016
* Minor updates to this README for formatting
* Removed xxx_CURRENT_LENGTH definitions from cmqc

10 Jan 2017
* 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.
* Moved sample programs into subdirectory
## 07 Nov 2016

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

25 Mar 2017
* 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.
## 17 Oct 2016

18 May 2017
* Added the V9.0.3 constant definitions.
* Reinstated 64-bit structure "length" fields in
cmqc.go after fixing a bug in the base product C source code generator.
* 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.
* Added a "getting started" section to this README.

October 2017
* Added V9.0.4 constant definitions - now generated from original MQ source code
* Added MQSC script to show how to redefine event queues for pub/sub
* Prometheus collector has new parameter to override the first component of the metric name
* Prometheus collector can now process channel-level statistics
## 23 Aug 2016

March 2018
* Added V9.0.5 constant definitions
* Changed #cgo directives for Windows now the compiler supports standard path names
* Added mechanism to set MQ userid and password for Prometheus monitor
* Added a collector for Amazon AWS CloudWatch monitoring. See the [README](cmd/mq_aws/README.md) for more details.

## 12 Aug 2016

* Added a OpenTSDB monitor. See the [README](cmd/mq_opentsdb/README.md) for more details.
* Added a Collectd monitor. See the [README](cmd/mq_coll/README.md) for more details.
* Added MQI MQCNO/MQCSP structures to support client connections and password authentication with MQCONNX.
* Allow client-mode connections from the monitor programs
* Added Grafana dashboards for the different monitors to show how to query them
* Changed database password mechanism so that "exec" maintains the PID for MQ services

## 04 Aug 2016

* Added a monitor command for exporting MQ data to InfluxDB. See the [README](cmd/mq_influx/README.md) for more details
* Restructured the monitoring code to put common material in the mqmetric package, called from the Influx and Prometheus monitors.

## 25 Jul 2016

* Added functions to handle basic PCF creation and parsing
* Added a monitor command for exporting MQ V9 queue manager data to Prometheus. See the [README](cmd/mq_prometheus/README.md) for more details

## 18 Jul 2016

* Changed structures so that most applications will not need to use cgo to imbed the MQ C headers
* Go programs will now use int32 where C programs use MQLONG
* Use of message handles, distribution lists require cgo for now
* Package ibmmq now includes the numeric #defines as a Go file, cmqc.go, for easier use
* Removed "src/" prefix from tree in github repo
* Removed need for buffer length parm on Put/Put1
* Updated comments
* Added MQINQ
* Added MQItoString function for some maps of values to constant names

## 08 Jul 2016

* Initial release
49 changes: 49 additions & 0 deletions Dockerfile-build-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# © Copyright IBM Corporation 2018
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG BASE_IMAGE=mq-sdk:9.0.5.0-x86_64-ubuntu-16.04

FROM $BASE_IMAGE

ENV GO_VERSION=1.10

# Install the Go compiler and Git
RUN export DEBIAN_FRONTEND=noninteractive \
&& bash -c 'source /etc/os-release; \
echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME} main restricted" > /etc/apt/sources.list; \
echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME}-updates main restricted" >> /etc/apt/sources.list; \
echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME}-backports main restricted universe" >> /etc/apt/sources.list;' \
&& apt-get update \
&& apt-get install -y --no-install-recommends golang-${GO_VERSION} git ca-certificates \
&& rm -rf /var/lib/apt/lists/*

ENV PATH="${PATH}:/usr/lib/go-${GO_VERSION}/bin:/go/bin" \
CGO_CFLAGS="-I/opt/mqm/inc/" \
CGO_LDFLAGS_ALLOW="-Wl,-rpath.*" \
GOPATH="/go" \
OUTPUT_DIR="${OUTPUT_DIR}"

RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" "$GOPATH/pkg" \
&& chmod -R 777 "$GOPATH" \
&& mkdir -p "$GOPATH/src/github.com/ibm-messaging/mq-golang"

WORKDIR $GOPATH/src/github.com/ibm-messaging/mq-golang

COPY ./ibmmq ibmmq
COPY ./mqmetric mqmetric

RUN go build ./ibmmq \
&& go test ./ibmmq \
&& go build ./mqmetric \
&& go test ./mqmetric
26 changes: 26 additions & 0 deletions Dockerfile-build-samples
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# © Copyright IBM Corporation 2018
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG BASE_IMAGE=mq-golang-build:9.0.5.0-x86_64-ubuntu-16.04

FROM $BASE_IMAGE

RUN mkdir -p "$GOPATH/src/github.com/ibm-messaging/mq-golang/samples"
WORKDIR $GOPATH/src/github.com/ibm-messaging/mq-golang/samples

COPY ./samples/clientconn clientconn
COPY ./samples/mqitest mqitest

RUN go install ./clientconn \
&& go install ./mqitest
79 changes: 79 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# © Copyright IBM Corporation 2018
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

###############################################################################
# Conditional variables - you can override the values of these variables from
# the command line
###############################################################################
# BASE_IMAGE is the MQ SDK base image to use
BASE_IMAGE ?= mq-sdk:9.0.5.0-x86_64-ubuntu-16.04
# GO_IMAGE is the GOLANG image to use for building samples
GO_IMAGE ?= golang:1.10
# DOCKER is the Docker command to run
DOCKER ?= docker
# BUILD_IMAGE is the name of the image that will be produced while building packages
BUILD_IMAGE ?= mq-golang-build:9.0.5.0-x86_64-ubuntu-16.04
# SAMPLE_BUILD_IMAGE is the name of the image that will be produced while building samples
SAMPLE_BUILD_IMAGE ?= mq-sample-build:9.0.5.0-x86_64-ubuntu-16.04

###############################################################################
# Other variables
###############################################################################

ifneq (,$(findstring Microsoft,$(shell uname -r)))
PLATFORM=WINDOWS
else
PLATFORM=UNIX
endif

###############################################################################
# Build targets
###############################################################################

# Build all packages when on unix
.PHONY: all
ifeq ("$(PLATFORM)", "WINDOWS")
all: unsupported-message
else
all: build-packages-unix build-samples-unix
endif

.PHONY: clean
clean:
$(DOCKER) rmi -f $(BUILD_IMAGE)
$(DOCKER) rmi -f $(SAMPLE_BUILD_IMAGE)

.PHONY: build-packages-unix
build-packages-unix:
$(info $(SPACER)$(shell printf $(TITLE)"Building packages in build container"$(END)))
$(call docker-build,$(BUILD_IMAGE),Dockerfile-build-packages,$(BASE_IMAGE))

.PHONY: build-samples-unix
build-samples-unix: build-packages-unix
$(info $(SPACER)$(shell printf $(TITLE)"Building samples in build container"$(END)))
$(call docker-build,$(SAMPLE_BUILD_IMAGE),Dockerfile-build-samples,$(BUILD_IMAGE))

.PHONY: unsupported-message
unsupported-message:
$(info $(SPACER)$(shell printf $(TITLE)"This makefile can only be ran on UNIX platforms"$(END)))

define docker-build
# Build the image first to compile the package/samples
$(DOCKER) build -t $1 \
-f $2 \
--build-arg BASE_IMAGE=$3 \
.
endef

include formatting.mk
Loading