Skip to content

Commit

Permalink
Update for MQ 9.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ibmmqmet committed Feb 29, 2024
1 parent 7e8e28b commit b3442b6
Show file tree
Hide file tree
Showing 30 changed files with 516 additions and 177 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Changelog
Newest updates are at the top of this file.

## xxx xx 2023 - v5.5.x
## Feb 29 2024 - v5.5.4
- Update for MQ 9.3.5
- ibmmq - Add simple tracing for MQI calls (MQIGO_TRACE env var)
- samples - Add sample obtaining and using a JWT token
- Make Go 1.18 baseline compiler

## Nov 13 2023 - v5.5.3
- mqmetric - MQ 9.3 permits resource subscriptions for queues with '/' in name
Expand Down
3 changes: 1 addition & 2 deletions DEPRECATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Removal of function will only happen on a major version change.
**Note:** There is no date currently planned for a new major release.

## In next minor version
The compiler will be set to use Go 1.17 at minimum from
the +build lines in the directives
Go compiler version moved forward if necessary

## In next major version
The following interfaces are planned to be removed:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG BASE_IMAGE=ubuntu:18.04
FROM $BASE_IMAGE

ARG GOPATH_ARG="/go"
ARG GOVERSION=1.17
ARG GOVERSION=1.18
ARG GOARCH=amd64
ARG MQARCH=X64

Expand Down Expand Up @@ -60,7 +60,7 @@ RUN mkdir -p $GOPATH/src $GOPATH/bin $GOPATH/pkg \
# Location of the downloadable MQ client package \
ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
RDTAR="IBM-MQC-Redist-Linux${MQARCH}.tar.gz" \
VRMF=9.3.4.0
VRMF=9.3.5.0

# Install the MQ client from the Redistributable package. This also contains the
# header files we need to compile against. Setup the subset of the package
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module github.com/ibm-messaging/mq-golang/v5

go 1.16
go 1.18

