Hello,
\r\n
\r\nI am new around here so I hope I am not breaking any rules posting this.
\r\n
\r\nAnyway, I developed a client-server application in VB6 communicating through MSMQ. They run on Windows XP Professional, using MS Message Queuing 3.0.
\r\n
\r\nSo, my basic setup goes like this:
\r\n
\r\n- I have "n" clients sending messages to the server and receiving a reply from it.
\r\n- I use asynchronous messages, so no need transactions.
\r\n- I do not use triggers at all.
\r\n- My queue names in the server and the client are fixed.
\r\n- I use a workgroup, not AD, so I am only using private queues.
\r\n- I use the DIRECT=TCP:<IP ADDRESS> format name to send the messages.
\r\n- The clients get a dynamic IP from DHCP, the server has a fixed IP address.
\r\n
\r\nMy problem comes when the clients start up (the machine resets) and they start sending messages to the server. The server receives the messages and replies to the client, however the messages stay in the Outgoing queue for like 1.5 minutes (they start to pile up) until (I guess) it "finds" the destination queue and are finally delivered (all at once). After this first messages are received from the server, the following ones arrive quite fast (with random short delays every now and then only).
\r\n
\r\nI have tried the following to fix this:
\r\n
\r\n- Ping the server from the client while the client sends the first messages.
\r\n- Wait a few minutes after starting the client before sending the first messages.
\r\n- Add a "TcpNoDelay" Dword entry to both the client and the server registry with a value of "1" under the MSMQ "Parameters" folder.
\r\n- Turn off the windows firewall in both the server and the client.
\r\n
\r\nThe code I am using to send the message is the following:
\r\n
\r\n
\r\n
Code:
\r\n
Option Explicit\r\n\r\n\'Queue send variables\r\nPublic qSendMX As MSMQQueue\r\nPublic qSendInfoMX As New MSMQQueueInfo\r\nPublic msgSendMX As New MSMQMessage\r\n\r\n\'Connection string\r\nPublic strFormatNameSendMX As String\r\n\r\nPrivate Sub Form_Load()\r\n\r\nstrFormatNameSendMX = "DIRECT=TCP:10.20.2.48\\PRIVATE$\\CJM01RecQ"\r\n\r\n\'Assign the connection string to the send queue\r\nqSendInfoMX.FormatName = strFormatNameSendMX\r\n \r\nmsgSendMX.Body = "message"\r\nmsgSendMX.Label = "start"\r\n\r\nSet qSendMX = qSendInfoMX.Open(MQ_SEND_ACCESS, MQ_DENY_NONE)\r\n\r\nmsgSendMX.Send qSendMX\r\n\r\nqSendMX.Close\r\n\r\nEnd Sub
\r\n
And the code I use to read the message is the following:
\r\n
\r\n
\r\n
Code:
\r\n
Option Explicit\r\n\r\nPrivate Sub ReceiveMessage_Click()\r\n\r\nDim strFormatName As String\r\nDim qi As New MSMQQueueInfo\r\nDim msg As New MSMQMessage\r\nDim q As MSMQQueue\r\n\r\nOn Error Resume Next\r\n\r\nstrFormatName = "DIRECT=.\\PRIVATE$\\CJM01ReplyQ"\r\nqi.FormatName = strFormatName\r\n \r\nSet q = qi.Open(MQ_RECEIVE_ACCESS, MQ_DENY_NONE)\r\n\r\nSet msg = q.Receive(ReceiveTimeout:=1000)\r\n\r\nEnd Sub
\r\n
I really donīt know what else to do. The clients and the server are on an independent network from the rest of the machines and everything else seems to work pretty well, I just have this "first messages sent" delay problem. I have read about the ports needed by MSMQ but I am guessing that after turning the firewalls off this should not be a problem.
\r\n
\r\nWhat confuses me even more is the fact that the server program (a very small application which only receives and sends messages) does not seem to suffer from this problem, since it starts working right away after starting it, receiving and sending messages without any problem.
\r\n
\r\nI hope somebody can help me with this.
\r\n
\r\nThanks a lot.
\r\n \r\n\r\n