TargetProcess exceptions in System Log because of MSMQ errors

Posted on Friday, August 16, 2013 by Nicki

I recently started seeing some errors in the TargetProcess System log. Below is one example.

at Tp.Web.Global.ConfigureBusAndStructureMap() in c:\.jenkins\workspace\BuildPackage\Code\Main\Tp.App_Code\Global.asax.cs:line 209at NServiceBus.Unicast.UnicastBus.NServiceBus.IStartableBus.Start() in c:\Projects\TargetProcess\trunk\Code\Libs\NServiceBus\src\src\unicast\NServiceBus.Unicast\UnicastBus.cs:line 738at NServiceBus.Unicast.UnicastBus.NServiceBus.IStartableBus.Start(Action startupAction) in c:\Projects\TargetProcess\trunk\Code\Libs\NServiceBus\src\src\unicast\NServiceBus.Unicast\UnicastBus.cs:line 791at NServiceBus.Unicast.UnicastBus.InitializeSelf() in c:\Projects\TargetProcess\trunk\Code\Libs\NServiceBus\src\src\unicast\NServiceBus.Unicast\UnicastBus.cs:line 810at Tp.Integration.Messages.ServiceBus.Transport.UiPriority.MsmqUiPriorityTransport.ReceiveMessageLater(TransportMessage m) in c:\.jenkins\workspace\BuildPackage\Code\Main\Tp.Integration.Messages\ServiceBus\Transport\UiPriority\MsmqUiPriorityTransport.cs:line 310at Tp.Integration.Messages.ServiceBus.Transport.UiPriority.MsmqUiPriorityTransport.Send(TransportMessage m, String destination) in c:\.jenkins\workspace\BuildPackage\Code\Main\Tp.Integration.Messages\ServiceBus\Transport\UiPriority\MsmqUiPriorityTransport.cs:line 384at System.Messaging.MessageQueue.Send(Object obj, MessageQueueTransactionType transactionType)at System.Messaging.MessageQueue.SendInternal(Object obj, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)System.Messaging.MessageQueueException (0x80004005): Insufficient resources to perform operation.GET http://localhost/targetprocess2/2013-08-14 11:14:48,103 [3] ERROR Tp.Web.Global - Failed to configure TP to work with MSMQ because of the reason.

After investigating the cause I found that there were a lot of messages in some TargetProcess queues. To see the queues open Computer Management, expand Services and Applications, expand Message Queueing and click on Private Queues. You'll see a lot of queue names starting with "tp.". In my case queues for bugzilla integration and subversion integration had lots of messages in them and they reached their quota. To purge the queue(s), expand Private Queues, expand the queue you want to purge, right-click on Queue Messages, hover over All Tasks and click Purge. Click Yes if you want to purge the queues.
After purging all the queues with lots of messages I had to recycle the worker process that hosts Target Process, and the error was not logged in the System Log anymore.

C# - How to access a generic typed property

Posted on Thursday, August 15, 2013 by Nicki

My challenge for today was to get the value of generic typed properties from a generic type. Here is the code that worked.

pendingRequest is a generic-typed instance of RequestResponseAsyncResult where the Request and Response properties are generic.

First we have to get the generic type definition:

Type requestType = pendingRequest.GetType().GetGenericTypeDefinition();
Next we get the generic type arguments:
Type[] typeArgs = requestType.GetGenericArguments();
Then we create a generic base type from our generic type:
Type genericType = typeof(RequestResponseAsyncResult<,>);
The next step is to created a generic type according to the type arguments:
Type constructed = genericType.MakeGenericType(typeArgs);
Now we are able to get the property information:
PropertyInfo pireq = pendingRequest.GetType().GetProperty("Request");
PropertyInfo piresp = pendingRequest.GetType().GetProperty("Response");
Finally we can get our properties using reflection:
object request = pireq.GetValue(pendingRequest, null);
object response = piresp.GetValue(pendingRequest, null);



Android - how to move apps to SD storage from phone storage

Posted on Saturday, May 12, 2012 by Nicki

I recently acquired my first Android phone, a Samsung Galaxy Ace. Due to my limited budget, it's an entry level phone, so it does not have a lot of built-in storage, so I soon started running out, and had to look for ways to move apps off the phone storage. Here's how: http://www.bongizmo.com/blog/moving-all-android-apps-to-sdcard-apps2sd-froyo/

Authorization Manager check failed - FIX - for real this time!

Posted on Tuesday, January 17, 2012 by Nicki

We finally managed to find a fix for the above PowerShell error that pops up from time to time: restart the Windows Management Instrumentation (WMI) service!

SQL in the Wild » Blog Archive » Are all updates split into delete-insert?

Posted on Monday, June 27, 2011 by Nicki

SQL in the Wild » Blog Archive » Are all updates split into delete-insert?


Interesting post that debunks the myth that ALL updates are split into delete-insert pair.

Changing your culture

Posted on Thursday, June 9, 2011 by Nicki

I recently noticed that the same ASP.Net application behaves differently in terms of formatting between Windows Server 2003 and Windows Server 2008/Windows 7 for culture en-ZA.

Our application has functionality that exports a gridview to a CSV file, and this is where I picked up something is wrong, the digit separator showed as a  character, which is a unicode character which Excel does not handle well in CSV files.

On Windows Server 2003, the digit grouping symbol is a comma (,), whereas on Server 2008 and Windows 7 it is a unicode space. Apparently someone decided that change was necessary, I found a reference here: http://forums.asp.net/t/1424752.aspx/1

Closed a SQL query by accident? There is help

Posted on Tuesday, June 7, 2011 by Nicki

Have a look at this post: Oh ****! | Home Of The Scary DBA

And this one:
Recover Backed-up query files in SQL Server Management Studio