diff --git a/practice/isc.py b/practice/isc.py new file mode 100644 index 0000000..c380e85 --- /dev/null +++ b/practice/isc.py @@ -0,0 +1,35 @@ +import pymqi +import time +from khayyam import JalaliDatetime as datetime + +# export MQSERVER="ServerChannel/TCP/192.168.163.167(1418)" +# sudo -Eu mq LD_LIBRARY_PATH=/usr/lib64 /home/vahid/.virtualenvs/pymqi/bin/python ./isc.py +# sudo -Eu mq LD_LIBRARY_PATH=/usr/lib64 /home/vahid/.virtualenvs/pymqi/bin/python ./is + +# +# queue_manager = 'SaptaQueueManager1418' +# channel = 'ServerChannel' +# user = 'mq' +# password = 'mq' +# queue = 'SOTP' + +# export MQSERVER="CHANN1/TCP/192.168.1.70(9000)" +queue_manager = 'QMA' +channel = 'CHANN1' +user = 'mqm' +password = 'mqm' +queue = 'QUEUE1' + + +qm = pymqi.connect(queue_manager, channel=channel, user=user, password=password) +putq = pymqi.Queue(qm, queue) + + +for i in range(100000): + msg = '' % ( + datetime.now().strftime('%Y%m%d%H%M%S'), i + ) + print(msg) + putq.put(msg) + +