Master/Slave Mode of fflib framework Broker

Source: Internet
Author: User

In the two descriptions of fflib, fflib is a framework built based on the broker mode. The core component diagram is as follows:

Http://www.cnblogs.com/zhiranok/archive/2012/07/30/fflib_framework.html

Http://www.cnblogs.com/zhiranok/archive/2012/08/08/fflib_tutorial.html

 

In this case, the obvious bottleneck is that there is only one broker. When the number of client and service nodes increases, a single broker cannot be hosted. So this article will explore how to extend fflib.

In fact, the solution is very direct, that is, adding a broker. To add a broker node for fflib, refer to the master/slave structure in MySQL to design the multi-broker framework of fflib, for example:

When the service calls the Registration Service and interface, only the broker master node is used. The master node synchronizes the registered service and interface information to all slave nodes, all service interfaces and client nodes are connected to slave. Therefore, different services Implement Message forwarding through different slave and load balancing. In addition, the message forwarding overhead is identical to that of a single broker.

Shows the core communication logic of the master and slave nodes:

Summary:

    • The Master/Slave Mode is optional, but the broker can still work.
    • Source code SVN Co http://ffown.googlecode.com/svn/trunk/
    • Build borker: CD example/broker & make
    • Enable the broker master (the default is the master):./app_broker-l TCP: // 127.0.0.1: 10241
    • Enable brokerslave:./app_broker-l TCP: // 127.0.0.1: 10242-node slave-master_host TCP: // 127.0.0.1: 10241
    • Build echo Test Service: CD example/echo_server & make &./app_echo_server
    • Construct echo test client: dd example/echo_client & make &./app_echo_client

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.