Search
Lori MacVittie - Two Different Socks
You are here: DevCentral > Weblogs

posted on Thursday, March 29, 2007 3:16 PM

The Router Pattern is perhaps the simplistic of all SOA Patterns, with the exception of the Proxy Pattern. The Router Pattern is also the pattern that is most likely to be implemented in a network lke an application delivery controller (ADC). That shouldn't be surprising, given that one of the purposes of an ADC like BIG-IP is to route messages to a specific node/server based on a wide variety of variables.

The Router pattern essentially involves routing requests to specific business services based on defined criteria. It's conditional routing, and it usually requires the extraction of some piece of data from the message upon which routing can be based.

There are just three steps in the pattern:

1. Client sends request to the device acting as the router

2. The router extracts the appropriate input

3. The router directs the response to the appropriate service based on the value of the input extracted in step #2.

The iRule to implement the Router pattern is simple, requiring only that the appropriate data be extracted from the message before determining to which pool the request should be routed.

# iRule Router Pattern Rule
when HTTP_REQUEST {
   HTTP::collect [HTTP::header "Content-Length"]
}
when HTTP_REQUEST_DATA {
 # search for "searchstring" in the message. Replace skip-count and terminator
 # with the values appropriate for your data 


switch [findstr [HTTP::payload] "searchstring" skip-count "terminator"] {
    "value1" {
        pool service1_pool
    }
    "value2" {
        pool service2_pool
     }
     "value3" {
        pool service3_pool
     }
  }
  HTTP::release
}

This pattern has long been used to route requests based on URI, the earliest form of content-based routing implemented (well before the Enterprise Service Bus entered the picture), and has been implemented in application delivery controllers for many years. It should be no surprise that for those ADCs that are application fluent, like BIG-IP, that the implementation of this particular SOA pattern is a snap. What might also be fairly obvious at this point is that the Federated ESB Pattern is based on the Router pattern, and that the BIG-IP and iRules can handle the implementation of that pattern with equal alacrity.

Stay tuned as we dig into other (and definitely more complex) SOA Patterns like Facade, Command Facade, Asynchronous Query, Data Logger, and Input/Output Validator.

Imbibing: Mountain Dew

Technorati tags: , , , ,


Feedback

7/15/2009 3:56 AM
Gravatar Business-Layer Load Balancing
Lori MacVittie

Let Me Know What You Think


Please use the form below if you have any comments, questions, or suggestions.

Title:
 
Name:
 
Email: (so we can show your gravatar)
Website:
Comment: Allowed tags: blockquote, a, strong, em, p, u, strike, super, sub, code
 
Please add 6 and 4 and type the answer here:

Blog Stats

Posts:979
Comments:1685
Stories:0
Trackbacks:583
  

Image Galleries

  

Application Delivery

  

Cloud Computing

  

Random

  

Security

  

Chat Catcher

82,243 Members in 102 Countries and Growing!

Join DevCentral Today!

About DevCentral

DevCentral has been a successful, thriving community for many years. We have always strived to bring you the best technical documentation, discussion forums, blogs, media and much more that we can.

So dive in, get familiar with DevCentral. We hope you like it, we hope it makes your job easier, and lets you get that much more power out of the community. To learn more, make sure to check out the Getting Started section. And if you have any problems, or think something could be easier to use, drop us a line to let us know.

Got It !

We've received your comment and transmitted it directly to DevCentral HQ.

Thanks for taking time to let us know what's on your mind. At DevCentral | Community Matters!

Get In Touch With Us

Have questions, suggestions or just want to get something off your chest?

Use our handy form below to Direct Connect with DevCentral Mission Control.

Send Us Feedback       or