Skip to content

Commit f015e2b

Browse files
committed
Have to deal with another PCF datatype for inquiries
1 parent 250ef97 commit f015e2b

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

ibmmq/mqiPCF.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,24 @@ func (p *PCFParameter) Bytes() []byte {
140140
endian.PutUint32(buf[offset:], uint32(p.Int64Value[0]))
141141
offset += 4
142142

143+
case C.MQCFT_INTEGER_LIST:
144+
l := len(p.Int64Value)
145+
buf = make([]byte, C.MQCFIL_STRUC_LENGTH_FIXED+4*l)
146+
offset := 0
147+
148+
endian.PutUint32(buf[offset:], uint32(p.Type))
149+
offset += 4
150+
endian.PutUint32(buf[offset:], uint32(len(buf)))
151+
offset += 4
152+
endian.PutUint32(buf[offset:], uint32(p.Parameter))
153+
offset += 4
154+
endian.PutUint32(buf[offset:], uint32(l))
155+
offset += 4
156+
for i := 0; i < l; i++ {
157+
endian.PutUint32(buf[offset:], uint32(p.Int64Value[i]))
158+
offset += 4
159+
}
160+
143161
case C.MQCFT_STRING:
144162
buf = make([]byte, C.MQCFST_STRUC_LENGTH_FIXED+roundTo4(int32(len(p.String[0]))))
145163
offset := 0
@@ -154,6 +172,8 @@ func (p *PCFParameter) Bytes() []byte {
154172
endian.PutUint32(buf[offset:], uint32(len(p.String[0])))
155173
offset += 4
156174
copy(buf[offset:], []byte(p.String[0]))
175+
default:
176+
fmt.Println("mqiPCF.go: Trying to serialise PCF parameter. Unknown PCF type ", p.Type)
157177
}
158178
return buf
159179
}

mqmetric/queue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ func inquireQueueAttributes(objectPatternsList string) error {
212212

213213
// Can allow all the other fields to default
214214
cfh.Command = ibmmq.MQCMD_INQUIRE_Q
215+
cfh.ParameterCount = 0
215216

216217
// Add the parameters one at a time into a buffer
217218
pcfparm := new(ibmmq.PCFParameter)
@@ -337,7 +338,6 @@ func parseQAttrData(cfh *ibmmq.MQCFH, buf []byte) {
337338
if cfh.ParameterCount == 0 {
338339
return
339340
}
340-
341341
// Parse it once to extract the fields that are needed for the map key
342342
for parmAvail && cfh.CompCode != ibmmq.MQCC_FAILED {
343343
elem, bytesRead = ibmmq.ReadPCFParameter(buf[offset:])

0 commit comments

Comments
 (0)