troubleshooting Question

Python and MSMQ

Avatar of Dwezill
Dwezill asked on
4 Comments1 Solution4135 ViewsLast Modified:
I try to create a Python Script who will send a MSMQ message, aknolege the return etc I'm not able to acces the Queue. It's the first time I use MSMQ.

This is a extrac of the script I made. Note that I use a xsl to modified the first xml file I generate.

    def _transmit(self, xml):
        requestMSMQ = win32com.client.Dispatch("MSMQ.MSMQQueueInfo")
        requestMSMQ.FormatName = "DIRECT=OS:" + self._connectString
        requestQueue = requestMSMQ.Open(MQ_SEND_ACCESS, MQ_DENY_NONE)
        replyMSMQ = win32com.client.Dispatch("MSMQ.MSMQQueueInfo")
        replyMSMQ.FormatName = "DIRECT=OS:" + self._connectString + "_admin"
        ReplyQueue = ReplyQueueInfo.Open(MQ_SEND_ACCESS, MQ_DENY_NONE)
        message = win32com.client.Dispatch("MSMQ.MSMQMessage")
        message.AdminQueueInfo = replyMSMQ
        message.MaxTimeToReceive = 10
        message.Journal = MQMSG_JOURNAL + MQMSG_DEADLETTER
        message.Label = str(self._completed.Format("%Y-%m-%d %H:%M:%S"))
        message.Body = xml
        message.Delivery = MQMSG_DELIVERY_RECOVERABLE  
        replyMessage = ReplyQueue.Receive(ReceiveTimeout=10000)


        if ReplyMessage is None:
            self._raise("Failed to receive transmission confirmation.")
def main():


Thank for your help

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros