The osgi combat project (osmp) is a step-by-step introduction to the components of osgi (1)

I haven't written a blog for a long time. Recently, after the osmp project was open sourced, I received a lot of inquiries from friends. Now, based on the osmp project, I will introduce and lead you into the world of osgi step by step.

 

OSGI combat projects suitable for entry:

http://git.oschina.net/wyuxiao729/osmp

 

Origin of osmp:

When I was in my last company, I completed the intelligent network management shortlist test project of a certain operator with my colleagues. Under his leadership, I contacted osgi step by step. At the same time, I was deeply attracted by osgi's flexible and convenient deployment and hot loading. After completing this After the project, I left the company and entered a game, entertainment, and operation company. Since many of the company's projects were developed through php, after I joined the company, the company decided to use java development to rewrite many of the original projects. I was deeply moved by osgi, so I decided to use osgi to build the infrastructure and provide services to the front end. Developed based on osgi with colleagues from Shangshangjia, and slowly evolved into the existing framework. Although I have left my previous company and entered the current Internet company, I have also changed from the previous osgi and traditional development to the current infrastructure group, engaged in the development of devops, and the development of container cloud, but I still can't let go of osgi. , so the business in the original code framework is stripped out and open sourced. For everyone to get started and communicate! ! ! !

 

Introduction to OSMP components:

Components in the osgi environment (servicemix deployment)

osmp-http: Publish a unified request entry through cxf, provide communication between restful and soap protocols, parse the received request and route it to the business bundle for execution and return to the caller

osmp-intf-define: The abstract interface definition of the core framework, the two main interfaces in the base are BaseDataService.java (defined basic service interface), ServiceInterceptor.java (defined basic interception service interface)

osmp-service: Service component, which implements osgi's BundleListener and ServiceListener listeners. When a bundle is installed or upgraded, the service is registered on zookeeper, and it is provided to osmp-http to query the service and call the service.

osmp-jdbc: Data persistence layer component, provides dynamic creation and destruction based on druid data source, and provides a set of data persistence layer interface based on jdbc-template and imitating mybatis, dynamic management function of sql, etc.

osmp-resource: Provides global resource configuration management

osmp-log: global log monitoring and management

osmp-cache-define: global component business cache definition in osgi environment

osmp-osgi-cache: The business cache based on ehcache in the osgi environment can dynamically modify the cache policy in real time through osmp-web, such as enabling method-based caching, dynamically adjusting the invalidation and survival time, and can also be easily extended to redis. Distributed cache.

osmp-config: global configuration management, configure osmp-web (management background) to deliver configuration and parameters

osmp-monitor: A simple performance monitoring component written by camel, mainly using camel-http, camel-quartz, regularly pushes server cpu and memory information to osmp-web (management background)

osmp-util: tool component

osmp-tools: tool components

osmp-zookeeper: zookeeper tool component

 

osmp-demo: A simple demo based on business development under osmp

 

management background

osmp-web: The management background of osmp, this is not much to say, it runs directly in tomcat and jetty.

osmp-cache: The cache component under the web project, which can dynamically modify the cache policy through the page, and enable or disable the method-level-based business cache.

 

SDK provided to the business side

osmp-client: The sdk client provided to the business side. Through this component, it monitors the services registered on zk, the status of the server, and the policies published by osmp-web, and performs service publishing, service routing, and load balancing algorithms. degree, etc.

 

 

The basic business components are interdependent, and the minimum deployment unit is as follows:

osmp-http、osmp-intf-define,osmp-service、osmp-utils、osmp-tools

 

Since the submitted code needs to run, and other components achieve the effect of ppt, other components must also be deployed, if you only want to run on a single machine. The above components are ok, but you may need to comment out some code slightly!

 

The basic components are introduced here. If there is something unclear, please add qq: 335898216 to communicate!

 

The next article will introduce osmp-http to publish restful services and webservice services through cxf in the osgi environment, and call the services provided by business components after request parsing!

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326654281&siteId=291194637