Skip to content

Commit 5c19825

Browse files
committed
Update for MQ V9.1.4
- ibmmq - Add qmgr variant of the CB function for event handlers (#128) - mqmetric - Add MaxChannels/MaxActiveChannels for z/OS (#129) - mqmetric - Add MaxInst/MaxInst for SVRCONN channels (ibm-messaging/mq-metric-samples#21)
1 parent bf7e7cf commit 5c19825

File tree

17 files changed

+619
-94
lines changed

17 files changed

+619
-94
lines changed

CHANGELOG.md

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

4+
## December 05 2019 - v4.1.2
5+
* Update for MQ 9.1.4 - No new base API function introduced
6+
* Add amqsgbr sample for browse option
7+
* ibmmq - Add qmgr variant of the CB function for event handlers (#128)
8+
* mqmetric - Add MaxChannels/MaxActiveChannels for z/OS (#129)
9+
* mqmetric - Add MaxInst/MaxInst for SVRCONN channels (ibm-messaging/mq-metric-samples#21)
10+
411
## October 7 2019 - v4.1.1
512
* ibmmq - Enable use of Context in MQPMO structure (#122)
613
* ibmmq - Remove unusable fields referring to Distribution List structures
714

8-
## Augest 20 2019 - v4.1.0
15+
## August 20 2019 - v4.1.0
916
* Update Docker build scripts for newer Go compiler level
1017
* mqmetric - Issue warning if trying to monitor queues with names containing '/'
1118

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ RUN mkdir -p $GOPATH/src $GOPATH/bin $GOPATH/pkg \
5252
# Location of the downloadable MQ client package \
5353
ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
5454
RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
55-
VRMF=9.1.3.0
55+
VRMF=9.1.4.0
5656

5757
# Install the MQ client from the Redistributable package. This also contains the
5858
# header files we need to compile against.

ibmmq/cmqc_darwin.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ package ibmmq
3030
****************************************************************
3131
*
3232
* <BEGIN_BUILDINFO>
33-
* Generated on: 6/28/19 2:38 PM
34-
* Build Level: p913-L190628
33+
* Generated on: 11/19/19 1:20 PM
34+
* Build Level: p914-L191119
3535
* Build Type: Production
3636
* <END_BUILDINFO>
3737
*/
@@ -1002,7 +1002,7 @@ const (
10021002
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
10031003
MQCMDI_SEC_TIMER_ZERO int32 = 14
10041004
MQCMDI_SEC_UPPERCASE int32 = 21
1005-
MQCMDL_CURRENT_LEVEL int32 = 913
1005+
MQCMDL_CURRENT_LEVEL int32 = 914
10061006
MQCMDL_LEVEL_1 int32 = 100
10071007
MQCMDL_LEVEL_101 int32 = 101
10081008
MQCMDL_LEVEL_110 int32 = 110
@@ -1041,6 +1041,7 @@ const (
10411041
MQCMDL_LEVEL_911 int32 = 911
10421042
MQCMDL_LEVEL_912 int32 = 912
10431043
MQCMDL_LEVEL_913 int32 = 913
1044+
MQCMDL_LEVEL_914 int32 = 914
10441045
MQCMD_ACCOUNTING_MQI int32 = 167
10451046
MQCMD_ACCOUNTING_Q int32 = 168
10461047
MQCMD_ACTIVITY_MSG int32 = 69
@@ -1764,6 +1765,7 @@ const (
17641765
MQIACF_DESTINATION_CLASS int32 = 1273
17651766
MQIACF_DISCONNECT_TIME int32 = 1381
17661767
MQIACF_DISCONTINUITY_COUNT int32 = 1237
1768+
MQIACF_DS_ENCRYPTED int32 = 1436
17671769
MQIACF_DURABLE_SUBSCRIPTION int32 = 1274
17681770
MQIACF_ENCODING int32 = 1243
17691771
MQIACF_ENTITY_TYPE int32 = 1118
@@ -1796,7 +1798,7 @@ const (
17961798
MQIACF_INVALID_DEST_COUNT int32 = 1371
17971799
MQIACF_ITEM_COUNT int32 = 1378
17981800
MQIACF_KNOWN_DEST_COUNT int32 = 1369
1799-
MQIACF_LAST_USED int32 = 1435
1801+
MQIACF_LAST_USED int32 = 1436
18001802
MQIACF_LDAP_CONNECTION_STATUS int32 = 1409
18011803
MQIACF_LISTENER_ATTRS int32 = 1222
18021804
MQIACF_LISTENER_STATUS_ATTRS int32 = 1223
@@ -4260,6 +4262,7 @@ const (
42604262
MQSECPROT_SSLV30 int32 = 1
42614263
MQSECPROT_TLSV10 int32 = 2
42624264
MQSECPROT_TLSV12 int32 = 4
4265+
MQSECPROT_TLSV13 int32 = 8
42634266
MQSECSW_ALTERNATE_USER int32 = 7
42644267
MQSECSW_COMMAND int32 = 8
42654268
MQSECSW_COMMAND_RESOURCES int32 = 11

ibmmq/cmqc_linux_amd64.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ package ibmmq
3030
****************************************************************
3131
*
3232
* <BEGIN_BUILDINFO>
33-
* Generated on: 6/28/19 2:38 PM
34-
* Build Level: p913-L190628
33+
* Generated on: 11/19/19 1:20 PM
34+
* Build Level: p914-L191119
3535
* Build Type: Production
3636
* <END_BUILDINFO>
3737
*/
@@ -1002,7 +1002,7 @@ const (
10021002
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
10031003
MQCMDI_SEC_TIMER_ZERO int32 = 14
10041004
MQCMDI_SEC_UPPERCASE int32 = 21
1005-
MQCMDL_CURRENT_LEVEL int32 = 913
1005+
MQCMDL_CURRENT_LEVEL int32 = 914
10061006
MQCMDL_LEVEL_1 int32 = 100
10071007
MQCMDL_LEVEL_101 int32 = 101
10081008
MQCMDL_LEVEL_110 int32 = 110
@@ -1041,6 +1041,7 @@ const (
10411041
MQCMDL_LEVEL_911 int32 = 911
10421042
MQCMDL_LEVEL_912 int32 = 912
10431043
MQCMDL_LEVEL_913 int32 = 913
1044+
MQCMDL_LEVEL_914 int32 = 914
10441045
MQCMD_ACCOUNTING_MQI int32 = 167
10451046
MQCMD_ACCOUNTING_Q int32 = 168
10461047
MQCMD_ACTIVITY_MSG int32 = 69
@@ -1764,6 +1765,7 @@ const (
17641765
MQIACF_DESTINATION_CLASS int32 = 1273
17651766
MQIACF_DISCONNECT_TIME int32 = 1381
17661767
MQIACF_DISCONTINUITY_COUNT int32 = 1237
1768+
MQIACF_DS_ENCRYPTED int32 = 1436
17671769
MQIACF_DURABLE_SUBSCRIPTION int32 = 1274
17681770
MQIACF_ENCODING int32 = 1243
17691771
MQIACF_ENTITY_TYPE int32 = 1118
@@ -1796,7 +1798,7 @@ const (
17961798
MQIACF_INVALID_DEST_COUNT int32 = 1371
17971799
MQIACF_ITEM_COUNT int32 = 1378
17981800
MQIACF_KNOWN_DEST_COUNT int32 = 1369
1799-
MQIACF_LAST_USED int32 = 1435
1801+
MQIACF_LAST_USED int32 = 1436
18001802
MQIACF_LDAP_CONNECTION_STATUS int32 = 1409
18011803
MQIACF_LISTENER_ATTRS int32 = 1222
18021804
MQIACF_LISTENER_STATUS_ATTRS int32 = 1223
@@ -4260,6 +4262,7 @@ const (
42604262
MQSECPROT_SSLV30 int32 = 1
42614263
MQSECPROT_TLSV10 int32 = 2
42624264
MQSECPROT_TLSV12 int32 = 4
4265+
MQSECPROT_TLSV13 int32 = 8
42634266
MQSECSW_ALTERNATE_USER int32 = 7
42644267
MQSECSW_COMMAND int32 = 8
42654268
MQSECSW_COMMAND_RESOURCES int32 = 11

ibmmq/cmqc_linux_ppc64le.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ package ibmmq
3030
****************************************************************
3131
*
3232
* <BEGIN_BUILDINFO>
33-
* Generated on: 6/28/19 2:38 PM
34-
* Build Level: p913-L190628
33+
* Generated on: 11/19/19 1:20 PM
34+
* Build Level: p914-L191119
3535
* Build Type: Production
3636
* <END_BUILDINFO>
3737
*/
@@ -1002,7 +1002,7 @@ const (
10021002
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
10031003
MQCMDI_SEC_TIMER_ZERO int32 = 14
10041004
MQCMDI_SEC_UPPERCASE int32 = 21
1005-
MQCMDL_CURRENT_LEVEL int32 = 913
1005+
MQCMDL_CURRENT_LEVEL int32 = 914
10061006
MQCMDL_LEVEL_1 int32 = 100
10071007
MQCMDL_LEVEL_101 int32 = 101
10081008
MQCMDL_LEVEL_110 int32 = 110
@@ -1041,6 +1041,7 @@ const (
10411041
MQCMDL_LEVEL_911 int32 = 911
10421042
MQCMDL_LEVEL_912 int32 = 912
10431043
MQCMDL_LEVEL_913 int32 = 913
1044+
MQCMDL_LEVEL_914 int32 = 914
10441045
MQCMD_ACCOUNTING_MQI int32 = 167
10451046
MQCMD_ACCOUNTING_Q int32 = 168
10461047
MQCMD_ACTIVITY_MSG int32 = 69
@@ -1764,6 +1765,7 @@ const (
17641765
MQIACF_DESTINATION_CLASS int32 = 1273
17651766
MQIACF_DISCONNECT_TIME int32 = 1381
17661767
MQIACF_DISCONTINUITY_COUNT int32 = 1237
1768+
MQIACF_DS_ENCRYPTED int32 = 1436
17671769
MQIACF_DURABLE_SUBSCRIPTION int32 = 1274
17681770
MQIACF_ENCODING int32 = 1243
17691771
MQIACF_ENTITY_TYPE int32 = 1118
@@ -1796,7 +1798,7 @@ const (
17961798
MQIACF_INVALID_DEST_COUNT int32 = 1371
17971799
MQIACF_ITEM_COUNT int32 = 1378
17981800
MQIACF_KNOWN_DEST_COUNT int32 = 1369
1799-
MQIACF_LAST_USED int32 = 1435
1801+
MQIACF_LAST_USED int32 = 1436
18001802
MQIACF_LDAP_CONNECTION_STATUS int32 = 1409
18011803
MQIACF_LISTENER_ATTRS int32 = 1222
18021804
MQIACF_LISTENER_STATUS_ATTRS int32 = 1223
@@ -4260,6 +4262,7 @@ const (
42604262
MQSECPROT_SSLV30 int32 = 1
42614263
MQSECPROT_TLSV10 int32 = 2
42624264
MQSECPROT_TLSV12 int32 = 4
4265+
MQSECPROT_TLSV13 int32 = 8
42634266
MQSECSW_ALTERNATE_USER int32 = 7
42644267
MQSECSW_COMMAND int32 = 8
42654268
MQSECSW_COMMAND_RESOURCES int32 = 11

ibmmq/cmqc_linux_s390x.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ package ibmmq
3030
****************************************************************
3131
*
3232
* <BEGIN_BUILDINFO>
33-
* Generated on: 6/28/19 2:38 PM
34-
* Build Level: p913-L190628
33+
* Generated on: 11/19/19 1:20 PM
34+
* Build Level: p914-L191119
3535
* Build Type: Production
3636
* <END_BUILDINFO>
3737
*/
@@ -1002,7 +1002,7 @@ const (
10021002
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
10031003
MQCMDI_SEC_TIMER_ZERO int32 = 14
10041004
MQCMDI_SEC_UPPERCASE int32 = 21
1005-
MQCMDL_CURRENT_LEVEL int32 = 913
1005+
MQCMDL_CURRENT_LEVEL int32 = 914
10061006
MQCMDL_LEVEL_1 int32 = 100
10071007
MQCMDL_LEVEL_101 int32 = 101
10081008
MQCMDL_LEVEL_110 int32 = 110
@@ -1041,6 +1041,7 @@ const (
10411041
MQCMDL_LEVEL_911 int32 = 911
10421042
MQCMDL_LEVEL_912 int32 = 912
10431043
MQCMDL_LEVEL_913 int32 = 913
1044+
MQCMDL_LEVEL_914 int32 = 914
10441045
MQCMD_ACCOUNTING_MQI int32 = 167
10451046
MQCMD_ACCOUNTING_Q int32 = 168
10461047
MQCMD_ACTIVITY_MSG int32 = 69
@@ -1764,6 +1765,7 @@ const (
17641765
MQIACF_DESTINATION_CLASS int32 = 1273
17651766
MQIACF_DISCONNECT_TIME int32 = 1381
17661767
MQIACF_DISCONTINUITY_COUNT int32 = 1237
1768+
MQIACF_DS_ENCRYPTED int32 = 1436
17671769
MQIACF_DURABLE_SUBSCRIPTION int32 = 1274
17681770
MQIACF_ENCODING int32 = 1243
17691771
MQIACF_ENTITY_TYPE int32 = 1118
@@ -1796,7 +1798,7 @@ const (
17961798
MQIACF_INVALID_DEST_COUNT int32 = 1371
17971799
MQIACF_ITEM_COUNT int32 = 1378
17981800
MQIACF_KNOWN_DEST_COUNT int32 = 1369
1799-
MQIACF_LAST_USED int32 = 1435
1801+
MQIACF_LAST_USED int32 = 1436
18001802
MQIACF_LDAP_CONNECTION_STATUS int32 = 1409
18011803
MQIACF_LISTENER_ATTRS int32 = 1222
18021804
MQIACF_LISTENER_STATUS_ATTRS int32 = 1223
@@ -4260,6 +4262,7 @@ const (
42604262
MQSECPROT_SSLV30 int32 = 1
42614263
MQSECPROT_TLSV10 int32 = 2
42624264
MQSECPROT_TLSV12 int32 = 4
4265+
MQSECPROT_TLSV13 int32 = 8
42634266
MQSECSW_ALTERNATE_USER int32 = 7
42644267
MQSECSW_COMMAND int32 = 8
42654268
MQSECSW_COMMAND_RESOURCES int32 = 11

ibmmq/cmqc_windows.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ package ibmmq
3030
****************************************************************
3131
*
3232
* <BEGIN_BUILDINFO>
33-
* Generated on: 6/28/19 2:38 PM
34-
* Build Level: p913-L190628
33+
* Generated on: 11/19/19 1:20 PM
34+
* Build Level: p914-L191119
3535
* Build Type: Production
3636
* <END_BUILDINFO>
3737
*/
@@ -1002,7 +1002,7 @@ const (
10021002
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
10031003
MQCMDI_SEC_TIMER_ZERO int32 = 14
10041004
MQCMDI_SEC_UPPERCASE int32 = 21
1005-
MQCMDL_CURRENT_LEVEL int32 = 913
1005+
MQCMDL_CURRENT_LEVEL int32 = 914
10061006
MQCMDL_LEVEL_1 int32 = 100
10071007
MQCMDL_LEVEL_101 int32 = 101
10081008
MQCMDL_LEVEL_110 int32 = 110
@@ -1041,6 +1041,7 @@ const (
10411041
MQCMDL_LEVEL_911 int32 = 911
10421042
MQCMDL_LEVEL_912 int32 = 912
10431043
MQCMDL_LEVEL_913 int32 = 913
1044+
MQCMDL_LEVEL_914 int32 = 914
10441045
MQCMD_ACCOUNTING_MQI int32 = 167
10451046
MQCMD_ACCOUNTING_Q int32 = 168
10461047
MQCMD_ACTIVITY_MSG int32 = 69
@@ -1764,6 +1765,7 @@ const (
17641765
MQIACF_DESTINATION_CLASS int32 = 1273
17651766
MQIACF_DISCONNECT_TIME int32 = 1381
17661767
MQIACF_DISCONTINUITY_COUNT int32 = 1237
1768+
MQIACF_DS_ENCRYPTED int32 = 1436
17671769
MQIACF_DURABLE_SUBSCRIPTION int32 = 1274
17681770
MQIACF_ENCODING int32 = 1243
17691771
MQIACF_ENTITY_TYPE int32 = 1118
@@ -1796,7 +1798,7 @@ const (
17961798
MQIACF_INVALID_DEST_COUNT int32 = 1371
17971799
MQIACF_ITEM_COUNT int32 = 1378
17981800
MQIACF_KNOWN_DEST_COUNT int32 = 1369
1799-
MQIACF_LAST_USED int32 = 1435
1801+
MQIACF_LAST_USED int32 = 1436
18001802
MQIACF_LDAP_CONNECTION_STATUS int32 = 1409
18011803
MQIACF_LISTENER_ATTRS int32 = 1222
18021804
MQIACF_LISTENER_STATUS_ATTRS int32 = 1223
@@ -4260,6 +4262,7 @@ const (
42604262
MQSECPROT_SSLV30 int32 = 1
42614263
MQSECPROT_TLSV10 int32 = 2
42624264
MQSECPROT_TLSV12 int32 = 4
4265+
MQSECPROT_TLSV13 int32 = 8
42634266
MQSECSW_ALTERNATE_USER int32 = 7
42644267
MQSECSW_COMMAND int32 = 8
42654268
MQSECSW_COMMAND_RESOURCES int32 = 11

ibmmq/mqi.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,19 @@ func (x *MQQueueManager) Disc() error {
234234

235235
savedConn := x.hConn
236236
C.MQDISC(&x.hConn, &mqcc, &mqrc)
237-
238237
mqreturn := MQReturn{MQCC: int32(mqcc),
239238
MQRC: int32(mqrc),
240239
verb: "MQDISC",
241240
}
242241

242+
if int32(mqrc) != C.MQRC_HCONN_ERROR {
243+
cbRemoveConnection(savedConn)
244+
}
245+
243246
if mqcc != C.MQCC_OK {
244247
return &mqreturn
245248
}
246249

247-
cbRemoveConnection(savedConn)
248-
249250
return nil
250251
}
251252

ibmmq/mqiPCF.go

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package ibmmq
22

33
/*
4-
Copyright (c) IBM Corporation 2016,2018
4+
Copyright (c) IBM Corporation 2016,2019
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.
@@ -31,6 +31,7 @@ import (
3131
"encoding/binary"
3232
"encoding/hex"
3333
"fmt"
34+
"runtime/debug"
3435
)
3536

3637
/*
@@ -121,7 +122,12 @@ func (cfh *MQCFH) Bytes() []byte {
121122

122123
/*
123124
Bytes serialises a PCFParameter into the C structure
124-
corresponding to its type
125+
corresponding to its type.
126+
127+
TODO: Only a subset of the PCF
128+
parameter types are handled here - those needed for
129+
command queries. Other types could be added if
130+
necessary later.
125131
*/
126132
func (p *PCFParameter) Bytes() []byte {
127133
var buf []byte
@@ -173,7 +179,7 @@ func (p *PCFParameter) Bytes() []byte {
173179
offset += 4
174180
copy(buf[offset:], []byte(p.String[0]))
175181
default:
176-
fmt.Println("mqiPCF.go: Trying to serialise PCF parameter. Unknown PCF type ", p.Type)
182+
fmt.Printf("mqiPCF.go: Trying to serialise PCF parameter. Unknown PCF type %d\n", p.Type)
177183
}
178184
return buf
179185
}
@@ -224,8 +230,8 @@ func ReadPCFParameter(buf []byte) (*PCFParameter, int) {
224230
binary.Read(p, endian, &pcfParm.strucLength)
225231

226232
switch pcfParm.Type {
227-
// There are more PCF element types but the samples only
228-
// needed a subset
233+
// There are more PCF element types but the monitoring packages only
234+
// needed a subset. We can add the others later if necessary.
229235
case C.MQCFT_INTEGER:
230236
binary.Read(p, endian, &pcfParm.Parameter)
231237
binary.Read(p, endian, &i32)
@@ -289,7 +295,14 @@ func ReadPCFParameter(buf []byte) (*PCFParameter, int) {
289295
p.Next(int(pcfParm.strucLength - offset))
290296

291297
default:
292-
fmt.Println("mqiPCF.go: Unknown PCF type ", pcfParm.Type)
298+
// This should not happen, but if it does then dump various pieces of
299+
// debug information that might help solve the problem.
300+
// TODO: Put this in something like an environment variable control option
301+
localerr := fmt.Errorf("mqiPCF.go: Unknown PCF type %d", pcfParm.Type)
302+
fmt.Println("Error: ", localerr)
303+
fmt.Println("Buffer: ", buf)
304+
debug.PrintStack()
305+
// After dumping the stack, we will try to carry on regardless.
293306
// Skip the remains of this structure, assuming it really is
294307
// PCF and we just don't know how to process the element type
295308
p.Next(int(pcfParm.strucLength - 8))

0 commit comments

Comments
 (0)