@@ -465,18 +465,21 @@ func inquireChannelAttributes(objectPatternsList string, infoMap map[string]*Obj
465465 cfh .ParameterCount ++
466466 buf = append (buf , pcfparm .Bytes ()... )
467467
468- // Add the parameters one at a time into a buffer
469- pcfparm = new (ibmmq.PCFParameter )
470- pcfparm .Type = ibmmq .MQCFT_INTEGER
471- pcfparm .Parameter = ibmmq .MQIACH_CHANNEL_TYPE
472- pcfparm .Int64Value = []int64 {int64 (ibmmq .MQCHT_SVRCONN )}
473- cfh .ParameterCount ++
474- buf = append (buf , pcfparm .Bytes ()... )
468+ // The original version of this function was only relevant for SVRCONN channels but DESCR is now being asked
469+ // for which applies to all channel types. It's OK to ask for attributes for the wrong type of channel though;
470+ // they are simply not returned.
471+
472+ //pcfparm = new(ibmmq.PCFParameter)
473+ //pcfparm.Type = ibmmq.MQCFT_INTEGER
474+ //pcfparm.Parameter = ibmmq.MQIACH_CHANNEL_TYPE
475+ //pcfparm.Int64Value = []int64{int64(ibmmq.MQCHT_SVRCONN)}
476+ //cfh.ParameterCount++
477+ //buf = append(buf, pcfparm.Bytes()...)
475478
476479 pcfparm = new (ibmmq.PCFParameter )
477480 pcfparm .Type = ibmmq .MQCFT_INTEGER_LIST
478481 pcfparm .Parameter = ibmmq .MQIACF_CHANNEL_ATTRS
479- pcfparm .Int64Value = []int64 {int64 (ibmmq .MQIACH_MAX_INSTANCES ), int64 (ibmmq .MQIACH_MAX_INSTS_PER_CLIENT )}
482+ pcfparm .Int64Value = []int64 {int64 (ibmmq .MQIACH_MAX_INSTANCES ), int64 (ibmmq .MQIACH_MAX_INSTS_PER_CLIENT ), int64 ( ibmmq . MQCACH_DESC ) }
480483 cfh .ParameterCount ++
481484 buf = append (buf , pcfparm .Bytes ()... )
482485
@@ -564,8 +567,18 @@ func parseChannelAttrData(cfh *ibmmq.MQCFH, buf []byte, infoMap map[string]*ObjI
564567 ci .exists = true
565568
566569 }
567- }
568570
571+ case ibmmq .MQCACH_DESC :
572+ v := elem .String [0 ]
573+ if v != "" {
574+ if ci , ok = infoMap [chlName ]; ! ok {
575+ ci = new (ObjInfo )
576+ infoMap [chlName ] = ci
577+ }
578+ ci .Description = v
579+ ci .exists = true
580+ }
581+ }
569582 }
570583
571584 return
0 commit comments