Steve1999

continuing the msmq net binding adventure Smile

my client is sending messages to (no errors detected):

NetMsmqBinding binding = new NetMsmqBinding();
binding.Security.Mode = NetMsmqSecurityMode.None;
EndpointAddress address = new EndpointAddress(
@"net.msmq://localhost/private/WorkflowStateChange");
ChannelFactory<ISymyxWorkflowServiceCallback> channelFactory = new ChannelFactory<ISymyxWorkflowServiceCallback>(binding, address);
ISymyxWorkflowServiceCallback channel = channelFactory.CreateChannel();
channel.StateChanged(objectId, workflowDefinitionType, instanceId, stage);

on the listening side, i have as asp.net endpoint

<service name="Symyx.Vault.Service.VaultWorkflowService" behaviorConfiguration="returnFaults">
<endpoint address="net.msmq://localhost/private/WorkflowStateChange" contract="Symyx.Workflow.ISymyxWorkflowServiceCallback" binding="netMsmqBinding" bindingConfiguration="NonSecureMsmq"/>

However, when i run my client (iis stopped or not), i dont see any messages appear in the WorkflowStateChange queue. I've even attached the server side debugger to asp.net with a breakpoint in the impl. Nothing happening.

Not sure what's going on


Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

James Osborne - MSFT

If they got to the server side, but didn't get processed, they might be in one of the DeadLetterQueues for some reason.

-James





Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

Steve1999

thanks James, it appears that they're stacked in the "transactional dead-letter messages" in the System queue.

how do i figure out why/how they got there




Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

James Osborne - MSFT

Check the destination queue properties; if it is a transactional queue and you sent it non-transactional messages, they would go in the transactional DLQ.

-James





Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

Steve1999

I just looked. It's a nontransactional queue. messages are going into the transactional DLQ. not sure how to know if my messages are (non)transactional tho...




Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

James Osborne - MSFT

If you didn't send them under a transaction scope, they shouldn't be transactional. Are you sure those are the recent messages You might try clearing the messages out of all the queues and rerunning the program if that's not too much overhead.

Just a sanity check: your service operation isn't being invoked by these messages, right The messages go away if the service is running and gets dispatches them.

-James





Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

Sorin Alexander - MSFT

The "Class" column in MMC should give you an indication as to why the message ended up in the dead-letter queue. Click on the "Transactional dead-letter messages" queue under System Queues and you should be able to see it.



Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

Steve1999

i rebuilt everything and restarted everything. all messages cleared. i deleted the queue and recreated it as a nontransactional queue. the code has no transaction scoping.

the newly added messages are all going to the transactional DLQ under a "nontransactional" class.

is there a MSMQ or other log somewhere that tells why these messages are going to DLQ




Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

Sorin Alexander - MSFT

Hi Steve, my guess is that your operation implementation requires a transaction. You'll want to set "TransactionScopeRequired = false" in your OperationBehavior attribute. You'll also want to set ExactlyOnce to false on your bindings.

Out of curiosity, what's your scenario I am curious because sending queued messages transactionally gives you some benefits, such as poison message handling. You'll want to use non-transactional messages only if you don't care about data loss.





Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

Steve1999

Sorin, you're a champ. The reason i went nontransactional is because of MSMQ not supporting remote transactions. But, after thinking a bit about it, i converted to transactional.

i recreated the queue as transactional and put the message in a transaction scope. this time it worked. i suspect that the setting you suggested would be the ticket to the nontransactional case.

My suggestion is to get logs on why these things happen the way they do. this way we can figure this out more easily.

Thanks! Smile




Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

Steve1999

Sorin, one (hopefully) last question on this thread.

Now that the MSMQ messages are appearing in the queue, how do i get my (iis, svc) WCF service to pick them up

in my server (which happens to be a WCF service), I added this endpoint to my existing service:

<endpoint address="net.msmq://localhost/private/WorkflowStateChange" contract="Symyx.Workflow.ISymyxWorkflowServiceCallback" binding="netMsmqBinding" bindingConfiguration="NonSecureMsmq"/>

However, i set a breakpoint and attached to asp.net. it's not hitting it and the messages are still in the queue.











Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

Sorin Alexander - MSFT

Webhosting a queued service is a little tricky. This is only possible on Vista. IIS only supports the hosting of HTTP applications. As such, you won't be able to host an MSMQ application (which is non-HTTP) in IIS. Windows Vista and Longhorn Server introduce the Windows Activation Service (WAS) which allows the hosting of non-HTTP applications. Have a look at the following links for more information about hosting WCF applications:

Hosting Services:

http://msdn2.microsoft.com/en-us/library/ms730158.aspx

Hosting a WCF Service in WAS:

http://msdn2.microsoft.com/en-us/library/ms733109.aspx

MSMQ Activation:

http://msdn2.microsoft.com/en-us/library/ms752246.aspx

I hope that helps.





Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

Steve1999

this is my setup:

.Net forms client -> WCF asp.net serviceA -> WCF windows serviceB.

I'm using net.msmq to send messages (events) that i need persisted (if serviceA happens to not be running ) from serviceB back to serviceA. net.msmq was the best option i had, minus writing a bunch of boilerplate code myself.

you can put a net.tcp endpoint (server side) in serviceA scenario...why not msmq






Re: Windows Communication Foundation (Indigo) where have my netMsmqBinding messages gone?

Sorin Alexander - MSFT

Hi Steve, I don't quite understand what your system is trying to do. The arrows indicate that messages flow from serviceA to serviceB, but then you say that messages need to be persisted from serviceB to serviceA. A few questions to clarify the scenario for me:

Does the client send messages to serviceA or serviceB

Queues ensure durability of messages. Why do you need two services

Are both services running on the same machine, or separate physical machines

What OS are the services running on

I am also assuming that when you say "WCF asp.net service" you mean that the service is webhosted, is that correct