Skip to main content

Posts

Showing posts with the label design patterns

[Post-event] ITCamp 2013

These days I participated at ITCamp 2013 . This year I had the opportunity to participate at a premium event with almost 400 attendees. For Romania, this is big number, it is hard to gather 400 people at a premium conference. What we found this year? COOL stuff. We discover what is the future of tablets, what is happening on the cloud and the voodoo magic that is happening inside the team management... and so on. I really enjoyed the conference, the sessions and especially the location – you could see all the city from above. Each year one of the most important thing at ITCamp is socialization – meeting people from different parts of the world, discover what they are doing and what are the trends of the IT industry. This year I had the opportunity to be invited as a speaker at ITCamp. Last year I talked about background task on Windows 8, but this year I decided to go on the cloud and talk about messaging pattern and how we can implement those patterns using Windows Azure Service...

Day 2 of Software Architecture 2012 & How an architect should be

This week I attended to Software Architecture 2012 conference from London. This was the second day of conference with 4 sessions per day on six tracks simultaneous. Here is the blog post of day one. There were great sessions about how software design and architecture. I really enjoyed the keynote, where Simon Brown talked about how software architecture should be. One thing that he mentioned and I thing that is very important is what an architecture should do. I think that we know a lot of architecture that don’t write code anymore and don’t learn new technologies. They climb on the Ivory Tower and when we have a question throw a response like: “Implementation detail”. How you can define a solution when you don’t know the technology? Yep, that type of “guru” is only a PowerPoint architected and nothing more. He is the perfect person that can draw components on a white paper and the first person that will run when a project will have problems. In that moment he will show t...

Different methods to implement Message Aggregator pattern using Service Bus Topic – CorrelationId

In one of my last post I presented the Aggregator Pattern . The main purpose of this pattern is the ability of the consumer to combine (aggregate) messages. This pattern can be implemented in Windows Azure using Windows Azure Service Bus Queues or Topics. There are two different implementation for this pattern. The implementations are extremely different and also can affect our performance. The first implementation requires using the Session support from BrokeredMessage. What this means from the code perspective? We need to set the Session each time when we want to send a message. The consumer will start to consume the messages with the specific session id. This solution is simple and it works great when we don’t have a lot of messages. For example if we have only 9-10 messages. The first advantage of this implementation is on the consumer side. We don’t need to create the consume before messages are added to the Service Bus. The messages will be persisted in the Service Bus infrast...

Windows Azure Service Bus Patterns - a comprehensive look at patterns that can be used in combination with Windows Azure Service Bus

In the last period of time I posted a lot about pattern that can be used in combination with Windows Azure Service Bus. This is the list of all the patterns that I presented until now: Message Splitter Pattern Message Filter Pattern  Message Aggregator Pattern Recipient List Pattern    Resequencer Pattern Content-Based Router Pattern Scatter-Gather Pattern  Dynamic Router Pattern  If you want to find more information about Windows Azure Service Bus Topic, please follow this LINK . For more information about Windows Azure Serbice Bus Queue please follow this LINK .

Patterns in Windows Azure Service Bus - Dynamic Router Pattern

Last time we talked about Scatter-Gather Pattern and how we can implement it using Windows Azure Service Bus. Today, we will look over Dynamic Router Pattern and how can be integrated in Windows Azure Service Bus. First of all, let’s see what Dynamic Router is. This is a pattern that can be used when we want to register at runtime different rules and based on this rules the messages are redirected to a specific consumers. This sounds pretty simple in the first moment, but we have 2 different situations that need to be handled. The first one is from the consumer perspective.  In any moment we need to be able to change the rules or add new rules, without stopping the system. These rules can use properties from messages that didn’t exist when the system started. The second situations are from the producer. At runtime we need to be able to add or remove properties that can be handled by the system when the routing is made without restarting the system or affecting the consumers. T...

Patterns in Windows Azure Service Bus - Scatter-Gather Pattern

I will continue the series of posts related to patterns that can be used using Service Bus from Windows Azure. In the last post from this blog series I talked about Content-Based Router Pattern and we saw how easily can be implemented using Service Bus Topics. Today we will look over another message pattern. I don’t know if you ever heard about Scatter-Gather message pattern. It is not a widely used pattern. Also there are a lot of cased when we use this pattern without realizing. The first step is to try to define this pattern. As you can see, this pattern is formed from two different words – scatter and gather. Scatter – refers how we can send a message to a list of receivers (consumers) Gather – refers how we receive a collection of messages from more than one source Before talking more about this pattern let’s see an example where this pattern can be used with success. Very easily we can imagine that we are a company that wants to by surfaces (Windows 8 Tables) for all your ...

