Abstract:
A number of approaches can be taken to improve the routing of client requests to business protocol destinations. In one such approach, a business servlet registers itself as a default servlet such that it receives any request not recognized by the system. In another embodiment, internal APIs can be used to route all messages to a business servlet, which can use internal APIs to redirect the request if the business servlet does not recognize the request. In another embodiment, filters can be used in conjunction with a lookup table containing address information to route requests to the proper destination.  
     This description is not intended to be a complete description of, or limit the scope of, the invention. Other features, aspects, and objects of the invention can be obtained from a review of the specification, the figures, and the claims.

Description:
CLAIM OF PRIORITY  
       [0001]    This application claims priority to U.S. Provisional Patent Application No. 60/376,932, filed May 1, 2002, entitled “SINGLE SERVLETS FOR B2B MESSAGE ROUTING,” which is hereby incorporated herein by reference. 
     
    
     
       COPYRIGHT NOTICE  
         [0002]    A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document of the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.  
         CROSS-REFERENCED CASES  
         [0003]    The following applications are cross-referenced and incorporated herein by reference:  
           [0004]    U.S. patent application No. ______ filed ______, to Mike Blevins et al. and entitled, “COLLABORATIVE BUSINESS PLUG-IN FRAMEWORK”;  
           [0005]    (B) U.S. patent application No. ______ filed ______, to Mike Blevins et al. and entitled, “SYSTEMS AND METHODS FOR BUSINESS PROCESS PLUG-IN DEVELOPMENT”; and  
           [0006]    (C) U.S. patent application No. ______ entitled “LARGE MESSAGE STORE” by David Wiser et al., filed ______.  
         FIELD OF THE INVENTION  
         [0007]    The present invention relates to the routing of messages and events in a business-to-business messaging system.  
         BACKGROUND  
         [0008]    Without clustering support, a Business-to-Business (B2B) component can have very limited failover and availability. The scalability of a B2B component can be further limited by the processing power of a single computer. Enterprises using an application integration system can require high availability as well as the ability to scale to large numbers of trading partners and messages.  
           [0009]    B2B components presently use an endpoint or URL to identify each business partner, as well as to identify the business protocol being used. These differing URLs result in a servlet being dynamically registered for each URL when the trading partners are loaded. Deactivating a trading partner results in the servlet being destroyed. The registration and deactivation is accomplished by an internal call, which is not available in all B2B components. If there is no internal call available, the servlet cannot be removed. The result is a memory leak. Dynamic deployment of the servlets also has an impact on the way in which B2B is started when the system server starts. Finally, managing updates to these servlets across a cluster would be problematic.  
         BRIEF SUMMARY  
         [0010]    Systems and methods in accordance with embodiments of the present invention can provide for improved request routing, such as to a business protocol specified in a client request. In one embodiment, servlets are used to process requests and generate responses. A default servlet is used to receive requests not handled by the servlets and to generate an error message. A business servlet can be used to process a request by routing the request to a destination for a specified business protocol, such as to a servlet or piece of code intended to handle that protocol. The business servlet can route the request to the default servlet if the business servlet does not recognize the destination of the request. The server receiving the request from the client is adapted to route the request to one of the servlets or default servlet, depending on whether the server recognizes the destination, or URL, of the request. The business servlet can be registered as the default such that it receives requests that the server does not recognize. If the business servlet does not recognize the destination of the request, the business servlet can redirect or forward the request to the default servlet.  
           [0011]    In another embodiment, a server receiving a request can forward a request received from a client to a business servlet. If the business servlet recognizes the request, the business servlet can forward the request to the appropriate protocol destination. If the business servlet does not recognize the request, the business servlet can use a mechanism such as an internal API to determine the appropriate servlet to receive the response and can forward the request to that servlet. If the business servlet cannot determine the appropriate servlet, the business servlet forwards the request to the default servlet.  
           [0012]    In another embodiment, the server receiving the request has a filter capable of determining whether an associated servlet should receive the request. There can be a filter for the business servlet and every other servlet except for the default servlet. The filters can use a lookup table containing address information for help in determining the destination of the request. The filters can act as a chain, with the default servlet at the end of the chain. Each filter can either forward the request to the associated servlet if the filter recognizes the request, or can forward to the next filter in the chain. This process can continue until one of the filters recognizes the request or the default filter receives the request.  
           [0013]    Another embodiment occurs in a clustered environment. An administration server for a cluster can receive a request from a client and can use a load-balancing algorithm to select a cluster server to receive the request. A filter on the selected cluster server can determine the appropriate destination for the request using a lookup table and can forward the request appropriately. This can continue until the request is processed or is received by a default servlet.  
           [0014]    Other features, aspects, and objects of the invention can be obtained from a review of the specification, the figures, and the claims. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0015]    [0015]FIG. 1 is a diagram of a system that can be used in accordance with one embodiment of the present invention.  
         [0016]    [0016]FIG. 2 is a diagram of a system that can be used in accordance with a second embodiment of the present invention.  
         [0017]    [0017]FIG. 3 is a diagram of a system that can be used in accordance with another embodiment of the present invention.  
         [0018]    [0018]FIG. 4 is a diagram of a clustered system that can be used with the embodiment of FIG. 3. 
     
    
     DETAILED DESCRIPTION  
       [0019]    Systems and methods in accordance with embodiments of the present invention can utilize a clusterable B2B component that can enable users to build B2B solutions with greatly improved levels of availability and scalability. A single servlet can be utilized for B2B in order to direct messages to different trading partners or business protocols. This can solve problems with servlet destruction, the B2B startup class, and servlet management in a cluster. The single servlet can use different file paths, with each file path being the part of a URL following the scheme, host, and port, for example. This can be managed across a cluster by local mapping tables, which can be updated via Managed JavaBeans (MBeans).  
         [0020]    If the base of the file path is frozen per integration system deployment, a single servlet can process the different sub-paths quite easily. This could be the case for URLs such as, for example:  
         [0021]    http://www.myserver.com:7001/basepath/subpath1  
         [0022]    http://www.myserver.com:7001/basepath/subpath2/maybemore However, given the freedom for choosing URLs that can be allowed, it may be preferable to not require the freezing of paths, at least in some embodiments.  
         [0023]    This flexibility can be recovered in one embodiment if the B2B servlet is made to be the “default” servlet of the system cluster. Any servlet request not found for processing by other servlets can be sent to the default servlet. The B2B servlet, as the default servlet, can lookup the specified file path in an appropriate mapping table or ‘hash’ table.  
         [0024]    If the mapping exists, the servlet can activate the specified business protocol to process the message. If the mapping does not exist, the servlet can pass the request on to the normal default servlet, such as a FileServlet that can report “file not found” errors. One way to accomplish this is to subclass the default servlet to add the B2B functionality. Another way to accomplish this is through the use of a forward( ) method. A forward( ) method can be used to transfer control from a B2B servlet to a named servlet. The method can transfer to the previously installed default servlet, presuming that the name of the default servlet is available through an MBean API.  
         [0025]    Another way is to take advantage of the new “filter” capability introduced with version 2.3 of the Java Servlet specification set forth by Sun Microsystems, Inc., of Santa Clara, Calif. A Java class can be provided that can intercept a servlet request and dynamically provide additional restrictions or information. This can be a preferred approach in certain embodiments.  
         [0026]    In present messaging systems, a different URL is used to specify each location to which a message can be routed. Such locations can include functionality to process the messages using business protocols such as RosettaNet, ebXML, or XOCP. One problem with this approach is that a new servlet has to be created and deployed each time a new location or protocol is added to the system. Deploying additional servlets in a clustered environment can become problematic, as it is necessary to inform each node in the cluster to install this servlet everywhere so the system can handle the new protocol. It is then necessary to send out these messages, as well as to ensure that the servlets are properly loaded and deployed. Further, the issue of loading a servlet is not a straightforward task. When the need for a protocol ends, it can be desirable for the protocol to disappear. It is then necessary to undeploy each servlet and do away with each servlet URL.  
         [0027]    It is therefore desirable to use a mechanism in accordance with one embodiment that provides for a single servlet to be deployed initially as the B2B environment is brought up. This mechanism can set up a “promiscuous” listener that will listen to everything coming into any servlet in the cluster. The listener can check where each message is bound, and if the listener does not recognize the destination, the listener can allow the message to pass to a default destination.  
         [0028]    In a system in accordance with one embodiment of the present invention, each protocol can be pre-registered such that it appears as a URL. Once a protocol appears to the system as a URL, a filter or interceptor can pass the protocol to a hidden servlet that deals with such URLs. A filter is generally a piece of code that can transform the contents or requests and responses. Filters do not create responses as do servlets, but instead modify or adapt requests and responses. The servlet can stash the real address and forward it to the underlying address. A table can be used to hold the real and underlying addresses, such that subsequent messages can be routed more quickly. The table itself can be dynamically updated. There is then no need to install or uninstall additional servlets. When the addresses are removed from the table, the system will direct requests to the default servlet, which can return a normal “404” error of “file not found.” 
         [0029]    There are at least three approaches that can be used in accordance with embodiments of the present invention. In one approach, which can be used with the system of FIG. 1, a Web server  102  routes a request from a client  100  to a default servlet  108  if the Web server  102  does not otherwise know where the request is to be routed. There can typically be only one default servlet  108 , such that if an application were to require that an application-specific servlet be the default servlet there would be a conflict with any other product or user that needed a default servlet. Instead, it is possible to add processing that takes advantage of the default servlet for a system. An object or method, for example, could be implemented that would know to pass to the file server anything that object or method does not understand. These requests could then be received by a B2B servlet  110 , for example, as shown in FIG. 1( b ). If no other destination accepts a request, the request can be routed to the B2B servlet  110 , which has been inserted between the Web server  102  and the default servlet  108 .  
         [0030]    There can be various servlets installed at the front of the Web server  102 . A client  100  can send a request to a URL that is received by the Web server  102 . Based on the URL specified in the request, the Web server  102  knows which piece of code to activate in order to serve the request. There can be a default servlet  108  to which any request is directed if the URL is not recognized. Therefore, the Web server  102  can first try to send a request to one of the servlets  104 ,  106  hosted by the Web server  102 , and if that send fails the Web server  102  can send the request to the default servlet  108 . The default servlet then can be responsible for sending an error message such as “URL not Found”, or the HTML for a Web page that will provide a similar error message. A B2B servlet  110  can be registered as the “default” servlet, which could then pass the request to the “real” default servlet  108  if the B2B servlet  110  does not understand the URL. Again, this is a problem if a user can specify the default servlet, as the B2B servlet may not know where to direct requests that it does not recognize.  
         [0031]    A second approach, which can be used with the system of FIG. 2, passes a request from a client  200  on to another servlet, such as a B2B servlet  206 , using a built-in forwarding API  204  of the Web server  202  receiving the request. This is different from the first approach, in that the B2B servlet  206  can be one of the first locations to look at the request, and if the B2B servlet  206  does not understand the request, the B2B servlet  206  can then look up the appropriate servlet through internal APIs and use a forwarding mechanism to pass the request to the appropriate servlet, such as servlet  208  and servlet  210 . A request can either be forwarded or redirected, both of which can be done with servlets. A redirect tells a request to go to another address, which can be problematic in an environment that includes firewalls and security protocols, as it may not be possible to directly talk to some of those addresses. A forward has a downside as well, as it can lose the original address such that it cannot be determined where the request has been.  
         [0032]    A client can submit a request to the Web server that can utilize prefixes. For example, a base request might specify:  
         [0033]    http://www.someURL.com:7001/ which specifies port  7001  on the IP address represented by the domain name “someURL.com.” The user can also specify a prefix, such as B2B, which could be used to make requests such as:  
         [0034]    http://www.someURL.com:7001/B2B/ebXML/  
         [0035]    http://www.someURL.com:7001/B2B/RosettaNet/  
         [0036]    http://www.someURL.com:7001/B2B/XOCP/ For each of these URLs, even though the URL specifies a different destination, each URL can be intercepted due to the user of the “B2B” prefix. Some underlying API calls can be done to determine whether the destination is known. If the destination is known, the request can be forwarded appropriately, such as to one of the B2B-registered protocols  214 ,  216 ,  218 . One of the problems with such an approach is that everything may need to be prefixed, which can cause problems supporting existing systems that do not use prefixes.  
         [0037]    A third approach can be used with the system of FIG. 3. Such an approach utilizes a forward method, but forwards the requests such that the system knows to which address the request is being forwarded, as well as the original address for the request. This could use a hash table  314 , for example, which can store the original address and the underlying address. The request from the client  300  can be forwarded to the underlying address, and the original address can be retrieved by the system as needed. There can be a number of servlets  308 ,  312 , and a B2B servlet  304  can be added to the Web server. Filters  302 ,  306 ,  310  can be defined on an individual servlet level, and can be targeted for a number of servlets or all the servlets.  
         [0038]    When a request is received to one of the filters  302 ,  306 ,  310 , the filter can determine whether it recognizes the URL in the request. If the URL is recognized by filter  302 , for example, the request can be forwarded to the B2B servlet  304 , which can be registered under an internal name that users will not see directly. If the request is not recognized, it can be forwarded to the filter  306  for the next servlet  308 . A request can keep passing through filters  302 ,  306 ,  310  until it is either recognized or is forwarded to the default servlet  314 . The filters can assume that there is going to be a chain of filters as well as the default servlet, such that if a filter does not recognize a URL it simply forwards the request to the next in the chain. If the URL is recognized, it can be forwarded to the servlet directly, using the internal name. It can still be necessary to retain the original URL, such that the URL is retrievable and the switch business protocol requested can be done.  
         [0039]    The servlet infrastructure can know how to do chaining between the filters and the final destination of a particular servlet. To reach a specific servlet, such as the B2B servlet, a “virtual URL” can be specified in the request. This URL is called virtual because it does not correspond to an actual URL. If such URL is detected by a filter, the request can be bounced back by the server with a message indicating that the URL does not exist. Again, if the user replaces the default servlet with a user-specific servlet, it does not matter because the default servlet will still be in the chain. The transport servlet is independent of the default servlet in this embodiment.  
         [0040]    The filter can use what effectively amounts to a lookup table, in which the filter can lookup any URL it receives to determine whether the filter recognizes that URL as belonging to the associated servlet. This is a quick lookup, as the table is a hash table and a query on the table involves a text string. If the URL is recognized, it is processed. If the URL is not recognized, the request is passed on to the next filter or the default servlet, whichever is next in the chain. If the URL is recognized, the filter can get the appropriate instance of various things to call and process the request to the servlet. The servlet has to receive not the current incoming destination but the original incoming destination. It can be necessary for the servlet to receive the original incoming destination because the URL was rewritten, and it specifies a transport servlet, for example, and a server receiving the request will not have a protocol for a transport servlet. Since the original URL is in a special header in the transport package, the server can simply extract the original URL and process the request as normal. Using this approach, protocols can be added and removed “on the fly” since the hash table can be populated and depopulated dynamically. Present systems require installing and uninstalling servlets on the fly, which can be problematic and unnecessarily resource intensive.  
         [0041]    Once the request gets to the B2B servlet, the request can appear as a normal request to the servlet and the servlet can simply process the request. Once the transport servlet receives and decodes the URL, the URL can look like it always did, even internally to the system. After the processing is completed, a response will go back to the requester, or client, as a standard response. This approach can be desirable, as it is transparent on both sides. No filtering is done on the response, the only filtering done when incoming messages are intercepted.  
         [0042]    The system can take advantage of objects such as HTTP servlet request objects and HTTP servlet response objects. A servlet request object can contain all the incoming information, and a servlet response object can be filled with the outgoing information. Servlets normally take both a request argument and a response argument. A filter can be set up the same way, so that as long as the underlying code reads from the request and sends information back in the response. The filter can ‘transparently’ bypass the filter. The response can be captured in the filter in some embodiments. This can be done to change or add outgoing information, for example, such as to add a copyright statement to the bottom of each response page. In some embodiments, only the destination is being changed, such that the system is being used purely for routing.  
         [0043]    When a filter receives a request, it can be compared to the destination URL. Here, ‘destination’ is not the destination to which the request is being sent, but is the destination on which the request is received. The system is looking at the incoming URL. The filter can examine the path of the incoming URL, and can determine whether the associated business protocol is registered under that path. If the filter has a servlet for a protocol registered under that path, the filter can route the request to that servlet. Otherwise, the request passes to the next filter or servlet in the chain.  
         [0044]    If the URL is recognized, the request can go to a transport servlet. In order to give the request to the transport servlet, the URL can be changed to the transport servlet. At this point the path can be stripped, such as to remove the protocol identification information. The system can utilize “transport” headers that can contain the information being sent, as well as any additional information. This additional information can include the original URL. The transport servlet can then check the transport header to determine whether to use the URL that the request came in on or the one identified in the header.  
         [0045]    Advantages of such a system can be realized in a clustered environment, as shown in FIG. 4. There can be a front end to a cluster  400 , as well as various nodes in the cluster. If there is an administration (admin) server  404  in the cluster  400 , and a user wishes to add a protocol, the user may have to install a servlet on each of the machines or nodes in the cluster. If the protocols are to be distributed across the nodes of the cluster, a load-balancing algorithm can be used to determine the node to receive the servlet. The servlet then needs to be installed before use, and uninstalled after use.  
         [0046]    In a system in accordance with an embodiment of the present invention, it still may be necessary to inform the individual nodes that the protocol has been added. In such a system, however, it is sufficient to inform the nodes  404 ,  408 ,  412 ,  418  that something has been added to the hash table  420  to which they should pay attention. When the protocol is to be removed, the appropriate information can simply be removed from the hash table  420 . It is not necessary to go through the process of destroying the servlet. The request can come into the cluster  402  from a client  400  and get routed to one of the nodes  408 , such as by doing load balancing using the admin server  404 . A filter can be deployed on each node in the cluster. The admin server  404  can act as a cluster router to distribute the load. A distribution algorithm such as round robin can be used, which can be implemented either through hardware or software.  
         [0047]    The protocols are then not added to the nodes themselves, but are instead distributed in a lighter form. It can be sufficient to inform the nodes that a new protocol exists in the cluster, and it is not necessary to add or install servlets, or change any existing servlets. Similarly, none of the filters needs to be changed. The only thing that may need to be changed is the value in the hash table  420  or lookup table. The server  400  receiving the request from the admin server  404  can examine the request with a filter  406  using the hash table  420 . If the filter  406  recognizes the URL, the filter can route the request to a B2B servlet  420  or other servlet  422  hosting that protocol. If the filter  406  does not recognize the URL, the request can be routed to the default servlet  424 .  
         [0048]    The foregoing description of preferred embodiments of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many modifications and variations will be apparent to one of ordinary skill in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical application, thereby enabling others skilled in the art to understand the invention for various embodiments and with various modifications that are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalence.