diff --git a/code/ibmmq/mqxqh.py b/code/ibmmq/mqxqh.py index 92698af..3d6c80f 100644 --- a/code/ibmmq/mqxqh.py +++ b/code/ibmmq/mqxqh.py @@ -20,3 +20,9 @@ def __init__(self, **kw): ['RemoteQMgrName', b'', '48s'], ] super().__init__(tuple(opts), **kw) + + # Return the XQH as a formatted structure based on the message buffer. + def get_header(self, buf): + """Return the unpacked header from the full message buffer""" + xqh = super().unpack(buf[:CMQC.MQXQH_CURRENT_LENGTH - CMQC.MQMD_LENGTH_1]) + return xqh