Solved

MSMQ send works great under XP, fails silently on Server 2003

Posted on 2009-05-12
3
560 Views
Last Modified: 2013-12-03
I have created an application that uses MSMQ on XP.   It is time to being deploying and testing the app.   I have found that when I copy the files to  Windows 2003 Server that nothing ever "shows up" in the queue.  

This is a transactional, private queue reference via the string: @".\private$\myQueueName"

The entire code is surrounded by try-catch blocks, but no error is ever thrown.

I have set the permissions to be as permissive as possible to try to get something to show up in the queue.   (Everybody has full control.)

I am using transactions and the transaction's commit statement executes without any problems.

The queue is created from code, but I have also tried creating it by hand to see if it makes any difference.

I encountered a post on eggheadcafe referencing this exact problem: msmq works under xp, fails under 2003.  Unfortunately, no solution was ever posted.  (http://www.eggheadcafe.com/forumarchives/msmqprogramming/Jun2005/post23331195.asp
)
//get the messageQueue inst. var. ready for use
        MessageQueue messageQueue;
        if(MessageQueue.Exists(AppConst.QUEUE_PATH))
            messageQueue = new MessageQueue(AppConst.QUEUE_PATH);
        else
            messageQueue = MessageQueue.Create(AppConst.QUEUE_PATH, true);
                        
        MessageQueueTransaction mqTrans = new MessageQueueTransaction();
        
        
 
        mqTrans.Begin();
        try
        {
            messageQueue.Send(new Message(strXml,new XmlMessageFormatter()));
            mqTrans.Commit();
            if (AppConst.LOGGING_MODE_ENABLED)
            {
                TextWriter tw = File.AppendText(AppConst.QUEUE_TRANSACTION_LOG);
                tw.WriteLine();
                tw.Close();
            }
        }
        catch( Exception ex )
        {
            if (AppConst.DEBUGGING_MODE_ENABLED)
            {
                TextWriter tw = File.AppendText(AppConst.QUEUE_ERR_LOG_FILE);
                tw.WriteLine(ex.Message+ex.StackTrace+ex.StackTrace+ex.ToString());
                tw.Close();
            }
            mqTrans.Abort();
        }
        finally
        {
            messageQueue.Close();
            payloads.Clear();//Once you send to queue the Collection of payloads gets emptied
        }

Open in new window

0
Comment
Question by:trey_carroll
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:trey_carroll
ID: 24366338
Just discovered that the server that this is running on is Windows 2003 Server SP1.   Could this be the entire problem?
0
 
LVL 13

Expert Comment

by:dungla
ID: 24372366
0
 

Accepted Solution

by:
trey_carroll earned 0 total points
ID: 24455086
This error had to do with the fact that the virtual server that this app runs on ran out of memory and became corrupted.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Header Font Size in Grid View 6 50
ASP.NET data base connection 35 94
Convert VB web project to C# 3 66
Using the .NET JSON Serializer to create a single string 6 57
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question