described herein is a method and apparatus for using rules in a distributed computing system . in one embodiment , a message is generated . one or more rules are associated with the message . associating a rule to the message may include attaching the rule to the message and / or including the rule in a body of the message . the rules may be received from a message generator or from a rules store prior to associating them with the message . each of the one or more rules may pertain to an action to be performed ( e . g ., by a message consumer ). once the rules have been associated with the message , the message is sent to a destination with the associated rules . the destination may be , for example , a message consumer , or an intermediate location that can be accessed by message consumers . in the following description , numerous details are set forth . it will be apparent , however , to one skilled in the art , that the present invention may be practiced without these specific details . in some instances , well - known structures and devices are shown in block diagram form , rather than in detail , in order to avoid obscuring the present invention . some portions of the detailed description which follows are presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory . these algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art . an algorithm is here , and generally , conceived to be a self - consistent sequence of steps leading to a desired result . the steps are those requiring physical manipulations of physical quantities . usually , though not necessarily , these quantities take the form of electrical or magnetic signals capable of being stored , transferred , combined , compared , and otherwise manipulated . it has proven convenient at times , principally for reasons of common usage , to refer to these signals as bits , values , elements , symbols , characters , terms , numbers , or the like . it should be borne in mind , however , that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities . unless specifically stated otherwise as apparent from the following discussion , it is appreciated that throughout the description , discussions utilizing terms such as “ processing ”, “ computing ”, “ calculating ”, “ determining ”, “ displaying ” or the like , refer to the actions and processes of a computer system , or similar electronic computing device , that manipulates and transforms data represented as physical ( e . g ., electronic ) quantities within the computer system &# 39 ; s registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage , transmission or display devices . the present invention also relates to an apparatus for performing the operations herein . this apparatus may be specially constructed for the required purposes , or it may comprise a general purpose computer selectively activated or reconfigured by a computer program stored in the computer . such a computer program may be stored in a computer readable storage medium , such as , but not limited to , any type of disk including floppy disks , optical disks , cd - roms , and magnetic - optical disks , read - only memories ( roms ), random access memories ( rams ), eproms , eeproms , magnetic or optical cards , or any type of media suitable for storing electronic instructions . the algorithms and displays presented herein are not inherently related to any particular computer or other apparatus . various general purpose systems may be used with programs in accordance with the teachings herein , or it may prove convenient to construct a more specialized apparatus to perform the required method steps . the required structure for a variety of these systems will appear from the description below . in addition , the present invention is not described with reference to any particular programming language . it will be appreciated that a variety of programming languages may be used to implement the teachings of the invention as described herein . a machine - readable medium includes any mechanism for storing or transmitting information in a form readable by a machine ( e . g ., a computer ). for example , a machine - readable medium includes a machine readable storage medium ( e . g ., read only memory (“ rom ”), random access memory (“ ram ”), magnetic disk storage media , optical storage media , flash memory devices , etc . ), a machine readable transmission medium ( electrical , optical , acoustical or other form of propagated signals ( e . g ., carrier waves , infrared signals , digital signals , etc . )), etc . fig1 illustrates an exemplary distributed system 100 , in which embodiments of the present invention may operate . in one embodiment , the distributed system 100 includes a service oriented architecture ( soa ). a service oriented architecture ( soa ) is an information system architecture that organizes and uses distributed capabilities ( services ) for one or more applications . soa provides a uniform means to offer , discover , interact with and use capabilities ( services ) distributed over a network . through the soa , applications may be designed that combine loosely coupled and interoperable services . the distributed system 100 may include clients ( e . g ., first client 105 and additional clients 125 ) and services ( e . g ., first service 110 , additional services 130 and core esb services 115 ), connected via a network 135 . each of the clients 105 and 125 and services 110 , 115 , 130 may be both message producers and message consumers , as described below . the network 135 may be a public network ( e . g ., internet ), a private network ( e . g ., ethernet or a local area network ( lan )), or a combination thereof . in one embodiment , the network 135 includes an enterprise service bus ( esb ). an esb is an event - driven and standards - based massaging engine that provides services for more complex architectures . the esb provides an infrastructure that links together services 110 , 115 , 130 and clients 105 and 125 to enable distributed applications and processes . the esb may be implemented to facilitate an soa . in one embodiment , the esb is a single bus that logically interconnects all available services and clients . alternatively , the esb may include multiple busses , each of which may logically interconnect different services and / or clients . clients 105 and 125 may be , for example , personal computers ( pc ), palm - sized computing devices , personal digital assistants ( pda ), etc . clients 105 and 125 may also be applications run on a pc , server , etc . in the soa , clients 105 and 125 include applications that access services 110 and 130 . clients 105 and 125 may be fat clients ( clients that perform local processing and data storage ), thin clients ( clients that perform minimal or no local processing and minimal to no data storage ), and / or hybrid clients ( clients that perform local processing but little to no data storage ). in the illustrated embodiment , the first client 105 is a message producer . alternatively , additional clients 125 , first service 110 , additional services 130 or core esb services 115 may be message producers . a message producer is a client or service that generates a message . messages include data that may cause an action to be performed by ( e . g ., initiate an event on ), or convey information to , a message consumer ( e . g ., a service or client ). a message may be generated for any of a myriad of purposes . for example , the message may be generated to report a purchase of a good , to request contact information , to begin a remote process ( e . g ., initiate a service ), etc . the message may include a message header having a unique message identifier and routing information ( e . g ., recipient , sender , message priority , etc .) to identify the message , and to route the message to end points ( recipients ) intended by the message producer and / or as determined by the esb ( e . g ., by a router within the esb ). the message may be directed to a specific endpoint ( e . g ., a specific client or service ), or the message may be posted to an intermediate location , which one or more endpoints may communicate with to receive the message . the message may also include a message context ( e . g ., custom fields or filters , transactional information , security information , etc .) and a message body . the message body may be formatted using an extensible markup language ( xml ), a standard generalized markup language ( sgml ), or other flexible format . in one embodiment , the message producer ( e . g ., first client 105 ) includes a rules generator 140 , a rules store 150 and a rules placer 155 . rules generator 140 generates rules that can be processed by a rules engine 145 . in one embodiment , the rules are generated in a scripting language ( e . g ., perl , javascript , python , ruby , etc .) or a specific rules language , such as jboss ® rules . alternatively , the rules may be generated in a compiled programming language ( e . g ., c , c ++, visualbasic , etc . ), or programming language that combines interpreters ( as used in a scripting language ) and compilers ( as used in a compiled programming language ). in one embodiment , rules generator generates appropriate rules each time a message is produced . appropriate rules may include rules that apply to a particular service or client that the message will be sent to , rules that apply to the type of message that was produced , rules that a user has indicated should be generated , etc . alternatively , rules generator 140 may generate new rules when needed rules are not present in rules store 150 . a rule is an abstract structure that describes a formal language precisely ( e . g ., a set of rules that mathematically delineates a ( usually infinite ) set of finite - length strings over a ( usually finite ) alphabet ). rules may perform actions , provide information , help process messages , etc . in one embodiment , a rule dictates a transition to be made on a message or message consumer based on a set of criteria . alternatively , a rule may perform other functions . a rule may include conditional elements ( e . g ., and , or , not , exists , etc . ), constraints ( e . g ., equal to , not equal to , greater than , contains , etc .) and consequences or actions ( e . g ., decrypt message , process next rule , etc .). examples of rules relating to messages include security rules ( e . g ., validation , authentication , authorization ) to ensure that a message is not used by untrusted endpoints , rules on how to process messages , rules on where to direct messages , etc . for example , a rule could be attached to an encrypted message and only decrypt the message upon receipt of correct credentials from the recipient . once generated , a rule may be stored in rules store 150 . rules store 150 may be a storage device such as ram , a hard disk drive , optical drive , etc . rules store 150 may include a single storage device , or multiple networked storage devices at the same or different locations . in one embodiment , rules store 150 is located at the message producer ( e . g ., first client 105 ). in another embodiment , rules store 150 may be external to the message producer . an external rules store 150 may be a service of the esb that may be accessed by message producers to retrieve rules . the rules store 150 may include a repository or database of rules in which rules may be managed , organized , searched , etc . rules placer 155 associates rules with messages . to determine which rules to associate with which messages , rules placer 155 may analyze the message , and may examine available rules . in one embodiment , rules placer 155 places all newly generated rules on a message . in another embodiment , rules placer 155 searches for appropriate rules in the rules store 150 to place on the message . rules searched for may include rules that pertain to the type of message , rules that pertain to a client or service to which the message will be sent , rules that a user has indicated should be attached to outgoing messages , etc . in yet another embodiment , a local table is searched that indicates a list of rules to attach to each distinct outgoing message . in one embodiment , associating a rule with a message includes attaching the rule to the message . alternatively , associating the rule with the message may include placing the rule in the body of the message . multiple rules may be associated with a message . such rules may be interdependent or “ strongly coupled ” ( e . g ., second rule only applies if certain conditions are met using first rule ), or they may be independent or “ loosely coupled ” ( e . g ., the outcome of a first rule does not influence an outcome of a second rule , and vice versa ). services 110 and 130 may be discretely defined sets of contiguous and autonomous functionality ( e . g ., business functionality , technical functionality , etc .). services 110 and 130 may be resident on personal computers ( pc ), servers , routers , etc . each service 110 and 130 may represent a process , activity or other resource that can be accessed and used by other services or clients on network 135 . each service 110 and 130 may be independent of other services 110 and 130 , and may be accessed without knowledge of its underlying platform implementation . in an example for a business function of “ managing orders ,” services may include , for example , create order , fulfill order , ship order , invoice order , cancel / update order , etc . each such service may be autonomous from the other services that are used to manage orders , and may be remote from one another and have different platform implementations . however , the services may be combined and used by one or more applications to manage orders . in the illustrated embodiment , the first service 110 is a message consumer . alternatively , first client 105 , additional clients 125 , core esb services 115 or additional services 130 may be message consumers . a message consumer receives a message generated by a message producer . based on the content of the message , the message consumer may store information contained in the message , generate a response message to send to a service or client , undergo a state change , and / or initiate some other event . a state change initiated by a message may be dependent on contents of the message ( e . g ., the message body , message context , etc . ), rules governing responses to the message , etc . in one embodiment , the message consumer ( e . g ., first service 110 ) includes a rules engine 145 . the rules engine 145 is a logic component that processes rules to produce outcomes . the rules engine 145 may match facts , data and rules , and infer conclusions which may result in actions or events of , for example , a message consumer . in one embodiment , the rules engine 145 matches the facts , data and rules using a rete algorithm , as is known to one of ordinary skill in the art . alternatively , the rules engine may use a linear algorithm , treat algorithm , leaps algorithm , etc . hybrid algorithms that use combinations of , for example , the leaps algorithm and the rete algorithm , may also be used . in one embodiment , the distributed system 100 includes an esb that has a collection of core esb services 115 . the core esb services 115 act on messages that flow through the esb . messages can also be directed towards any of the core esb services 115 in the same manner as described above with reference to the first service 110 and additional services 130 . any of the core esb services 115 may include one or more general purpose computing devices ( e . g ., personal computer or server ) and / or a special purpose computing devices configured to act on messages that flow between message producers ( e . g ., clients or services ) and message consumers ( e . g ., clients or services ) within the esb . in one embodiment , the core esb services 115 include a content based router 160 . the content based router 160 is a service of the esb that monitors the network 135 for messages , and routes the messages between clients and services . the content based router 160 may be transparent to both message producers and message consumers . in one embodiment , the content based router 160 includes a rules generator 140 , a rules store 150 , a rules engine 145 and a rules processor 155 . the content based router 160 may route all messages that flow through the esb , or a subset of all messages . in one embodiment , the content based router 160 routes messages according to routing information included in message headers or other parts of the message . in a further embodiment , rules engine 145 determines a destination channel ( route to a client or service ) based on rules associated with received messages . rules generator 140 may generate new rules for the message to be routed by content based router 160 . rules placer 155 may then associate the new rules to the message . rules placer 155 may also associate rules from the rules store 150 with the message . a determination of which rules to associate with the message may be made by rules engine 145 . the core esb services 115 may include one or more modules 150 , each of which may be a service of the esb . examples of modules 150 include modules that provide services for redirecting a message from an original intended endpoint , splitting a message into multiple messages , combining multiple messages into a single message , transforming messages from a first format to a second format , applying rules to a message , etc . each module 150 may provide a service to clients 105 and 125 and / or services 110 and 130 of the distributed computing system 100 . fig2 a illustrates a flow diagram of one embodiment for a method 200 of associating rules with messages . the method may be performed by processing logic that may comprise hardware ( e . g ., circuitry , dedicated logic , programmable logic , microcode , etc . ), software ( such as instructions run on a processing device ), or a combination thereof . in one embodiment , method 200 is performed by a service or client of distributed computing system 100 of fig1 . referring to fig2 a , method 200 begins with processing logic generating a message ( block 205 ). the generated message may include a public part that is readable to anyone , and a private part that may be viewed if certain security rules are satisfied . at block 210 , one or more rules are generated . each of the rules may cause an action to be performed by a message consumer . the rules may include security rules that secure a private part of the generated message . at block 215 , the generated rules are associated to the message . associating the rule to the message may include attaching the rule to the message , or inserting the rule into a body of the message . once rules are associated with the message , a header or body of the message may be modified to indicate that the message is associated with rules . for example , information may be added to the header or body of the message that indicates where in the message the rules are located . at block 220 , the rule is then sent to a destination . fig2 b illustrates a flow diagram of another embodiment for a method 250 of associating rules with messages . the method may be performed by processing logic that may comprise hardware ( e . g ., circuitry , dedicated logic , programmable logic , microcode , etc . ), software ( such as instructions run on a processing device ), or a combination thereof . in one embodiment , method 250 is performed by a service or client of distributed computing system 100 of fig1 . referring to fig2 b , method 250 begins with processing logic generating a message ( block 255 ). at block 260 , processing logic determines what rules pertain to the message . in one embodiment , a local table identifies rules that pertain to the message . alternatively , each rule may include information identifying what rules it should be associated with . in such an embodiment , it is not determined what rules pertain to the message until a search for rules ( block 265 ) has occurred . at block 265 , the rules that pertain to the message are searched for . in one embodiment , the local table indicates a location on a rules store from which to retrieve the rules . alternatively , the rules store may be searched for the identified rules . at block 270 , the identified rules are retrieved from the rules store . at block 275 , the identified rules are associated with the message . once rules are associated with the message , a header or body of the message may be modified to indicate that the message is associated with rules . for example , information may be added to the header or body of the message that indicates where in the message the rules are located . at block 280 , the rule is then sent to a destination . fig3 illustrates a flow diagram of one embodiment for a method 300 of processing a rule associated with a message . the method may be performed by processing logic that may comprise hardware ( e . g ., circuitry , dedicated logic , programmable logic , microcode , etc . ), software ( such as instructions run on a processing device ), or a combination thereof . in one embodiment , method 300 is performed by a service of distributed computing system 100 of fig1 . alternatively , method 300 may be performed by a content based router or by a message consumer . referring to fig3 , method 300 begins with processing logic receiving a message that includes an associated rule or rules ( block 305 ). the associated rules may be rules attached to the message , or rules included in a body of the message . at block 310 , the associated rules are processed . the associated rules may be processed by a rules engine . at block 315 , one or more actions are performed based on the processed rule or rules . examples of actions include executing a service , decrypting a private part of the message , storing the message , etc . if the message is received by a core esb service ( e . g ., content based router ), then the actions may also include , for example , transforming the message from a first format to a second format , copying the message , routing the message or associating additional rules to the message . fig4 illustrates a diagrammatic representation of a machine in the exemplary form of a computer system 400 within which a set of instructions , for causing the machine to perform any one or more of the methodologies discussed herein , may be executed . in alternative embodiments , the machine may be connected ( e . g ., networked ) to other machines in a lan , an intranet , an extranet , or the internet . the machine may operate in the capacity of a server or a client machine in client - server network environment , or as a peer machine in a peer - to - peer ( or distributed ) network environment . the machine may be a personal computer ( pc ), a tablet pc , a set - top box ( stb ), a personal digital assistant ( pda ), a cellular telephone , a web appliance , a server , a network router , switch or bridge , or any machine capable of executing a set of instructions ( sequential or otherwise ) that specify actions to be taken by that machine . further , while only a single machine is illustrated , the term “ machine ” shall also be taken to include any collection of machines that individually or jointly execute a set ( or multiple sets ) of instructions to perform any one or more of the methodologies discussed herein . the exemplary computer system 400 includes a processing device ( processor ) 402 , a main memory 404 ( e . g ., read - only memory ( rom ), flash memory , dynamic random access memory ( dram ) such as synchronous dram ( sdram ) or rambus dram ( rdram ), etc . ), a static memory 406 ( e . g ., flash memory , static random access memory ( sram ), etc . ), and a data storage device 418 , which communicate with each other via a bus 430 . processor 402 represents one or more general - purpose processing devices such as a microprocessor , central processing unit , or the like . more particularly , the processor 402 may be a complex instruction set computing ( cisc ) microprocessor , reduced instruction set computing ( risc ) microprocessor , very long instruction word ( vliw ) microprocessor , or a processor implementing other instruction sets or processors implementing a combination of instruction sets . the processor 402 may also be one or more special - purpose processing devices such as an application specific integrated circuit ( asic ), a field programmable gate array ( fpga ), a digital signal processor ( dsp ), network processor , or the like . the processor 402 is configured to execute the processing logic 426 for performing the operations and steps discussed herein . the computer system 400 may further include a network interface device 408 . the computer system 400 also may include a video display unit 410 ( e . g ., a liquid crystal display ( lcd ) or a cathode ray tube ( crt )), an alphanumeric input device 412 ( e . g ., a keyboard ), a cursor control device 414 ( e . g ., a mouse ), and a signal generation device 416 ( e . g ., a speaker ). the data storage device 418 may include a machine - accessible storage medium 431 on which is stored one or more sets of instructions ( e . g ., software 422 ) embodying any one or more of the methodologies or functions described herein . the software 422 may also reside , completely or at least partially , within the main memory 404 and / or within the processor 402 during execution thereof by the computer system 400 , the main memory 404 and the processor 402 also constituting machine - accessible storage media . the software 422 may further be transmitted or received over a network 420 via the network interface device 408 . the machine - accessible storage medium 431 may also be used to store data structure sets that define user identifying states and user preferences that define user profiles . data structure sets and user profiles may also be stored in other sections of computer system 400 , such as static memory 406 . while the machine - accessible storage medium 431 is shown in an exemplary embodiment to be a single medium , the term “ machine - accessible storage medium ” should be taken to include a single medium or multiple media ( e . g ., a centralized or distributed database , and / or associated caches and servers ) that store the one or more sets of instructions . the term “ machine - accessible storage medium ” shall also be taken to include any medium that is capable of storing , encoding or carrying a set of instructions for execution by the machine and that cause the machine to perform any one or more of the methodologies of the present invention . the term “ machine - accessible storage medium ” shall accordingly be taken to include , but not be limited to , solid - state memories , optical and magnetic media , and carrier wave signals . it is to be understood that the above description is intended to be illustrative , and not restrictive . many other embodiments will be apparent to those of skill in the art upon reading and understanding the above description . the scope of the invention should , therefore , be determined with reference to the appended claims , along with the full scope of equivalents to which such claims are entitled .