A question on using more then one NAS and MSMQ

I would appreciate some advice regarding using mulitple NAS instances (on the same Navision DB) and MSMQ. In this case is it appropriate to have a dedicated queue for each NAS or can mulitple NAS instances (using different single instance codeunits) monitor the same queue without any access conficts or bottlenecks? Thanks in advance. Chris.

If you use the same NAS to launch multiple single instance Codeunit, each one is still dependent on the others. The NAS can be seen as an Attain Client, and the client can only perform one action at a time. So if one of the Codeunits takes 5mins to read the MSMQ and take some action, all other Codeunits wait. It’s best to have the NAS perform one action. /Thomas

Thomas, My question relates to how I set up Microsoft Message Queue in a situation where multiple Navision Application Servers are running. From the perspective of our ASP pages that are placing the messages on the MSMQ it is easier to have just one MSMQ and I was posting to see if anyone had any experience of the situation where mulitple NAS services are monitoring the same queue. Thanks, Chris.

There are no problems in running multiple NAS instances to monitor the same queue. Both Navision and MSMQ can handle this. What you have to think about is what processing will be done. All the application servers have to use the same codeunit. This way it works, but you can’t tell in advance which NAS will handle your message if both app. servers were idle. I have done this with 3 application servers, and found no problems. All the application servers use the same (single instance) codeunit.

Vincent, Thanks for your reply. Your experience of pointing multiple NAS to the same queue is interesting. When you say that all the application servers have to use the same codeunit do you mean the single instance codeunit that has the ComCom and BusAdaptor objects and is actually monitoring the queue with the message received trigger? If so, how is this possible -as NAS is represents a client session running as a service does this violate the single instance nature of the MSMQ monitoring codeunit? I had anticipated splitting the processing of each NAS, using the startup parameter in function 99 of Application Management and pointing each NAS to its own single instance codeunit to monitor the same queue. Is my assumption correct? Thanks in advance. Chris.

Hi Chris, somehow it seems to work correct. You would indeed say that it violates the single instance nature, but for some reason it doesn’t. I checked if I could find something to explain this, but I can’t. Splitting up the processing of each NAS is, I think, always a possibility (I’m using my own communication components so for some reason I can use one single instance codeunit. Maybe the eventbinding on a messageQueue is sessionrelated. Or maybe the “single instance” is ignored in my database.)

Chris, say you don’t use a “single instance”-codeunit. The only problem one would have is that you can’t stop te process (say Process-A) once it’s started. The only way to stop the process-A is to terminate the owner of that process. This is eventually exactly what you do with a NAS. Using a “single instance”-codeunit you could monitor from a other Navision client if the codeunit is running or not. In the case above it’s not possible anymore.