Patterns in Windows Azure Service Bus - Content-Based Router Pattern

In one of my latest post I talked about Resequencer Pattern , which can be used with success using Windows Azure Service Bus.  We saw how we can retrieve messages in the same order as they were sending to the Service Bus. But what about Content-Based Router Pattern? The main scope of this pattern is the ability to route each message to different clients based on the data of each message. The system the process each message has to be able to redirect a message to a different consumer (client) based on the data that message contains. One of the key features of this pattern is ability to change and maintained the rules that are used to redirect each message based on the content. Windows Azure gives us the possibility to implement this pattern using Service Bus Topic. Each channel, where messages are redirected can be represented by a subscriber. As you already know each subscriber can have attached a filter that can filter messages based on the content. For this purpose we can use ...

Patterns in Windows Azure Service Bus - Resequencer Pattern

Today we will talk about another message pattern: Resequencer. In the last post I presented Recipient List Pattern . In comparison with this pattern, Resequencer Pattern is very different. The main scope of this pattern is to help us to put messages back in a specific order. When we are talking about messages, we can talk about a stream of messages that need to be received in a specific order. It is very crucial for the receiver to retrieve the messages in the same order he receives. Theoretically, in a simple case we will receive messages in the expected order. This is offer Service Bus by default. But what happen if an error occurs on the receiver and message is putted back in the queue. We will need to retry to consume that message one more time and not the next message. Another case when the order can be broken is when we have more than one producer. For this case we can have two different situations. In the first scenario, each producer will produce messages for different stre...

Patterns in Windows Azure Service Bus - Recipient List Pattern

I will continue the blog series of post about patterns that can be user with Service Bus of Windows Azure with Recipient List Pattern. Did you ever try to send an email to a list of users? Using Exchange Server is quite simple. We can create a group list and send an email to the specific group list. For example we can have groups of email for different products categories. One can be for TVs, another one for Notebooks and so on. If we create a complex system for a company that have different products that want to send we will need to be able to send notifications about new products that are available. To be able to do something like this we will need a system that permits us to send notifications to a “group” – to a list of subscribers. In a system that is based on messages we will not know the list of subscribers for each group. Because of this we can decorate each message with some meta-information about the groups should receive the message. In Windows Azure, we can implement this ...

Patterns in Windows Azure Service Bus - Message Aggregator Pattern

In the last post I talked about Message Filter Pattern that can be used on Windows Azure Service Bus. Today I will describe how we can use Message Aggregator Pattern. From some points of view, this pattern is the opposite pattern in comparison with Message Splitter Pattern . Do you remember when Message Splitter Pattern can be used?… when we want to split messages based on some rules. Message Splitter Pattern does the opposite thing. This pattern can be used when we want to aggregate different messages. This pattern can be used with success in cases when we send some information in more messages. For example if send GPS position of cars based on the type. Until the car will reach the destination it will send a lot of messages. We will need to mark with a custom property the last message that is send by the cars of a given type – or to define a timeout period. When the last message will be received we will be able to process the data – for example to calculate the total distance and t...

Patterns in Windows Azure Service Bus - Message Filter Pattern

In the last post I tacked about Splitter Pattern .Today we will continue with Message Filter Pattern. This pattern can be used with success with Windows Azure Service Bus. As the name says, all the messages are filtered based on specific rules. Any message that will reach the consumer will be filter based on this rules. All the producers will use the same entry point where they will add messages. They don’t have to know that messages are filtered based on same rules. In this way, the message system will create a decoupling between the producer and the consumer. This pattern is used to be able to control the messages that where not routed to any subscriber. Windows Azure Service Bus Topics can be used for this purpose. It gives us the ability to define rules that can check the messages content based on meta-information. These rules will be added to each subscriber and will specify if the messages will be accepted or not. SqlFilter myCustomFilter = new SqlFilter("grade...

Patterns in Windows Azure Service Bus - Message Splitter Pattern

In one of my post about Service Bus Topics from Windows Azure I told you that I will write about a post that describe how we can design an application that can route messages for a house which is controlled remotely. Before we can talk about this we need to see some design patterns that can be used in combination with Service Bus. I will write a series of post about this. We will start with Splitter pattern. This pattern refers to the ability to have a collection of messages parts that form one message or an entity for us. This pattern gives as the ability to receive and process messages from the related messages separately. In this way all the messages that belong to that message part will be sent to the same consumer.   How we can use this pattern in Service Bus? Hmm, is pretty simple. We can use SessionId property of a message for this. In this way, when a client (consumer) start to receive a message with a given session id, we can specify to receive only messages with ...