Andru's WebLog

//Comments about technology and software architecture
>MySelf.Persist();

August 2004 - Posts

Playing with MSMQ transport in WSE2

As i I've been working in the new messaging framework we are developing i started to look for existing implementations for custom transports for WSE2.

So far i have found the following: MSMQ, SMTP, UDP and SQL. The one using MSMQ is from the excellent writer and MVP Roman Kiss (published at CodeProject) and i enjoyed this article very much. Roman also have written other fine articles, so give then a look.

Well, let's get to the point. I've been using this code as a base to build some MSMQ transport for WSE2 and I stumbled with a very annoying bug.
In the code that registers a new SoapReceiver the article sample code always pass a new instance of a receiver object instead of passing the Type of the receiver you want to use.
The SoapReceivers.Add method allows registering a new receiver using two different overloads: using an object instance or an object type.
The two behaviors go in the opposite direction as one uses always the same receiver instance for all process and the other way implies a creation of a new receiver at runtime when it’s needed.
So, I realize that the code in the SoapMsmqInputChannel from the article only supports only the first way of doing things, that’s it passing an instance and not an object type.
This bug was annoying because the behavior of the failure was very strange. When I try to pass an object type to the SoapReceivers.Add method all went fine until I discover that the message wasn’t dispatched to my receiver object because it's never found in the receivers collection.
Fortunately the bug is very easy to fix. Just add the code to take into account that the thing you found in the SoapReceivers collection maybe it’s an instance of an SoapReceiver object or maybe it’s an object Type and it’s your responsibility to create the instance.

To make the story short, the method Enqueue can be rewritten as follows:

public override void Enqueue(SoapEnvelope message)
{   
 // get the receiver for this endpoint
        SoapReceiver receiver;
 object recv = SoapReceivers.Receiver(_endpoint);

 if( recv is Type )
        {
            receiver = (SoapReceiver)Activator.CreateInstance((Type)recv);
        }
        else
        {
     // try to cast
            receiver = recv as SoapReceiver;
         }

 if(receiver != null)
 {
  // synchronous process message workflow
                // through the pipeline to the endpoint handler
  receiver.ProcessMessage(message);
 }
 else
  throw new Exception(string.Format(
                    "Missing a receiver for endpoint={0}",
                     endpoint.Address.Value));
}

 

I hope that this post help someone with the same problem I come across. I will continue working with this code making some enhancements and adding some features we need, and I will be posting my experiences here.

Best regards,


PS: i haven't compiled the above code (i'm writing it right here and now) so excuse me if it has some error or imperfection.

Andrés G Vettori
MCSE/MCSD/MCT
Leader of the C# Community of the Microsoft Users Group Argentina

Posted: Aug 21 2004, 01:37 AM by andresv | with no comments
Filed under:
Framework.Messaging "Technical Preview"

Today we were very busy putting toghether the pieces of our new messaging subsystem. It uses WSE2 exclusively and we are reusing as much code as we can, but also coding a lot to fill in the gaps we found.

One of this *huge* gaps is the support for some WS-* standard for reliable message delivery. We know that suport for WS-ReliableMessaging is in the works (maybe for WSE3 timeframe) but we need this now so we are going to develop that. So, we already started our work in that direction and found very little coding done but a lot of people interested in the same things we do. We are getting some help from the folks at the Plumbworks Orange project, but there are so much work to be done...

Other things we are working on are some custom transports (Memory Mapped Files and Named Pipes, the first one is very close to completion of a working prototype) and other things like a generic routing service, a protocol for discovery of nodes and a directory service for node registration, among other things.

When we have something to share i will post the news right here.

Andrés G Vettori
MCSE/MCSD/MCT
Leader of the C# Community of the
Microsoft Users Group Argentina

Posted: Aug 20 2004, 11:12 PM by andresv | with no comments
Filed under:
Starting Framework.Messaging

Hi guys, we are starting the coding of the proof-of-concept version of our brand new Messaging Subsystem.

For this, we are going for a full SOA implementation, using WSE 2.0. This subsystem will be the heart of the new Framework versions we will develop, and we want to make it as much fast, lighweight, flexible and reliable as we could.

We could take the FABRIQ route, but i think that we will try to leverage the power of the new WSE 2.0 instead of trying to rewrite the messaging core, but we need some additional features and WS-* protocols to make it work (e.g. WS-RealiableMessaging). In that field we are moving to implement the protocols we need to get started, and we are collaborating with the people of the Plumbwork Orange project at GotDotNet.

Well, we have some serious work to do, so let's get started.

Andrés G Vettori
MCSE/MCSD/MCT
Leader of the C# Community of the Microsoft Users Group Argentina

Posted: Aug 17 2004, 01:08 PM by andresv | with no comments
Filed under:
Retina.NET first steps!

Well, finally Retina.NET is showing some real advance. During the last weekend i managed to get a version of the Alejandria project (http://wiki.mug.org.ar) using Retina.NET as the persistance library.

So far the work is very basic, but i have working three persistent entities, and this with very little additional writing (no code, only some attributes and voilá!).

Retina.NET is an OR/M proyect i'm developping in my spare hours (if any), and i have published the project on the Retina GotDotNet workspace. If yoy are interested on participating in the project or give some feedback about it, you are welcome.

Best regards,

Andrés G Vettori
MCSE/MCSD/MCT

Leader of the C# Community of the Microsoft Users Group Argentina

Posted: Aug 17 2004, 12:39 PM by andresv | with no comments
Filed under:
A new open source ORM is born: Retina.NET

It's all about ORM and SOA. Apart from the vogue, this two topics are very exciting technologies and i have been working with these from some time.

Regarding ORM, i have developed the Retina.Net project totally in my free time (i owe my family a few hundred hours...) and is now in ALPHA stage. The persistence code is working and it has a nice architecture to begin with.

It's very extensible and i think that with some time and work (and maybe some help from the community) we will have a very nice ORM library to use in our projects. I have been working on this project for almost a year, and started using some other fine projects as base, particulary the Sisyphus project that seems to be dead since year 2002 and was an excellent startup but had several shortcomings that pushed me to start my own project.

The project is published on GotDotNet at http://workspaces.gotdotnet.com/retina and we hope that you guys maybe take a look at the source code and give me your opinions.

I will be posting some architecture and functional details in short.

See you!

Andrés G Vettori
MCSE/MCSD/MCT
Leader of the C# Community of the Microsoft Users Group Argentina

Posted: Aug 03 2004, 07:26 PM by andresv | with no comments
Filed under:
More Posts