9 changes: 5 additions & 4 deletions ibmmq/cmqc_aix.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package ibmmq
* for each value; those can be found in other header files such as
* cmqc.h.
****************************************************************
* Copyright (c) IBM Corporation 1993, 2023
* Copyright (c) IBM Corporation 1993, 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 9/27/23 11:53 AM
* Build Level: p934-L230927
* Generated on: 2/1/24 12:04 PM
* Build Level: p935-L240201
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 934
MQCMDL_CURRENT_LEVEL int32 = 935
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1084,6 +1084,7 @@ const (
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMDL_LEVEL_934 int32 = 934
MQCMDL_LEVEL_935 int32 = 935
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
9 changes: 5 additions & 4 deletions ibmmq/cmqc_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package ibmmq
* for each value; those can be found in other header files such as
* cmqc.h.
****************************************************************
* Copyright (c) IBM Corporation 1993, 2023
* Copyright (c) IBM Corporation 1993, 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 9/27/23 11:53 AM
* Build Level: p934-L230927
* Generated on: 2/1/24 12:04 PM
* Build Level: p935-L240201
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 934
MQCMDL_CURRENT_LEVEL int32 = 935
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1084,6 +1084,7 @@ const (
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMDL_LEVEL_934 int32 = 934
MQCMDL_LEVEL_935 int32 = 935
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
9 changes: 5 additions & 4 deletions ibmmq/cmqc_linux_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package ibmmq
* for each value; those can be found in other header files such as
* cmqc.h.
****************************************************************
* Copyright (c) IBM Corporation 1993, 2023
* Copyright (c) IBM Corporation 1993, 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 9/27/23 11:53 AM
* Build Level: p934-L230927
* Generated on: 2/1/24 12:04 PM
* Build Level: p935-L240201
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 934
MQCMDL_CURRENT_LEVEL int32 = 935
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1084,6 +1084,7 @@ const (
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMDL_LEVEL_934 int32 = 934
MQCMDL_LEVEL_935 int32 = 935
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
9 changes: 5 additions & 4 deletions ibmmq/cmqc_linux_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package ibmmq
* for each value; those can be found in other header files such as
* cmqc.h.
****************************************************************
* Copyright (c) IBM Corporation 1993, 2023
* Copyright (c) IBM Corporation 1993, 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 9/27/23 11:53 AM
* Build Level: p934-L230927
* Generated on: 2/1/24 12:04 PM
* Build Level: p935-L240201
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 934
MQCMDL_CURRENT_LEVEL int32 = 935
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1084,6 +1084,7 @@ const (
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMDL_LEVEL_934 int32 = 934
MQCMDL_LEVEL_935 int32 = 935
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
9 changes: 5 additions & 4 deletions ibmmq/cmqc_linux_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package ibmmq
* for each value; those can be found in other header files such as
* cmqc.h.
****************************************************************
* Copyright (c) IBM Corporation 1993, 2023
* Copyright (c) IBM Corporation 1993, 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 9/27/23 11:53 AM
* Build Level: p934-L230927
* Generated on: 2/1/24 12:04 PM
* Build Level: p935-L240201
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 934
MQCMDL_CURRENT_LEVEL int32 = 935
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1084,6 +1084,7 @@ const (
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMDL_LEVEL_934 int32 = 934
MQCMDL_LEVEL_935 int32 = 935
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
9 changes: 5 additions & 4 deletions ibmmq/cmqc_linux_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package ibmmq
* for each value; those can be found in other header files such as
* cmqc.h.
****************************************************************
* Copyright (c) IBM Corporation 1993, 2023
* Copyright (c) IBM Corporation 1993, 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 9/27/23 11:53 AM
* Build Level: p934-L230927
* Generated on: 2/1/24 12:04 PM
* Build Level: p935-L240201
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 934
MQCMDL_CURRENT_LEVEL int32 = 935
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1084,6 +1084,7 @@ const (
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMDL_LEVEL_934 int32 = 934
MQCMDL_LEVEL_935 int32 = 935
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
9 changes: 5 additions & 4 deletions ibmmq/cmqc_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package ibmmq
* for each value; those can be found in other header files such as
* cmqc.h.
****************************************************************
* Copyright (c) IBM Corporation 1993, 2023
* Copyright (c) IBM Corporation 1993, 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 9/27/23 11:53 AM
* Build Level: p934-L230927
* Generated on: 2/1/24 12:04 PM
* Build Level: p935-L240201
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 934
MQCMDL_CURRENT_LEVEL int32 = 935
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1084,6 +1084,7 @@ const (
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMDL_LEVEL_934 int32 = 934
MQCMDL_LEVEL_935 int32 = 935
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
43 changes: 41 additions & 2 deletions ibmmq/mqiPCF.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ibmmq

/*
Copyright (c) IBM Corporation 2016,2019
Copyright (c) IBM Corporation 2016,2024
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,6 +62,7 @@ type MQEPH struct {
Format string
Control int32
Flags int32
Cfh MQCFH
}

/*
Expand Down Expand Up @@ -105,12 +106,22 @@ NewMQEPH returns a PCF Embedded Header structure with correct initialisation
func NewMQEPH() *MQEPH {
eph := new(MQEPH)
eph.StrucLength = C.MQEPH_STRUC_LENGTH_FIXED
eph.Version = C.MQCFH_VERSION_1
eph.Version = C.MQEPH_VERSION_1
eph.Encoding = 0
eph.CodedCharSetId = C.MQCCSI_UNDEFINED
eph.Format = C.MQFMT_NONE
eph.Flags = C.MQEPH_NONE

eph.Cfh.Type = C.MQCFT_NONE
eph.Cfh.StrucLength = C.MQCFH_STRUC_LENGTH
eph.Cfh.Version = C.MQCFH_VERSION_3
eph.Cfh.Command = C.MQCMD_NONE
eph.Cfh.MsgSeqNumber = 1
eph.Cfh.Control = C.MQCFC_LAST
eph.Cfh.CompCode = C.MQCC_OK
eph.Cfh.Reason = C.MQRC_NONE
eph.Cfh.ParameterCount = 0

return eph
}

Expand Down Expand Up @@ -144,6 +155,34 @@ func (cfh *MQCFH) Bytes() []byte {
return buf
}

func (eph *MQEPH) Bytes() []byte {

// There's no constant defining the length of just the "EPH" wrapper.
// The STRUC_LENGTH_FIXED includes the CFH length. So we have to start
// by calculating it
buf := make([]byte, C.MQEPH_STRUC_LENGTH_FIXED-C.MQCFH_STRUC_LENGTH)
offset := 0

copy(buf[offset:], "EPH ")
offset += 4
endian.PutUint32(buf[offset:], uint32(eph.Version))
offset += 4
endian.PutUint32(buf[offset:], uint32(eph.StrucLength))
offset += 4
endian.PutUint32(buf[offset:], uint32(eph.Encoding))
offset += 4
endian.PutUint32(buf[offset:], uint32(eph.CodedCharSetId))
offset += 4
copy(buf[offset:], (eph.Format + space8)[0:8])
offset += 8
endian.PutUint32(buf[offset:], uint32(eph.Flags))
offset += 4

buf = append(buf, eph.Cfh.Bytes()...)

return buf
}

/*
Bytes serialises a PCFParameter into the C structure
corresponding to its type.
Expand Down
4 changes: 3 additions & 1 deletion ibmmq/mqistr.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package ibmmq
* for each value; those can be found in other header files such as
* cmqc.h.
****************************************************************
* Copyright (c) IBM Corporation 1993, 2023
* Copyright (c) IBM Corporation 1993, 2024
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1461,6 +1461,8 @@ func MQItoString(class string, value int) string {
s = "MQCMDL_LEVEL_933"
case 934:
s = "MQCMDL_LEVEL_934"
case 935:
s = "MQCMDL_LEVEL_935"
default:
s = ""
}
Expand Down

0 comments on commit b3442b6

Please sign in to comment.