Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stuck in queue.

47 views
Skip to first unread message

Wray Smallwood

unread,
Jun 3, 2003, 1:32:37 PM6/3/03
to
Seems 2 of my posts to this newsgroup never showed up. If they do my problem has been solved but I have a new one.
 
I have implemented a simple by the book learning example to implement MSMQ in .NET with declarative coding. I don't believe I have missed anything in the example implementation.
 
Message after message gets into the queue, but stay there forever in the primary queue. It never moves on the schedule of 38 minutes down the 5 retry queues to the deadqueue and the class it is supposed to be invoking never gets called (because the data never shows up in the database and breakpoints in it never get hit including the class constructor, and eventlog calls I added never get logged). This class worked as a normal transactional server app calling two other updating classes so it is not an inherent fault in the logic of updating the database.
 
I have no clue why the stuff just sits in the queue forever, but the queue is actually created by a regsvcs of the destination class, so it knows what it has to invoke.
 
What have I missed? The MSMQ service seems to running and the Message Queuing service appears to be online.
 
The essential elements are there

ord = (IOrdering) Marshal.BindToMoniker(@"queue:/new:Mynamespace.Ordering");
ord.PlaceOrder(cboCustomers.SelectedValue.ToString(), (

int) cboProducts.SelectedValue);
MessageBox.Show("Order placed in queue");
gets executed in the client with no Exception
 
The message queue class AssemblyInfo.cs file contains the proper

[assembly: ApplicationQueuing(Enabled=

true, QueueListenerEnabled=true)]

The message queue class itself contains the proper Attribute:

[InterfaceQueuing(Enabled=

true, Interface="IOrdering")]

The component has a strong name and has been added to the GAC.

Wray Smallwood

Tom Barnaby

unread,
Jun 3, 2003, 2:30:18 PM6/3/03
to
Hi Wray:
 
What you've described is a queued component, which is a service provide by COM+ that abstracts the MSMQ API calls. However, there are a couple extra steps you must take:
 
1. Register the component with COM+ using the regsvcs tool. For example:
 
regsvcs test.dll
 
2. Manually start the COM+ application (the queue listener). To do this, open the COM+ admin tool, right click on the applicition node (which gets created when you run regsvcs) and select "Start".
 
I think that will solve your problem.
 

--
Tom Barnaby
Author: Distributed .NET Programming in C#, Apress
            Distributed .NET Programming in VB .NET, Apress
www.intertech-inc.com
"Wray Smallwood" <wray_small...@attbi.com> wrote in message news:eghGaYfK...@TK2MSFTNGP09.phx.gbl...

Wray Smallwood

unread,
Jun 3, 2003, 7:06:57 PM6/3/03
to
Thanks,
 
It was the 2nd point. Nowhere in the article did it tell me to start the COM+ service. Every other COM+ service I have used has started automatically. And as a matter of fact I couldn't find this even mentioned in the MSDN. Seems like this ought to be something mentioned!. Wonder if this is unique to 3.0 and XP because this has to be a common problem?  I'd also wonder how to ask it to start automatically, but regsvcs doesn't appear to have a parameter to do that.
 
However, although after starting it, the messages disappeared from the primary queue, no database updates happened and none of my logevent messages logged in the Application log. The messages just moves down the queues on its 38 minute trip to the deadqueue. I can't see anywhere in the message display or the properties where it tells you the status of the message and why it isn't invoking the class. Is there a trick to that too?
 
After playing around with this for an hour now. I still can't figure out why the message can't invoke the class and just moves to the deadqueue. It's a direct connect queue on the same machine. Destination shows as
 
DIRECT=OS:ws1\private$\ordering applications with queued components 
 
I thought the private queue name with spaces (Application name with lower cases) was weird but it made no difference with a single word app name. When it reaches the deadqueue the Application log shows:

The COM+ Queued Components Player was unable to create an instance of a Queued Component. CPlayer BindToObject
Server Application ID: {42342981-E5AE-4CCB-A34D-2985FD46C604}
Server Application Instance ID:
{A51E4EA9-52D5-4ACC-BBAD-620DFA2A1FE6}
Server Application Name: Ordering Applications with queued components
Error Code = 0x80004005 : Unspecified error
COM+ Services Internals Information:
File: d:\nt\com\com1x\src\comsvcs\qc\player\player.cpp, Line: 453
Comsvcs.dll file version: ENU 2001.12.4414.46 shp
 
But this hardly gives me a clue why it doesn't invoke the class. What beats me is that this is an example right from a book and it obviously should work and has probably worked on at least one platform. I guess it's my MSMQ version or installation that's at fault.
 
Wray

Tom Barnaby

unread,
Jun 3, 2003, 10:26:29 PM6/3/03
to
Hi Wray:

Well, at least you made a little progress.

From the logged error message I'd guess that there was a problem binding to the assembly or loading the type library. You might want to check the fusion log to see if there were any errors there (use fuslgovw.exe).

If there is nothing there, then I'd guess somethings up with GUIDs or assembly versions. I would sequence through these steps and retry it.

1. Remove any and all complexity from the queued component.  Make it stupidly simple - no data access just write something to the event log.

2. If you haven't already, hard code the assembly version (regsvcs uses this to generate GUIDs, which COM+ uses to find and load the objects).

<assembly: AssemblyVersion("1.0.0.0")>

3. Just to make sure, I'd unregister the current COM+ application.

regsvcs -u qctest.dll

4. Rebuild the assembly.

5. Re-register the assembly with COM+

regsvcs qctest.dll

6. Install the new assembly in the GAC

gacutil -i qctest.dll

Lets see how that goes.

"What beats me is that this is an example right from a book" - may I suggest a different book? ;-)

"I'd also wonder how to ask it to start automatically, but regsvcs doesn't appear to have a parameter to do that." - The closest you can get, as far as I know, is to run the listener as a windows service. Do this in the COM+ Admin tool: right click on the application node, go to the Activation tab and select "run as windows service".

Wray Smallwood

unread,
Jun 5, 2003, 6:53:09 PM6/5/03
to
I actually had done almost everything in your list already. However fuslogvw was new. I however have not been able to get it to work. I set all the registry values to turn it on, but it never logs anything for anything I do on the system. At this point, I have given up on my system and have assumed that the code really is correct, it is just my system. I will have to go on to study other more exotic things that I hope will work. I had a look at your book and another by Ingo Rammer, but I'm not going to order them at this time even though Amazon has a deal if you pair them together ($69 for both). That's because I am still learning and it doesn't make sense to own an advanced book at this early stage (until I get a job and the company pays!!).
 
Thanks for you insight.
 
Wray
0 new messages