import pymqi

# qmgr = pymqi.connect('QM.1', 'SVRCONN.CHANNEL.1', '192.168.1.121(1434)')

qmgr = pymqi.connect('VIMSRRI10', 'SYSTEM.DEF.SVRCONN', '172.18.21.5(1415)')
pcf = pymqi.PCFExecute(qmgr)

# attrs = 
# {
#   pymqi.CMQC.MQCA_Q_NAME :'*',
#   pymqi.CMQC.MQIA_Q_TYPE : pymqi.CMQC.MQQT_LOCAL,
#   pymqi.CMQCFC.MQIACF_Q_ATTRS : pymqi.CMQC.MQCA_Q_NAME
# }

# -m VIMSRRP10 -d VIMS.LSP_CO.BMW -h 172.18.21.5
# channel = "SYSTEM.DEF.SVRCONN";

getq = pymqi.Queue(qmgr, 'VIMS.LSP_ASN.BMW')
depth = getq.inquire(pymqi.CMQC.MQIA_CURRENT_Q_DEPTH)
if (depth > 0):
	message = getq.get()
	print('Here is the message:', message)
else:
	print ('queue is empty')
	
getq.close()
	