Skip to main content

Posts

Showing posts from September, 2012

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 stream …

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…

ListView - make selected item visible don't work in all cases

Did you ever try to use the ListView for Windows 8 Applications? If you had a more complicated scenario where you need to ensure that the selected item from your code is visible maybe you had the following problem… How can I make the selected item visible? If I have a lot of items in my scroll list than the selected item will not be visible when we select it. listView.set(i).done(); In this way we select the ‘i’ element of the list. Also the set() method unselect the rest of the items that were selected already. To be able to show it in the visible part of the list we need to call the ensureVisible() method after we set it. listView.set(i).done(); listView.ensureVisible(i); But in more complicated cased you will notify that this will not work. Even if the ensureVisible() method is called nothing will happen. Usually this case appears when the method is called in a “callback” or in a complete, error or progress of a promise. Even if you try o the ensureVisible in a msSetImmediate it …

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 th…

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.

Service Bus Topics - Define custom rules for messages that don’t respect any rule defined in a topic

In one of my older post I tacked about how we can define filters for each subscriber of a Service Bus Topics. We saw how we can filter messages for a subscriber based on some rules that are defined using FilterExpression:
RuleDescription ruleDescription = new RuleDescription() { Action = new SqlRuleAction("set isValid= false"), Filter = new SqlFilter("value = 10"); } namespaceManager.CreateSubscription( "myFooTopic", "seccondSubscription", ruleDescription); var subscription = namespaceManager.CreateSubscription( "myFooTopic", " thirdSubscription"); subscription.Add(ruleDescription);
Using these rules is quite simple to define custom rules for the messages from a topic. But what about messages that don’t respect any rules defined in our topic? How we can detect these messages and define a custom rule for them. In a perfect word we can control the messages that arrive in our topic, but in…

updateLayout method of WinJS.Page – what we should be aware of

If you already created a Windows 8 Application in HTML 5 and JavaScript maybe you already used a page control. Every page control has a Java Script file behind this, like in ASPX and WinForms. In this blog post I want to talk about some methods that we can define in this page control – especially one.
If we create a page control from Visual Studio (Add New) you will observe that 3 defaults method are automatically added:
readyunloadloadinitprocessedrendererrorupdateLayout The “ready” method is called after all the controllers were loaded to the page and the DOM element was created. In this moment the element was already rendered to the screen. The “unload” method is used when we have some resources that we want to free (for example some binding).
“updateLayout” method is called when the page layout is change. A case when this method is called by the system is when the layout is changed from landscape to portrait. What we should know about this method is what happens before and after th…

Service Bus Topics blog post series – a comprehensive look at Service Bus Queues from Windows Azure

Windows 8 Dev Camp, Cluj-Napoca - September 29

A great Windows 8 Dev Camp will be organized in September 29 by Codecamp and ITSpark. This event is 100% free. We will have 6 great sessions. See you there! http://codecamp-cluj-sept2012.eventbrite.com/ ----------------------------------------------------------------------------------------------