Wednesday, November 14, 2007

Message Queue Characteristics

Message Queues can be characterized by the following attributes:

Delivery

Guaranteed delivery of messages are provided by persistent queues, which store messages in files or databases. Non-persistent queues store messages in memory and thus message delivery is not guaranteed if the message queue provider fails. A persistent message queue is required to confirm the receipt and receive acknowledgement of the delivery of a message.

Transaction Support

Messages can be grouped together into a transaction, such that either none or all of the messages in the transaction would be processed by the client.

Messaging Models

The two types of domain models or messaging models are Peer-to-peer and Publish-subscribe. In the peer-to-peer model, the message from the queue is received by one recipient after which it is deleted from the queue. In the publish-subscribe model, the publisher sends a message to the queue with a topic and all registered subscribers receive the message.

Durable/Non-durable

A non-durable subscriber can receive messages only if it is connected to the message queue. A durable subscriber can receive unexpired messages after it reconnects to the queue.

Push/Pull Delivery Mechanism

Messages can be delivered by a queue using either a push mechanism where the queue actively sends the messages to the receiver, or a pull mechanism where the receiver polls the queue periodically to check for messages.


Synchronous and Asynchronous messaging

In synchronous messaging, a message isn't stored on a queue while sending, but a direct connection is established to a client where the message is placed on a target queue thus providing real-time delivery.

In asynchronous messaging, the message is placed onto a remote queue and is sent to an intermediary store for delivery to a client.

Virus Killer

While searching for an antivirus to run on Linux, I came across this game called the Virus Killer. In the game, you'll have to protect your files by blasting away the viruses that come crawling from Microsoft Outlook Express, Microsoft Internet Explorer and the Recycle Bin by zapping them with the mouse cursor. It's fun and the game's got a nice theme to it.

Tuesday, November 13, 2007

Auto-update of Windows Service

I was thinking about an developing application to perform an auto-update of a Windows service. In my previous post, I've posted details on controlling a windows service so to add more to it, I could get the path of the EXE from the registry at HKLM-System-CurrentControlSet-Service-[ServiceName]. So, if I could stop the service and replace the executables with a new version of the service, I could create an auto-updater for the service!

Now, if there's a DLL that's being started by svchost.exe, there's a name following the "-k" that represents multiple DLLs. Updating those is a story I'll write about some other time! :-)

My Web Windows Services Console

I've been thinking about working on a tiny web application to remotely start and stop Windows services via a browser and I finally stopped thinking and did something about it. It was remarkably simple with the GridView control and it took a little over fifteen minutes, including the time to chat via IM with a buddy.

I had to include the System.ServiceProcess assembly and calling the System.ServiceProcess.ServiceController.GetServices() method returned an array of System.ServiceProcess.ServiceController. Now, the GetServices method has an overload that takes a machine name but I haven't tried it yet. It probably needs either a Windows domain or some way to authenticate with the other machine - the former I don't have and the latter I can't be bothered with right now.

I added a Start/Stop button and it did actually effect the service, but I had to add an ASP.NET Button to act as a refresh button to actually see the new status of the service due to the time it takes to actually start/stop. I added a two second sleep and tested it against the Windows Time service but that didn't seem to work and I'm guessing I need a longer sleep time.

Anyway, that's as far as I'll build for my little web Windows Services console.

UPDATE: I decided to venture a little further and found the method ServiceController.WaitForStatus that takes in the desired status and timeout as parameters.

Monday, November 12, 2007

Remotely enable remote access

If you've forgotten to enable Remote Desktop on your Windows box and you really need to get in, there's a free bit of software from IntelliAdmin to enable it. Check it out at: http://www.intelliadmin.com/blog/2006/06/remotely-enable-remote-desktop.html

Inflexible ASP.NET Calendar control

The ASP.NET Calendar control forces developers to use Saturdays and Sundays as the weekend. Now, although this may seem insignificant, a lot of developers require a calendar control to display working and non-working days and they need to define these as the 'weekend' days. Also, some parts of the world observe the weekend on Friday and Saturday, or Thursday and Friday, or just Friday.

There is an awkward way - by overriding the DayRender event and resetting the styles for Saturday and Sunday, and applying the styles for the days you want to mark as non-working days.

Either way, when I'm developing a calendar control, I know what I'm going to build into it.

Wednesday, November 7, 2007

The Joys of Distance Interviewing

I'm having a first solo at recruitment and so I asked a co-worker about her experiences at hiring new staff. She mentioned about an online interview she took for .NET. She's into PHP and open-source technologies so she got a question off the Internet. The reply was the answer pasted from the same website!