Java: A platform for platforms
Sun's reorg may seem promising to shareholders but it's also a scramble for position. The question now is whether Sun can, or wants to, maintain its hold on Java technology. Especially with enterprise leaders like SpringSource and RedHat investing heavily in Java's future as a platform for platforms

Also see:

Discuss: Java: A platform for platforms?

Featured Whitepapers
Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Manage users with JMS

Use JMS to build a unified user management framework within your enterprise

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone

The importance of maintaining an accurate list of an enterprise's customer and user profiles cannot be overemphasized. Most enterprises today use business applications like enterprise resource planning (ERP), customer relationship management (CRM), supply chain management (SCM), and some homegrown applications for e-commerce. A common communication infrastructure is required to maintain a synchronized list of user profile information among these diverse applications. Any system providing such an infrastructure must ensure that communication among these applications is reliable (even over unreliable networks) so that user information is not lost; user information is accurate and consistent within these applications; and the solution can scale well as new users and applications are added.

Given these stringent requirements, protocols like HTTP, FTP, remote procedure call (RPC), and Remote Method Invocation (RMI) are ruled out. These are synchronous protocols, which, by definition, require an active physical connection between the client and server to function reliably. Certainly, a more robust solution is required. Messaging provides the ability for the client and server to operate asynchronously in a disconnected manner, just like email. At the same time, messaging systems like Java Message Service (JMS) offer native support for reliable, guaranteed message delivery. Clearly, if we can send user profile updates to interested applications via messages, we have a solution for our problem.

Regarding the messages' data format, we use XML for message delivery because it is easily understood by diverse applications; it is a self-describing, extensible format that should accommodate any future applications without modifying existing ones; XML content is easily searchable; and XML parsers are readily available and easy to use.

This article assumes an introductory knowledge of JMS or other message-queuing systems. Rather than describe JMS capabilities, we focus more on our framework's architecture and design. We provide a system architecture overview, a class diagram, a sequence diagram, and Java code to clearly describe the solution we developed. The solution was deployed on BEA's WebLogic Server 5.1.0 SP8 (Service Pack 8), which implements Sun Microsystems' JMS 1.0.1.

Note: You can download this article's source code from Resources.

System architecture

Figure 1 shows our system's architecture. The system consists of a Web interface for user administration. An administrator uses this interface to change a user's profile. This Web interface uses a custom API, which we call UserInfo API for convenience, to handle updates to user profiles. Each time a user profile is modified, UserInfo first updates the master database. The master database is updated first so that in the (rare) case of a transmission failure, the data can be published again using information just saved in the master database. Once the master database has been updated, the JMS publisher is notified. The publisher then publishes the changes to the JMS topic. The various registered application subscribers then asynchronously receive these changes.

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources