Skip to content

Commit 86f5ca8

Browse files
committed
Updates for MQ 92.5
1 parent 47d7837 commit 86f5ca8

File tree

31 files changed

+289
-86
lines changed

31 files changed

+289
-86
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
Newest updates are at the top of this file.
33

4+
### Feb 25 2022 (v5.2.5)
5+
* Update to MQ 9.2.5
6+
* Update to use v5.2.5 of mq-golang repository
7+
* Update vendored dependencies
8+
* Permit use of local queues as well as model queues for metric replies (#100)
9+
410
### Jan 16 2022 (no new version)
511
* Update vendored dependencies
612

Dockerfile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ RUN mkdir -p $GOPATH/src $GOPATH/bin $GOPATH/pkg \
5959
# Location of the downloadable MQ client package \
6060
ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
6161
RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
62-
VRMF=9.2.4.0
62+
VRMF=9.2.5.0
6363

6464
# Install the MQ client from the Redistributable package. This also contains the
6565
# header files we need to compile against. Setup the subset of the package

Dockerfile.run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN apt-get update \
3131
# Location of the downloadable MQ client package \
3232
ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
3333
RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
34-
VRMF=9.2.4.0
34+
VRMF=9.2.5.0
3535

3636
# Install the MQ client from the Redistributable package. This also contains the
3737
# header files we need to compile against. Setup the subset of the package

cmd/mq_aws/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func main() {
5656
}
5757

5858
// Connect and open standard queues
59-
err = mqmetric.InitConnection(config.cf.QMgrName, config.cf.ReplyQ, &config.cf.CC)
59+
err = mqmetric.InitConnection(config.cf.QMgrName, config.cf.ReplyQ, config.cf.ReplyQ2, &config.cf.CC)
6060
}
6161
if err == nil {
6262
log.Infoln("Connected to queue manager ", config.cf.QMgrName)

cmd/mq_coll/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func main() {
5454
}
5555

5656
// Connect and open standard queues
57-
err = mqmetric.InitConnection(config.cf.QMgrName, config.cf.ReplyQ, &config.cf.CC)
57+
err = mqmetric.InitConnection(config.cf.QMgrName, config.cf.ReplyQ, config.cf.ReplyQ2, &config.cf.CC)
5858
}
5959
if err == nil {
6060
log.Infoln("Connected to queue manager ", config.cf.QMgrName)

cmd/mq_influx/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func main() {
5858
}
5959

6060
// Connect and open standard queues
61-
err = mqmetric.InitConnection(config.cf.QMgrName, config.cf.ReplyQ, &config.cf.CC)
61+
err = mqmetric.InitConnection(config.cf.QMgrName, config.cf.ReplyQ, config.cf.ReplyQ2, &config.cf.CC)
6262
}
6363
if err == nil {
6464
log.Infoln("Connected to queue manager ", config.cf.QMgrName)

cmd/mq_json/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ For example,
8585
8686
```
8787

88-
The JSON structure has been substantially changed in this version of
89-
the monitor program, to give it a more deterministic layout.
90-
9188
As an example of processing the data, this uses the jq program to filter and show
9289
just the channel name and the number of messages across it at each interval. It
9390
ignores all the other metrics produced.
@@ -99,6 +96,10 @@ jq -c '.collectionTime.timeStamp as $t | .points[] |
9996
{"time":$t, "chl":.tags.channel, "msg":.metrics.messages}'
10097
```
10198

99+
The configuration option `oneline`can be used to print a complete JSON record as a single
100+
line instead of pretty-printed across mutiple lines. That might be helpful for some tools that
101+
ingest JSON and prefer to have a single line inputs.
102+
102103
## Metrics
103104
Once the monitor program has been started, you will see metrics being available.
104105
More information on the metrics collected through the publish/subscribe

cmd/mq_json/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
/*
4-
Copyright (c) IBM Corporation 2016, 2021
4+
Copyright (c) IBM Corporation 2016, 2022
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -25,10 +25,12 @@ import (
2525
type mqTTYConfig struct {
2626
cf cf.Config
2727
interval string
28+
oneline bool
2829
}
2930

3031
type ConfigYJson struct {
3132
Interval string
33+
OneLine bool
3234
}
3335

3436
type mqExporterConfigYaml struct {
@@ -50,6 +52,7 @@ func initConfig() error {
5052
cf.InitConfig(&config.cf)
5153

5254
cf.AddParm(&config.interval, "10s", cf.CP_STR, "ibmmq.interval", "json", "interval", "How long between each collection")
55+
cf.AddParm(&config.oneline, false, cf.CP_BOOL, "ibmmq.oneline", "json", "oneline", "JSON output on a single line")
5356

5457
err = cf.ParseParms()
5558

@@ -59,6 +62,7 @@ func initConfig() error {
5962
if err == nil {
6063
cf.CopyYamlConfig(&config.cf, cfy.Global, cfy.Connection, cfy.Objects)
6164
config.interval = cf.CopyParmIfNotSetStr("json", "interval", cfy.JSON.Interval)
65+
config.oneline = cf.CopyParmIfNotSetBool("json", "oneline", cfy.JSON.OneLine)
6266
}
6367
}
6468
}

cmd/mq_json/exporter.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
/*
4-
Copyright (c) IBM Corporation 2016, 2019
4+
Copyright (c) IBM Corporation 2016, 2022
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -477,8 +477,13 @@ func Collect() error {
477477
}
478478
}
479479

480-
b, _ := json.MarshalIndent(j, "", " ")
481-
fmt.Printf("%s\n", b)
480+
if config.oneline {
481+
b, _ := json.Marshal(j)
482+
fmt.Printf("%s\n", b)
483+
} else {
484+
b, _ := json.MarshalIndent(j, "", " ")
485+
fmt.Printf("%s\n", b)
486+
}
482487

483488
}
484489

cmd/mq_json/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func main() {
7575
log.Infoln("Starting IBM MQ metrics exporter for JSON")
7676

7777
// Connect and open standard queues
78-
err = mqmetric.InitConnection(config.cf.QMgrName, config.cf.ReplyQ, &config.cf.CC)
78+
err = mqmetric.InitConnection(config.cf.QMgrName, config.cf.ReplyQ, config.cf.ReplyQ2, &config.cf.CC)
7979
}
8080

8181
if err == nil {

0 commit comments

Comments
 (0)