Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Java Messaging Services Clustering Part 2

JMS clustered architectures, colloaction, and distributed load balancing

To avoid this scenario and create a more efficient architecture, we deploy a new connection factory (CF2) with Server Affinity enabled and target the resource to those server instances hosting member destinations for DQ, namely, WebLogic Server 1 and 3. Additionally, to prevent external JMS clients from connecting to CF1, we disclose the availability of CF2 as the only connection factory accessible to external JMS clients. Thus, when an external message producer connects with CF2 to access DQ, a queue member destination is available as a collocated resource. Although this approach routes all message traffic from a message producer to a local queue destination, keep in mind that the potential exists for the physical server instance hosting the destination to become overutilized if a single JMS client is producing messages while other producer clients are not.

Also note that external JMS clients may conveniently use the cluster address and JNDI name of CF2 to locate the connection factory without consideration as to whether the connection factory is targeted to the cluster or to individual server instances.

Distributed Load Balancing
The JMS cluster in Figure 3 illustrates how to achieve the full capabilities of distributed load balancing while providing a level of high availability. The connection factories CF1 and CF2 are both targeted to the cluster, but in contrast to the previous architectures, Server Affinity is disabled. In this case, the load balancer for the distributed destination DQ will first favor a queue member with an active consumer and persistent store for any messages sent from the message producer clients, even if the destination is located on a remote server. In Figure 3, for example, MP1 connects to CF1 on WebLogic Server 1. Then, CF1 creates a JMS connection to the remote member destination MQ2 to receive the message. Since Server Affinity is disabled, DQ will always make a decision based on its load balancing algorithm to distribute each message sent from a message producer among its destination members. The next message sent from MP1 will most likely be directed to a different member destination of DQ.

For a newly created, message-driven bean, the connection factory CF1 will first favor a queue member destination of DQ without any current consumers. This behavior helps to ensure each member destination has at least one message consumer ready to process a new message on the queue, and this is clear in the diagram as each physical queue member is pinned with a message-driven bean listener. Again, since Server Affinity is disabled on CF1, a message consumer might be pinned to a member queue over a remote JMS connection, as is the case with MDB1 and MDB2.

Finally, in this architecture we used a JDBC store as the persistence mechanism for all JMS servers. A JDBC store has an advantage over a file store in that it facilitates recovery in a failure scenario. If, for example, a WebLogic server instance hosting a JMS server fails, the JMS server and all its destinations can be easily migrated to another WebLogic instance, provided the JDBC store connection pool is targeted on the new server instance receiving the migrated JMS server. Migrating a JMS server using a file store, however, will require the new server instance to have access to the file store, which may be achieved by using a shared disk; otherwise, you will need to copy the file store data files and transaction logs to allow WebLogic to recover any persisted messages. Note that a JDBC store may also represent a single point of failure if the database fails. For this reason it is ideal to use a fault-tolerant database, or, at a minimum, use the Test Connections on Reserve attribute on the JDBC store connection pool to reconnect with the failed database after it is available again without having to restart the WebLogic server instance.

JMS Clustering Best Practices
Here is a list of best practices to follow when designing an application that utilizes JMS clustering.

  • Collocate to reduce network overhead. Collocate JMS clients with JMS resources for better performance while reducing remote JMS connections and network traffic.
  • Use distributed load balancing by disabling Server Affinity. Disable Server Affinity on JMS connection factories to distribute message traffic to all distributed destination members.
  • Use file stores for increased performance. Use a file store to increase the performance of persistent messages.
  • Use JDBC stores for reliability. Use a JDBC store to easily migrate JMS resources from a failed WebLogic server.
  • Use message-driven beans for reliable message consumption. Message-driven beans are ideal for reliable, asynchronous message consumption. If you deploy a MDB listening on a distributed destination, WebLogic ensures there are consumers listening on each destination member. This is an ideal approach for reliability and performance, coupled with the features of load balancing and fail over provided by WebLogic.
  • Distributed topics for nondurable subscribers. For nondurable topic subscribers, ensure that all JMS servers hosting topic members for a distributed topic are configured without a JMS store; otherwise, WebLogic will treat all consumers as durable subscriptions, which can seriously degrade performance. If you can not remove the store from a JMS server because it is used by another destination, then an alternative is to set the StoreEnabled parameter to False for each individual topic member destination.
This article covered JMS cluster architectures and illustrated the pros and cons of collocation and distributed load balancing. Collocation reduces the need for remote connections and improves the performance of processing JMS message traffic, but may lead to disparate utilization of processing capacity among physical servers. Distributed load balancing promotes equal distribution of message processing among physical JMS destinations in a cluster, but also increases network overhead. However, just as with everything else in life, including your friends, relationships, your job, pets, and, distributed JMS systems too, it's all give and take, so the decision you make should be based on the requirements and context of the application you are designing.

That's it for this article! Please feel free to e-mail me with your comments and questions.

More Stories By Raffi Basmajian

Raffi Basmajian works as an application architect for a major financial services firm in New York City. He specializes in architecting Java/J2EE distributed systems and integration frameworks. He can be reached at [email protected]

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

IoT & Smart Cities Stories
The deluge of IoT sensor data collected from connected devices and the powerful AI required to make that data actionable are giving rise to a hybrid ecosystem in which cloud, on-prem and edge processes become interweaved. Attendees will learn how emerging composable infrastructure solutions deliver the adaptive architecture needed to manage this new data reality. Machine learning algorithms can better anticipate data storms and automate resources to support surges, including fully scalable GPU-c...
Machine learning has taken residence at our cities' cores and now we can finally have "smart cities." Cities are a collection of buildings made to provide the structure and safety necessary for people to function, create and survive. Buildings are a pool of ever-changing performance data from large automated systems such as heating and cooling to the people that live and work within them. Through machine learning, buildings can optimize performance, reduce costs, and improve occupant comfort by ...
The explosion of new web/cloud/IoT-based applications and the data they generate are transforming our world right before our eyes. In this rush to adopt these new technologies, organizations are often ignoring fundamental questions concerning who owns the data and failing to ask for permission to conduct invasive surveillance of their customers. Organizations that are not transparent about how their systems gather data telemetry without offering shared data ownership risk product rejection, regu...
René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
Poor data quality and analytics drive down business value. In fact, Gartner estimated that the average financial impact of poor data quality on organizations is $9.7 million per year. But bad data is much more than a cost center. By eroding trust in information, analytics and the business decisions based on these, it is a serious impediment to digital transformation.
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
Predicting the future has never been more challenging - not because of the lack of data but because of the flood of ungoverned and risk laden information. Microsoft states that 2.5 exabytes of data are created every day. Expectations and reliance on data are being pushed to the limits, as demands around hybrid options continue to grow.
Digital Transformation and Disruption, Amazon Style - What You Can Learn. Chris Kocher is a co-founder of Grey Heron, a management and strategic marketing consulting firm. He has 25+ years in both strategic and hands-on operating experience helping executives and investors build revenues and shareholder value. He has consulted with over 130 companies on innovating with new business models, product strategies and monetization. Chris has held management positions at HP and Symantec in addition to ...
Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities - ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups.
As IoT continues to increase momentum, so does the associated risk. Secure Device Lifecycle Management (DLM) is ranked as one of the most important technology areas of IoT. Driving this trend is the realization that secure support for IoT devices provides companies the ability to deliver high-quality, reliable, secure offerings faster, create new revenue streams, and reduce support costs, all while building a competitive advantage in their markets. In this session, we will use customer use cases...