Embodiments of the invention generally relate to the field of Message-Oriented Middleware (MOM) and more particularly, to a MOM provider having multiple MOM server instances.
Traditional client-server systems employ a two-tiered architecture such as that illustrated in
As is known in the art, the “business logic” component of the application represents the core of the application, for example, the rules governing the underlying business process (or other functionality) provided by the application. The “presentation logic” describes the specific manner in which the results of the business logic are formatted for display on the user interface. The “database” 104 includes data access logic used by the business logic to store and retrieve data.
The limitations of the two-tiered architecture illustrated in
In response to limitations associated with the two-tiered client-server architecture, a multi-tiered architecture has been developed, as illustrated in
This separation of logic components and the user interface provides a more flexible and scalable architecture compared to that provided by the two-tier model. For example, the separation ensures that all clients 225 share a single implementation of business logic 222. If business rules change, changing the current implementation of business logic 222 to a new version may not require updating any client-side program code. In addition, presentation logic 221 may be provided which generates code for a variety of different user interfaces 220, which may be standard browsers such as Internet Explorer® or Netscape Navigator®.
Although the multi-tiered system illustrated in
Message-Oriented Middleware (MOM) refers to computer software that provides a message service between software components or applications. The message service provided by MOM is often referred to as “loosely coupled” because a component sends a message to a destination and the recipient can retrieve the message from the destination. A message service typically includes a message provider and one or more clients. The message provider facilitates, for example, creating, sending, receiving, and reading messages. A client uses the message provider to, for example, send a message to a destination and another client may use the message provider to retrieve the message from the destination.
Although the message service facilitates communication between distributed software components and applications, it also reduces some of the flexibility of the multi-tiered architecture. For example, the scalability of the multi-tiered architecture may be constrained by the capacity of a central message provider. Also, a central message provider requires a relatively brittle namespace scheme to ensure that messages are properly delivered.
A method, apparatus, and system are provided for a Message-Oriented Middleware (MOM) provider having multiple logical MOM server instances. In an embodiment, the MOM provider having multiple logical MOM server instances is implemented on an application server. Each MOM server instance may include a session container to manage one or more sessions and a destination container to provide one or more destinations. In an embodiment, each destination is identified by a globally unique identifier.
Embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings in which like reference numerals refer to similar elements.
a is a conceptual illustration of the administered objects stored in a registry service, according to an embodiment of the invention.
b is a conceptual illustration of the internal configuration entities that define separate MOM server instances, according to an embodiment of the invention.
a is a flow diagram illustrating certain aspects of a method for accessing an MOM provider having multiple logical MOM server instances, according to an embodiment of the invention.
b is a flow diagram illustrating certain aspects of a method for employing an MOM provider having multiple server instances, according to an embodiment of the invention.
A method, apparatus, and system are provided for a Message-Oriented Middleware (MOM) provider having multiple logical MOM server instances. In an embodiment, the MOM provider having multiple logical MOM server instances is implemented on an application server. Each MOM server instance may include a session container to manage one or more sessions and a destination container to provide one or more destinations. In an embodiment, a globally unique identifier identifies each destination. As is further described below, in an embodiment, each of the multiple logical MOM server instances is defined by a configuration entity.
In an embodiment, MOM provider 300 is implemented on an application server. The term “application server” broadly refers to a computing device that performs data processing. In a multi-tiered environment, such as the one illustrated in
In an embodiment, MOM provider 300 is separated into two main layers: session container 302 and destination container 304. Session container 302 is responsible for session and connection related tasks. The term “session” refers to an active connection between two elements of a distributed system (e.g., between two applications, between two components, between an application and a component, etc.). The term “connection” refers to a connection between an MOM client and the MOM provider.
In an embodiment, when a client creates an MOM connection (e.g., via a directory lookup) the connection is bound to a session container (e.g., session container 302). All sessions created on the connection may also be bound to the session container. In an embodiment, session container 302 may manage the connections and sessions of multiple clients (e.g., client 306). Establishing a connection is further discussed below with reference to
In one embodiment, session container 302 includes a logical session agent 308 for each session it is managing. Session agent 308 may process (and/or preprocess) all requests for an MOM session using one or more logical handlers. The term “handler” refers to a software routine that performs a particular task. Examples of handlers provided by session agent 308 may include, and are not limited to, security management, logging, monitoring, transaction management, etc.
In operation, client 306 may send an MOM message to dispatcher 310 to be distributed to a destination. Session container 302 may accept the message and forward it to session agent 308. Session agent 308 may process the message and send it to router 312. Router 312 may be a logical component that transmits messages between session container 302 and destination container 304. Router 312 may include router code and/or may use the internal communication system of the application server.
Destination container 304 is responsible for executing the core messaging functions of storing messages (e.g., in volatile memory and/or persistently), maintaining the order of messages, and distributing the messages to the proper recipients. In one embodiment, destination container 304 includes all of the destination agents (e.g., queue agent 314 and topic agent 316) that are bound to the application server on which destination container 304 is implemented. The term “destination agent” refers to a software agent that is responsible for handling the messaging operations of a particular destination. In an embodiment, the destination agents are maintained in volatile memory as data structures for all destinations that are “active.” The term “active” may refer to a destination that has at least one consumer or producer attached.
MOM provider 300 may support one (or both) of the messaging schemes known as point-to-point and publish/subscribe messaging. In point-to-point messaging, each message is addressed to a specific queue. The term “queue” refers to a storage space either in memory or a persistent store (e.g., a database) for messages that are addressed to a particular client. A client establishes the queue to hold its messages. The queue may retain all messages sent to it until the messages are consumed or until they are expired.
In a publish/subscribe messaging scheme a client addresses a message to a topic. The term “topic” refers to a storage space either in memory or a persistent store (e.g., a database) for messages that may be accessed by clients that subscribe to the topic. The topic may retain messages for as long as it takes to distribute the messages to all clients.
In an embodiment, queue agent 314 handles all messages for a particular queue (e.g., a queue in database 320 and/or in volatile memory). In one embodiment, queue agent 314 manages the order of messages within an associated queue. In such an embodiment, a separate queue agent 314 exists for each queue managed by destination container 304.
In an embodiment, topic agent 316 handles all messages sent to an associated topic. In such an embodiment, topic agent 316 includes logic to maintain the associated topic in volatile memory. In addition, topic agent 316 may include memory swapping logic to swap data between volatile memory and, for example, database 320. In an alternative embodiment, topic agent 316 includes logic to maintain the associated topic on database 320 (in addition to or instead of maintaining the topic in volatile memory).
In one embodiment, distribution manager 321 creates agents, as needed, for MOM provider 300 and its logical MOM server instances. For example, distribution manager 321 may create session agent 308, queue agent 314, and/or topic agent 316, as needed. In an alternative embodiment, destination agents (e.g., queue agent 314 and/or topic agent 316) are created by an appropriate AgentHandler for each destination that becomes active. In addition, session contexts may implement the functionality of session agents 308. A SessionHandler for each client session may create a session context and the session context may be stored in the corresponding connection context.
In an embodiment, router 312 and distribution manager 321 make use of one or more directories and repositories that store information for MOM provider 300. In an embodiment, destination registry 322 stores the physical location of the agents (e.g., queue agent 314 and/or topic agent 316) responsible for each destination. In an alternative embodiment (e.g., in which destination registry 322 is not implemented), destinations and related objects (e.g., queue agent 314 and/or topic agent 316) that belong to a given logical MOM server instance (e.g., logical MOM server instance 420, shown in
Database 320 may persistently store messages for queues and/or durable subscriptions. The term “durable subscription” refers to receiving messages at a topic for a client that is not active (e.g., not currently connected to the topic). In addition, database 320 may store data that is “swapped” in and out of volatile memory to conserve system resources. In an embodiment, database 320 includes a Database Management System (DBMS). The term “DBMS” refers to logic that provides overall organization of the data within a database. For example, a DBMS may retrieve the data from the database and/or ensure integrity of the data within the database. In an embodiment, the DBMS may be a “relational” DBMS (or simply, RDBMS).
MOM provider 410 provides a message service for applications and components executing on application server 400. In the illustrated embodiment, MOM provider 410 includes logical MOM server instances 420 and 430. Logical MOM server instances 420 and 430 may be defined by separate configuration entities that specify, for example, identifiers for the logical instances, identifiers for the destinations, which destinations are assigned to which logical instance, and the like. These configuration entities are further described below with reference to
Initially, only one of applications 402 and 404 may be deployed on application server 400 and only one logical MOM server instance is configured. For example, call center application 402 may be deployed and logical MOM server instance 420 may be configured to provide a message service for call center application 402. In such an embodiment, the configuration options of MOM server instance 420 may be optimized for call center application 402. For example, session container 422 may be configured to provide one or more message sessions for application 402. Also, destination container 424 may be configured to provide queues 426 and 428 for application 402.
A potential challenge occurs, however, when Webshop application 404 is deployed to application server 400. It is possible that Webshop application 404 uses a queue that has the same name as one of the queues used by application 402. For example, call center application 402 may have two queues: QIncomingCalls 426 and QOrders 428. Similarly, Webshop application 404 may have the following two queues: NewUserRequest 436 and QOrders 438.
Logical MOM server instance 430 may be configured to separate the namespaces of the queues used by applications 402 and 404. For example, session container 432 may be configured to provide one or more message sessions for application 404. Destination container 434 may be configured to provide NewUserRequest queue 436 and QOrders queue 438. Since a separate logical MOM server instance is providing a message service for application 404, there is no conflict in the namespaces used by the queues of application 404 and the queues of application 402. In addition it is easier to administer and optimize MOM server instance 430 because it providers an MOM service to a specific application.
In one embodiment, application server 400 is a Java 2 Enterprise Edition (J2EE) application server. The term J2EE application server broadly refers to an application server that implements, at least in part, one of the J2EE specifications, for example, v1.3, published on Jul. 27, 2001 (hereinafter the J2EE Standard). Examples of a J2EE application server may include, for example, the Web Application Server (Web AS) provided by SAP AG and the Websphere application server by IBM Corporation. In an alternative embodiment, application server 400 is implemented according to a different platform, for example, the Microsoft .NET platform.
In an embodiment, logical MOM server instances 420 and 430 are Java Message Service (JMS) based MOM server instances. A JMS-based server instance broadly refers to an MOM server instance that implements, at least in part, the JMS Application Program Interface (API). In an alternative embodiment, logical MOM server instances 420 and 430 may be based on a different messaging API.
In an embodiment, a logical MOM server instance (e.g., logical MOM server instance 420, shown in
MOM configuration services 510 may provide access to configuration information for a deploy service (e.g., deploy service 526) and/or an administrative tool (e.g., administrative tool 514). Integrated development environment (IDE) 524 may use deploy service 526 to define the settings (e.g., define configuration information) for one or more logical MOM server instances during the deployment of application code. For example, in some cases it is desirable to configure one or more logical MOM server instances in conjunction with deploying application code. In an embodiment, one or more configuration settings of an MOM server instance may be specified in IDE 524 (e.g., in an eXtensible Markup Language file) and deployed with the application code. In an embodiment, deploy service 526 may be an implementation, at least in part, of the J2EE deploy service.
In an embodiment, administrative tool 514 accesses configuration services 510 to inspect and modify configuration information. Administrative tool 514 may include a graphical user interface (GUI) and/or may be a shell console (e.g., command line driven interface). In an embodiment, administrative tool 514 is a Web-based administrative tool. In an embodiment, in which administrative tool 514 provides a GUI, the GUI may be a swing-based GUI. A Swing-based GUI refers to a GUI that is based on the Swing API provided by, for example, the Java 2 Platform, Standard Edition, Specification, 1.4.2, Nov. 20, 2003.
MOM configuration services 510 includes configuration repository 512. Configuration repository 512 may store configuration information for MOM entities such as MOM server instances, queues, topics, durable subscriptions, and the like. Configuration information for these entities is further described below with reference to
In an embodiment, distribution manager 527 distributes handlers for MOM destinations (e.g., queues 426, 428, 436, and 438, shown in
In one embodiment, distribution directory 522 stores the runtime-dependent location of the various agents that are used by the logical MOM server instances that are implemented on an application server. To provide timely access, the information of distribution directory 522 may be stored in the volatile memory of the application server.
In an embodiment, an MOM provider having multiple MOM server instances is, at least partly, integrated with a JMS-based API. For ease of discussion, an embodiment of the invention that is integrated with a JMS-based API is described with reference to
The JMS-based API defines pre-configured objects known as “administered objects” which implement some of the functions of a JMS-based message service. The administered objects include “connection factories” and “destinations.” A “connection factory” is a pre-configured JMS object that a client uses to create a connection with a JMS provider. A “destination” is an object that a client uses to specify as the target for the messages it produces and/or the source of the messages it consumes. These administered objects may be stored in the Java Naming Directory Interface (JNDI) API namespace of a node or as a persistent representation of the respective objects in any kind of storage medium, e.g. in a database system, file system or in any other kind of directory system.
In an embodiment, internal configuration entities may be used to define logical JMS server instances.
a is a conceptual illustration of selected elements of the JNDI namespace of a node, according to an embodiment of the invention. One or more administered objects may be bound to JNDI proxy base 602 via, for example, a connector service. JMS connection factory 604 may specify the settings and driver libraries that are used to connect to a JMS provider (e.g., JMS provider 612, shown in
b is a conceptual illustration of selected configuration entities, according to an embodiment of the invention. Each configuration entity may include one or more items of configuration information (e.g., an MOM server instance identifier). An MOM provider (e.g., MOM provider 300, shown in
MOM provider 612 is the central configuration entity for an MOM provider (e.g., MOM provider 300, shown in
In an embodiment, an administrative tool (e.g., administrative tool 514, shown in
As described above, embodiments of the invention provide an MOM provider having multiple logical MOM server instances. In one embodiment, MOM server instance configuration entity 614 provides a mechanism for defining the multiple logical MOM server instances. Each MOM server instance may manage a distinct set of destinations. Thus, a particular queue or topic is typically deployed to one logical MOM server instance.
In an embodiment, all MOM server instances share one common network layer and, therefore, use the same port. For example, all MOM server instances may share the common network layer defined in MOM provider entity 612. In such an embodiment, an MOM server instance is unambiguously identified by the combination of a hostname, port, and MOM server instance name (e.g., server instance name 616 also referred to as a server instance identifier).
In an embodiment, one or more properties may be configured for each MOM server instance. For example, each MOM server instance may have an instanceName (or other identifier) to distinguish one server instance from another. In an embodiment, each instanceName is unique for a given application server installation. In one embodiment, all application servers and all MOM server instances share a common configuration store. In such an embodiment, a configuration store property (e.g., a Uniform Resource Locator (URL)) may be configured for each MOM server instance. A configuration repository (e.g., configuration repository 512, shown in
In an embodiment, one or more properties may be specified for a destination. Destination entity 618 represents the configurable properties of a destination according to an embodiment of the invention. Typically, queues and topics have a number of common properties which are, hereinafter, referred to as “standard destination properties.” In one embodiment, the standard destination properties include: a name and a defaultJNDIName. The “name” may provide a unique internal (e.g., within an application server) identifier for a destination. The “defaultJNDIName” may specify the default name for a destination in a JNDI directory. In one embodiment, the MOM provider automatically creates an administered object in JNDI when a destination having a defaultJNDIName is deployed to the MOM provider. In alternative embodiments, destination entity 618 may have more properties, fewer properties, and/or different properties.
In an embodiment, a client may have a durable subscription to a topic. Durable subscription entity 620 illustrates the configurable properties of a durable subscription. Durable subscription entity 620 may be created during runtime and/or may be “pre-defined” during design time. If durable subscription entity 620 has been pre-defined during design time, a client may call the following method to create a durable subscription: “createDurableSubscriber(topic, subscriptionName).” In response, the MOM provider (e.g., MOM provider 300, shown in
In one embodiment, the configurable properties of durable subscription entity 620 include a name property and a NoLocal property. The name property may provide an identifier for the durable subscription. The NoLocal property may provide a mechanism for clients to ensure that they are not the recipients of messages that they publish. In alternative embodiments, durable subscription entity 620 may have more properties, fewer properties, and/or different properties.
In an embodiment, a “snapshot” of a reference configuration for an MOM server instance may be generated in, for example, an IDE. The term “snapshot” may refer to an eXtensible Markup Language (XML) description of the reference configuration. The reference configuration may specify configuration parameters to optimize the MOM server instance for a given application. The reference configuration may be included in the archive files of the application (e.g., in the J2EE Enterprise Archive) to specify standard settings for an MOM server instance to be used with the application.
Turning now to
a is a flow diagram illustrating certain aspects of a method for accessing an MOM provider having multiple logical MOM server instances, according to an embodiment of the invention. Referring to process block 802, an MOM client requests connection information from a registry service to establish a connection to an MOM provider. Referring to process block 804, the MOM client receives the connection information from the registry service. In an embodiment, the received connection information includes one or more MOM parameters including, for example, an MOM server instance name to uniquely identify one of a plurality of MOM server instances.
b is a flow diagram illustrating certain aspects of a method for employing an MOM provider having multiple logical MOM server instances, according to an embodiment of the invention. Referring to process block 810, an MOM client (e.g., application 402, shown in
A “registry service” may be, for example, a “naming service” and/or a “directory service.” A “naming service” refers to a service that enables software entities to name objects and to retrieve objects by name. Typically, a “name” is generated by a set of syntactic rules called a naming convention. The association of an object with its name may be referred to as a binding. A “directory service” refers to a naming service that allows each bound object to be associated with attributes and provides a way to retrieve an object based on its attributes rather than its name.
In one embodiment, the registry service may be based, at least in part, on the Java Naming and Directory Interface (JNDI). In such an embodiment, requesting connection information may include requesting a “connection factory object” from the JNDI. A connection factory object may provide the settings and driver libraries that a client uses to connect with the MOM provider. In an embodiment, the connection factory object includes an MOM server instance identifier (e.g., an instanceName) to identify the MOM server instance having the session container to which the client will connect. The term “establishing a connection” refers to using the connection information to reach an MOM server instance.
In an embodiment, enhanced connection factory 906 and enhanced destination 908 include properties (e.g., MOM parameters) that facilitate multiple MOM server instances. For example, enhanced connection factory 906 includes MOM server instance identifier 910 to specify the MOM server instance to which enhanced connection factory 906 provides a connection. Similarly, enhanced destination 908 includes destination identifier 912 to specify (at least locally) the identity of the destination.
Referring again to
Referring to process block 830, the client starts a session with the MOM server instance that is specified by the received MOM server instance identifier. A “session” refers to a context for producing and/or consuming messages. In one embodiment, a session may be either a queue type session or a topic type session depending on the destination of the session. The following is an exemplary code snippet suitable for starting a session in which a topic is the destination: “TopicSession topicSession=TopicConnection.createTopicSession (param 1, param 2).”
Referring to process block 840, the client sends a message to the MOM server instance specified by the received MOM server instance identifier. In one embodiment, the message includes a globally unique identifier to uniquely identify a destination associated with the MOM server instance. The destination may be, for example, a queue or a topic. In one embodiment, each destination has an associated destination identifier (e.g., a destination name). In an embodiment, the destination identifier may be locally unique. In other words, two destinations on two different MOM server instances may have the same destination identifier. The globally unique identifier may be a combination of the MOM server instance identifier and the destination identifier.
MOM provider having multiple server instances 1050 enables computing device 1000 to provide a scalable MOM provider for an enterprise network. MOM provider having multiple server instances 1050 may be executable content, control logic (e.g., ASIC, PLD, FPGA, etc.), firmware, or some combination thereof, in an embodiment of the invention. In embodiments of the invention in which MOM provider having multiple server instances 1050 is executable content, it may be stored in memory 1020 and executed by processor(s) 1010.
Memory 1020 may encompass a wide variety of memory devices including read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), non-volatile random access memory (NVRAM), cache memory, flash memory, and other memory devices. Memory 1020 may also include one or more hard disks, floppy disks, ZIP disks, compact disks (e.g., CD-ROM), digital versatile/video disks (DVD), magnetic random access memory (MRAM) devices, and other system-readable media that store instructions and/or data. Memory 1020 may store program modules such as routines, programs, objects, images, data structures, program data, and other program modules that perform particular tasks or implement particular abstract data types that facilitate system use.
One or more I/O interfaces 1030 may include a hard disk drive interface, a magnetic disk drive interface, an optical drive interface, a parallel port, serial controller or super I/O controller, serial port, universal serial bus (USB) port, a display device interface (e.g., video adapter), a network interface card (NIC), a sound card, modem, and the like. System interconnection 1070 permits communication between the various elements of computing device 1000. System interconnection 1070 may include a wide variety of signal lines including one or more of a memory bus, peripheral bus, local bus, host bus, bridge, optical, electrical, acoustical, and other propagated signal lines.
Elements of the present invention may also be provided as a machine-readable medium for storing the machine-executable instructions. The machine-readable medium may include, but is not limited to, flash memory, optical disks, CD-ROMs, DVD ROMs, RAMs, EPROMs, EEPROMs, magnetic or optical cards, propagation media or other type of machine-readable media suitable for storing electronic instructions. For example, the present invention may be downloaded as a computer program which may be transferred from a remote computer (e.g., a server) to a requesting computer (e.g., a client) by way of data signals embodied in a carrier wave or other propagation medium via a communication link (e.g., a modem or network connection).
It should be appreciated that reference throughout this specification to “one embodiment” or “an embodiment” means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Therefore, it is emphasized and should be appreciated that two or more references to “an embodiment” or “one embodiment” or “an alternative embodiment” in various portions of this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined as suitable in one or more embodiments of the invention.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure aiding in the understanding of one or more of the various inventive aspects. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
This application is a division of and claims priority to U.S. application Ser. No. 10/829,875, filed on Apr. 21, 2004, the disclosure of which is incorporated herein by reference in its entirety for all purposes.
Number | Date | Country | |
---|---|---|---|
Parent | 10829875 | Apr 2004 | US |
Child | 12436740 | US |