add provision , remove kafka support
This commit is contained in:
20
README.md
20
README.md
@@ -142,11 +142,6 @@ Download the current version from Baidu Pan,<a href="https://maxkey.top/zh/about
|
||||
| 教育 | 重庆市北碚图书馆 |
|
||||
| 教育 | 德清智慧教育平台 |
|
||||
| 教育 | 余姚市教育局 |
|
||||
| 企业 | 国家能源局 |
|
||||
| 企业 | 360公司 |
|
||||
| 企业 | 深圳市金溢科技股份有限公司 |
|
||||
| 企业 | 之江实验室 |
|
||||
| 企业 | 深圳市中悦科技有限公司 |
|
||||
| 金融 | 中国金融认证中心 |
|
||||
| 金融 | 国元证券 |
|
||||
| 金融 | 华夏金融租赁有限公司 |
|
||||
@@ -154,14 +149,20 @@ Download the current version from Baidu Pan,<a href="https://maxkey.top/zh/about
|
||||
| 金融 | 国宝人寿保险股份有限公司 |
|
||||
| 金融 | 瀚华金控股份有限公司 |
|
||||
| 汽车 | 路特斯中国 |
|
||||
| 企业 | 北京银泰置业有限公司 |
|
||||
| 企业 | 国家能源局 |
|
||||
| 企业 | 360公司 |
|
||||
| 企业 | 深圳市金溢科技股份有限公司 |
|
||||
| 企业 | 深圳市中悦科技有限公司 |
|
||||
| 企业 | 中创智维科技有限公司 |
|
||||
| 企业 | 西藏阜康医院 |
|
||||
| 企业 | 上海逸广信息科技有限公司 |
|
||||
| 企业 | 遂宁市经济大数据平台 |
|
||||
| 企业 | 跳羚科技(厦门)有限公司 |
|
||||
| 企业 | 飞天诚信科技股份有限公司 |
|
||||
| 企业 | 深圳能源集团股份有限公司 |
|
||||
| 企业 | 唐颐控股有限公司 |
|
||||
| 企业 | 吕梁市医改监测平台 |
|
||||
| 企业 | 中国航空制造技术研究院 |
|
||||
| 企业 | 遂宁市经济大数据平台 |
|
||||
| 企业 | 同方节能工程技术有限公司 |
|
||||
| 企业 | 云南航天工程物探检测股份有限公司 |
|
||||
| 企业 | 山东港口陆海国际物流集团有限公司 |
|
||||
@@ -172,10 +173,9 @@ Download the current version from Baidu Pan,<a href="https://maxkey.top/zh/about
|
||||
| 企业 | TISSON & COMPANY |
|
||||
| 企业 | 中航金网(北京)电子商务有限公司 |
|
||||
| 企业 | 深圳市东阳光实业发展有限公司 |
|
||||
| 企业 | 飞天诚信科技股份有限公司 |
|
||||
| 企业 | 北京银泰置业有限公司 |
|
||||
| 企业 | 浙江领湾网络有限公司 |
|
||||
| 企业 | TCL华星光电技术有限公司 |
|
||||
| 企业 | 唐颐控股有限公司 |
|
||||
| 企业 | 深圳云天励飞技术股份有限公司 |
|
||||
| 企业 | 深圳市维玛科技有限公司 |
|
||||
| 企业 | 妙盈科技 |
|
||||
@@ -185,6 +185,8 @@ Download the current version from Baidu Pan,<a href="https://maxkey.top/zh/about
|
||||
| 企业 | 杭州润为数据科技有限公司 |
|
||||
| 企业 | 百安居中国 |
|
||||
| 企业 | 广州携旅信息科技有限公司 |
|
||||
| 企业 | 广州蓝深科技有限公司 |
|
||||
| 企业 | 之江实验室 |
|
||||
| 科技 | 广州思迈特软件有限公司 |
|
||||
| 科技 | 南凌科技股份有限公司 |
|
||||
| 科技 | 尚企云链 |
|
||||
|
||||
20
README_en.md
20
README_en.md
@@ -142,11 +142,6 @@ Download the current version from Baidu Pan,<a href="https://maxkey.top/zh/about
|
||||
| 教育 | 重庆市北碚图书馆 |
|
||||
| 教育 | 德清智慧教育平台 |
|
||||
| 教育 | 余姚市教育局 |
|
||||
| 企业 | 国家能源局 |
|
||||
| 企业 | 360公司 |
|
||||
| 企业 | 深圳市金溢科技股份有限公司 |
|
||||
| 企业 | 之江实验室 |
|
||||
| 企业 | 深圳市中悦科技有限公司 |
|
||||
| 金融 | 中国金融认证中心 |
|
||||
| 金融 | 国元证券 |
|
||||
| 金融 | 华夏金融租赁有限公司 |
|
||||
@@ -154,14 +149,20 @@ Download the current version from Baidu Pan,<a href="https://maxkey.top/zh/about
|
||||
| 金融 | 国宝人寿保险股份有限公司 |
|
||||
| 金融 | 瀚华金控股份有限公司 |
|
||||
| 汽车 | 路特斯中国 |
|
||||
| 企业 | 北京银泰置业有限公司 |
|
||||
| 企业 | 国家能源局 |
|
||||
| 企业 | 360公司 |
|
||||
| 企业 | 深圳市金溢科技股份有限公司 |
|
||||
| 企业 | 深圳市中悦科技有限公司 |
|
||||
| 企业 | 中创智维科技有限公司 |
|
||||
| 企业 | 西藏阜康医院 |
|
||||
| 企业 | 上海逸广信息科技有限公司 |
|
||||
| 企业 | 遂宁市经济大数据平台 |
|
||||
| 企业 | 跳羚科技(厦门)有限公司 |
|
||||
| 企业 | 飞天诚信科技股份有限公司 |
|
||||
| 企业 | 深圳能源集团股份有限公司 |
|
||||
| 企业 | 唐颐控股有限公司 |
|
||||
| 企业 | 吕梁市医改监测平台 |
|
||||
| 企业 | 中国航空制造技术研究院 |
|
||||
| 企业 | 遂宁市经济大数据平台 |
|
||||
| 企业 | 同方节能工程技术有限公司 |
|
||||
| 企业 | 云南航天工程物探检测股份有限公司 |
|
||||
| 企业 | 山东港口陆海国际物流集团有限公司 |
|
||||
@@ -172,10 +173,9 @@ Download the current version from Baidu Pan,<a href="https://maxkey.top/zh/about
|
||||
| 企业 | TISSON & COMPANY |
|
||||
| 企业 | 中航金网(北京)电子商务有限公司 |
|
||||
| 企业 | 深圳市东阳光实业发展有限公司 |
|
||||
| 企业 | 飞天诚信科技股份有限公司 |
|
||||
| 企业 | 北京银泰置业有限公司 |
|
||||
| 企业 | 浙江领湾网络有限公司 |
|
||||
| 企业 | TCL华星光电技术有限公司 |
|
||||
| 企业 | 唐颐控股有限公司 |
|
||||
| 企业 | 深圳云天励飞技术股份有限公司 |
|
||||
| 企业 | 深圳市维玛科技有限公司 |
|
||||
| 企业 | 妙盈科技 |
|
||||
@@ -185,6 +185,8 @@ Download the current version from Baidu Pan,<a href="https://maxkey.top/zh/about
|
||||
| 企业 | 杭州润为数据科技有限公司 |
|
||||
| 企业 | 百安居中国 |
|
||||
| 企业 | 广州携旅信息科技有限公司 |
|
||||
| 企业 | 广州蓝深科技有限公司 |
|
||||
| 企业 | 之江实验室 |
|
||||
| 科技 | 广州思迈特软件有限公司 |
|
||||
| 科技 | 南凌科技股份有限公司 |
|
||||
| 科技 | 尚企云链 |
|
||||
|
||||
20
README_zh.md
20
README_zh.md
@@ -144,11 +144,6 @@
|
||||
| 教育 | 重庆市北碚图书馆 |
|
||||
| 教育 | 德清智慧教育平台 |
|
||||
| 教育 | 余姚市教育局 |
|
||||
| 企业 | 国家能源局 |
|
||||
| 企业 | 360公司 |
|
||||
| 企业 | 深圳市金溢科技股份有限公司 |
|
||||
| 企业 | 之江实验室 |
|
||||
| 企业 | 深圳市中悦科技有限公司 |
|
||||
| 金融 | 中国金融认证中心 |
|
||||
| 金融 | 国元证券 |
|
||||
| 金融 | 华夏金融租赁有限公司 |
|
||||
@@ -156,14 +151,20 @@
|
||||
| 金融 | 国宝人寿保险股份有限公司 |
|
||||
| 金融 | 瀚华金控股份有限公司 |
|
||||
| 汽车 | 路特斯中国 |
|
||||
| 企业 | 北京银泰置业有限公司 |
|
||||
| 企业 | 国家能源局 |
|
||||
| 企业 | 360公司 |
|
||||
| 企业 | 深圳市金溢科技股份有限公司 |
|
||||
| 企业 | 深圳市中悦科技有限公司 |
|
||||
| 企业 | 中创智维科技有限公司 |
|
||||
| 企业 | 西藏阜康医院 |
|
||||
| 企业 | 上海逸广信息科技有限公司 |
|
||||
| 企业 | 遂宁市经济大数据平台 |
|
||||
| 企业 | 跳羚科技(厦门)有限公司 |
|
||||
| 企业 | 飞天诚信科技股份有限公司 |
|
||||
| 企业 | 深圳能源集团股份有限公司 |
|
||||
| 企业 | 唐颐控股有限公司 |
|
||||
| 企业 | 吕梁市医改监测平台 |
|
||||
| 企业 | 中国航空制造技术研究院 |
|
||||
| 企业 | 遂宁市经济大数据平台 |
|
||||
| 企业 | 同方节能工程技术有限公司 |
|
||||
| 企业 | 云南航天工程物探检测股份有限公司 |
|
||||
| 企业 | 山东港口陆海国际物流集团有限公司 |
|
||||
@@ -174,10 +175,9 @@
|
||||
| 企业 | TISSON & COMPANY |
|
||||
| 企业 | 中航金网(北京)电子商务有限公司 |
|
||||
| 企业 | 深圳市东阳光实业发展有限公司 |
|
||||
| 企业 | 飞天诚信科技股份有限公司 |
|
||||
| 企业 | 北京银泰置业有限公司 |
|
||||
| 企业 | 浙江领湾网络有限公司 |
|
||||
| 企业 | TCL华星光电技术有限公司 |
|
||||
| 企业 | 唐颐控股有限公司 |
|
||||
| 企业 | 深圳云天励飞技术股份有限公司 |
|
||||
| 企业 | 深圳市维玛科技有限公司 |
|
||||
| 企业 | 妙盈科技 |
|
||||
@@ -187,6 +187,8 @@
|
||||
| 企业 | 杭州润为数据科技有限公司 |
|
||||
| 企业 | 百安居中国 |
|
||||
| 企业 | 广州携旅信息科技有限公司 |
|
||||
| 企业 | 广州蓝深科技有限公司 |
|
||||
| 企业 | 之江实验室 |
|
||||
| 科技 | 广州思迈特软件有限公司 |
|
||||
| 科技 | 南凌科技股份有限公司 |
|
||||
| 科技 | 尚企云链 |
|
||||
|
||||
@@ -292,13 +292,8 @@ subprojects {
|
||||
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-discovery', version: "${springcloudalibabaVersion}"
|
||||
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-config', version: "${springcloudalibabaVersion}"
|
||||
|
||||
//Message Queue
|
||||
//kafka support
|
||||
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
|
||||
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
||||
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
||||
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
|
||||
|
||||
//Message Queue Removed
|
||||
|
||||
//saml see maxkey-lib
|
||||
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
||||
//implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}"
|
||||
|
||||
@@ -254,11 +254,6 @@ subprojects {
|
||||
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-config', version: "${springcloudalibabaVersion}"
|
||||
|
||||
//Message Queue
|
||||
//kafka support
|
||||
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
|
||||
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
||||
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
||||
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
|
||||
|
||||
//saml see maxkey-lib
|
||||
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
||||
|
||||
@@ -254,11 +254,6 @@ subprojects {
|
||||
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-config', version: "${springcloudalibabaVersion}"
|
||||
|
||||
//Message Queue
|
||||
//kafka support
|
||||
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
|
||||
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
||||
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
||||
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
|
||||
|
||||
//saml see maxkey-lib
|
||||
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
||||
|
||||
@@ -290,11 +290,6 @@ subprojects {
|
||||
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-config', version: "${springcloudalibabaVersion}"
|
||||
|
||||
//Message Queue
|
||||
//kafka support
|
||||
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
|
||||
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
|
||||
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
|
||||
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
|
||||
|
||||
//saml see maxkey-lib
|
||||
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
|
||||
|
||||
@@ -27,9 +27,9 @@ import org.maxkey.entity.AccountsStrategy;
|
||||
import org.maxkey.entity.OrganizationsCast;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.persistence.mapper.AccountsMapper;
|
||||
import org.maxkey.persistence.mq.MqProvisionAction;
|
||||
import org.maxkey.persistence.mq.MqProvisionTopic;
|
||||
import org.maxkey.persistence.mq.MessageQueueService;
|
||||
import org.maxkey.provision.ProvisionService;
|
||||
import org.maxkey.provision.ProvisionAction;
|
||||
import org.maxkey.provision.ProvisionTopic;
|
||||
import org.maxkey.util.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -45,7 +45,7 @@ import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombi
|
||||
public class AccountsService extends JpaBaseService<Accounts>{
|
||||
|
||||
@Autowired
|
||||
MessageQueueService mqPersistService;
|
||||
ProvisionService mqPersistService;
|
||||
|
||||
@Autowired
|
||||
UserInfoService userInfoService;
|
||||
@@ -79,9 +79,9 @@ public class AccountsService extends JpaBaseService<Accounts>{
|
||||
cast.setOrgId(loadUserInfo.getDepartmentId());
|
||||
account.setOrgCast(organizationsCastService.query(cast));
|
||||
mqPersistService.send(
|
||||
MqProvisionTopic.ACCOUNT_TOPIC,
|
||||
ProvisionTopic.ACCOUNT_TOPIC,
|
||||
account,
|
||||
MqProvisionAction.CREATE_ACTION);
|
||||
ProvisionAction.CREATE_ACTION);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -99,9 +99,9 @@ public class AccountsService extends JpaBaseService<Accounts>{
|
||||
cast.setOrgId(loadUserInfo.getDepartmentId());
|
||||
account.setOrgCast(organizationsCastService.query(cast));
|
||||
mqPersistService.send(
|
||||
MqProvisionTopic.ACCOUNT_TOPIC,
|
||||
ProvisionTopic.ACCOUNT_TOPIC,
|
||||
account,
|
||||
MqProvisionAction.UPDATE_ACTION);
|
||||
ProvisionAction.UPDATE_ACTION);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -120,9 +120,9 @@ public class AccountsService extends JpaBaseService<Accounts>{
|
||||
loadUserInfo = userInfoService.findUserRelated(account.getUserId());
|
||||
account.setUserInfo(loadUserInfo);
|
||||
mqPersistService.send(
|
||||
MqProvisionTopic.ACCOUNT_TOPIC,
|
||||
ProvisionTopic.ACCOUNT_TOPIC,
|
||||
account,
|
||||
MqProvisionAction.DELETE_ACTION);
|
||||
ProvisionAction.DELETE_ACTION);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -24,9 +24,9 @@ import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellType;
|
||||
import org.maxkey.entity.Organizations;
|
||||
import org.maxkey.persistence.mapper.OrganizationsMapper;
|
||||
import org.maxkey.persistence.mq.MqProvisionAction;
|
||||
import org.maxkey.persistence.mq.MqProvisionTopic;
|
||||
import org.maxkey.persistence.mq.MessageQueueService;
|
||||
import org.maxkey.provision.ProvisionService;
|
||||
import org.maxkey.provision.ProvisionAction;
|
||||
import org.maxkey.provision.ProvisionTopic;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.springframework.stereotype.Repository;
|
||||
public class OrganizationsService extends JpaBaseService<Organizations>{
|
||||
|
||||
@Autowired
|
||||
MessageQueueService messageQueueService;
|
||||
ProvisionService messageQueueService;
|
||||
|
||||
public OrganizationsService() {
|
||||
super(OrganizationsMapper.class);
|
||||
@@ -52,7 +52,7 @@ public class OrganizationsService extends JpaBaseService<Organizations>{
|
||||
public boolean insert(Organizations organization) {
|
||||
if(super.insert(organization)){
|
||||
messageQueueService.send(
|
||||
MqProvisionTopic.ORG_TOPIC, organization, MqProvisionAction.CREATE_ACTION);
|
||||
ProvisionTopic.ORG_TOPIC, organization, ProvisionAction.CREATE_ACTION);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -61,7 +61,7 @@ public class OrganizationsService extends JpaBaseService<Organizations>{
|
||||
public boolean update(Organizations organization) {
|
||||
if(super.update(organization)){
|
||||
messageQueueService.send(
|
||||
MqProvisionTopic.ORG_TOPIC, organization, MqProvisionAction.UPDATE_ACTION);
|
||||
ProvisionTopic.ORG_TOPIC, organization, ProvisionAction.UPDATE_ACTION);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -85,7 +85,7 @@ public class OrganizationsService extends JpaBaseService<Organizations>{
|
||||
public boolean delete(Organizations organization) {
|
||||
if(super.delete(organization)){
|
||||
messageQueueService.send(
|
||||
MqProvisionTopic.ORG_TOPIC, organization, MqProvisionAction.DELETE_ACTION);
|
||||
ProvisionTopic.ORG_TOPIC, organization, ProvisionAction.DELETE_ACTION);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -27,10 +27,10 @@ import org.maxkey.entity.Accounts;
|
||||
import org.maxkey.entity.ChangePassword;
|
||||
import org.maxkey.entity.UserInfo;
|
||||
import org.maxkey.persistence.mapper.UserInfoMapper;
|
||||
import org.maxkey.persistence.mq.MqProvisionAction;
|
||||
import org.maxkey.persistence.mq.MqProvisionTopic;
|
||||
import org.maxkey.persistence.mq.MessageQueueService;
|
||||
import org.maxkey.persistence.repository.PasswordPolicyValidator;
|
||||
import org.maxkey.provision.ProvisionService;
|
||||
import org.maxkey.provision.ProvisionAction;
|
||||
import org.maxkey.provision.ProvisionTopic;
|
||||
import org.maxkey.util.DateUtils;
|
||||
import org.maxkey.util.StringUtils;
|
||||
import org.maxkey.web.WebContext;
|
||||
@@ -56,7 +56,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
PasswordPolicyValidator passwordPolicyValidator;
|
||||
|
||||
@Autowired
|
||||
MessageQueueService messageQueueService;
|
||||
ProvisionService messageQueueService;
|
||||
|
||||
AccountsService accountsService;
|
||||
|
||||
@@ -78,9 +78,9 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
if(messageQueueService.getApplicationConfig().isMessageQueueSupport()) {
|
||||
UserInfo loadUserInfo = findUserRelated(userInfo.getId());
|
||||
messageQueueService.send(
|
||||
MqProvisionTopic.USERINFO_TOPIC,
|
||||
ProvisionTopic.USERINFO_TOPIC,
|
||||
loadUserInfo,
|
||||
MqProvisionAction.CREATE_ACTION);
|
||||
ProvisionAction.CREATE_ACTION);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -96,9 +96,9 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
UserInfo loadUserInfo = findUserRelated(userInfo.getId());
|
||||
accountUpdate(loadUserInfo);
|
||||
messageQueueService.send(
|
||||
MqProvisionTopic.USERINFO_TOPIC,
|
||||
ProvisionTopic.USERINFO_TOPIC,
|
||||
loadUserInfo,
|
||||
MqProvisionAction.UPDATE_ACTION);
|
||||
ProvisionAction.UPDATE_ACTION);
|
||||
}
|
||||
if(userInfo.getPassword() != null) {
|
||||
changePasswordProvisioning(changePassword);
|
||||
@@ -116,9 +116,9 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
|
||||
if( super.delete(userInfo)){
|
||||
messageQueueService.send(
|
||||
MqProvisionTopic.USERINFO_TOPIC,
|
||||
ProvisionTopic.USERINFO_TOPIC,
|
||||
loadUserInfo,
|
||||
MqProvisionAction.DELETE_ACTION);
|
||||
ProvisionAction.DELETE_ACTION);
|
||||
accountUpdate(loadUserInfo);
|
||||
return true;
|
||||
}
|
||||
@@ -314,9 +314,9 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
UserInfo loadUserInfo = findByUsername(changePassworded.getUsername());
|
||||
ChangePassword changePassword = new ChangePassword(loadUserInfo);
|
||||
messageQueueService.send(
|
||||
MqProvisionTopic.PASSWORD_TOPIC,
|
||||
ProvisionTopic.PASSWORD_TOPIC,
|
||||
changePassword,
|
||||
MqProvisionAction.PASSWORD_ACTION);
|
||||
ProvisionAction.PASSWORD_ACTION);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
|
||||
|
||||
package org.maxkey.persistence.mq;
|
||||
package org.maxkey.provision;
|
||||
|
||||
public class MqProvisionAction {
|
||||
public class ProvisionAction {
|
||||
|
||||
public static String CREATE_ACTION = "CREATE_ACTION";
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
|
||||
|
||||
package org.maxkey.persistence.mq;
|
||||
package org.maxkey.provision;
|
||||
|
||||
public class MqMessage {
|
||||
public class ProvisionMessage {
|
||||
|
||||
String id;
|
||||
String topic;
|
||||
@@ -65,10 +65,10 @@ public class MqMessage {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public MqMessage() {
|
||||
public ProvisionMessage() {
|
||||
}
|
||||
|
||||
public MqMessage(String id,String topic, String actionType, String sendTime, Object content) {
|
||||
public ProvisionMessage(String id,String topic, String actionType, String sendTime, Object content) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.topic = topic;
|
||||
@@ -15,53 +15,47 @@
|
||||
*/
|
||||
|
||||
|
||||
package org.maxkey.persistence.mq;
|
||||
package org.maxkey.provision;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.maxkey.configuration.ApplicationConfig;
|
||||
import org.maxkey.persistence.mq.thread.KafkaProvisioningThread;
|
||||
import org.maxkey.provision.thread.ProvisioningThread;
|
||||
import org.maxkey.util.DateUtils;
|
||||
import org.maxkey.util.JsonUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.kafka.core.KafkaTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MessageQueueService {
|
||||
private static final Logger _logger = LoggerFactory.getLogger(MessageQueueService.class);
|
||||
public class ProvisionService {
|
||||
private static final Logger _logger = LoggerFactory.getLogger(ProvisionService.class);
|
||||
|
||||
@Autowired
|
||||
protected ApplicationConfig applicationConfig;
|
||||
|
||||
@Autowired
|
||||
protected KafkaTemplate<String, String> kafkaTemplate;
|
||||
|
||||
public void setApplicationConfig(ApplicationConfig applicationConfig) {
|
||||
this.applicationConfig = applicationConfig;
|
||||
}
|
||||
|
||||
public void setKafkaTemplate(KafkaTemplate<String, String> kafkaTemplate) {
|
||||
this.kafkaTemplate = kafkaTemplate;
|
||||
}
|
||||
|
||||
|
||||
public ApplicationConfig getApplicationConfig() {
|
||||
return applicationConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* send msg to kafka
|
||||
* @param topic kafka TOPIC
|
||||
* send msg to jdbc
|
||||
* @param topic TOPIC
|
||||
* @param content msg Object
|
||||
* @param actionType CREATE UPDATE DELETE
|
||||
*/
|
||||
public void send(String topic,Object content,String actionType) {
|
||||
//maxkey.server.message.queue , if not none , Kafka
|
||||
//maxkey.server.message.queue , if not none
|
||||
if(applicationConfig.isMessageQueueSupport()) {
|
||||
MqMessage message =
|
||||
new MqMessage(
|
||||
ProvisionMessage message =
|
||||
new ProvisionMessage(
|
||||
UUID.randomUUID().toString(), //message id as uuid
|
||||
topic, //TOPIC
|
||||
actionType, //action of content
|
||||
@@ -69,11 +63,11 @@ public class MessageQueueService {
|
||||
content //content Object to json message content
|
||||
);
|
||||
String msg = JsonUtils.gson2Json(message);
|
||||
//sand msg to MQ topic
|
||||
//sand msg to provision topic
|
||||
Thread thread = null;
|
||||
if(applicationConfig.getMessageQueue().equalsIgnoreCase("Kafka")) {
|
||||
_logger.trace("Kafka message...");
|
||||
thread = new KafkaProvisioningThread(kafkaTemplate,topic,msg);
|
||||
if(applicationConfig.getMessageQueue().equalsIgnoreCase("provision")) {
|
||||
_logger.trace("message...");
|
||||
thread = new ProvisioningThread(topic,msg);
|
||||
}else{
|
||||
_logger.trace("no send message...");
|
||||
}
|
||||
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
|
||||
|
||||
package org.maxkey.persistence.mq;
|
||||
package org.maxkey.provision;
|
||||
|
||||
public class MqProvisionTopic {
|
||||
public class ProvisionTopic {
|
||||
|
||||
public final static String USERINFO_TOPIC = "MXK_IDENTITY_USERINFO_TOPIC";
|
||||
|
||||
@@ -14,31 +14,26 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.maxkey.persistence.mq.thread;
|
||||
package org.maxkey.provision.thread;
|
||||
|
||||
import org.maxkey.pretty.PrettyFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.kafka.core.KafkaTemplate;
|
||||
|
||||
/**
|
||||
* Kafka Provisioning Thread for send message
|
||||
* Provisioning Thread for send message
|
||||
*
|
||||
*/
|
||||
public class KafkaProvisioningThread extends Thread{
|
||||
private static final Logger _logger = LoggerFactory.getLogger(KafkaProvisioningThread.class);
|
||||
|
||||
KafkaTemplate<String, String> kafkaTemplate;
|
||||
public class ProvisioningThread extends Thread{
|
||||
private static final Logger _logger = LoggerFactory.getLogger(ProvisioningThread.class);
|
||||
|
||||
String topic ;
|
||||
|
||||
String msg;
|
||||
|
||||
public KafkaProvisioningThread(
|
||||
KafkaTemplate<String, String> kafkaTemplate,
|
||||
public ProvisioningThread(
|
||||
String topic,
|
||||
String msg) {
|
||||
this.kafkaTemplate = kafkaTemplate;
|
||||
this.topic = topic;
|
||||
this.msg = msg;
|
||||
}
|
||||
@@ -46,7 +41,7 @@ public class KafkaProvisioningThread extends Thread{
|
||||
@Override
|
||||
public void run() {
|
||||
_logger.debug("send message \n{}" , PrettyFactory.getJsonPretty().format(msg));
|
||||
kafkaTemplate.send(topic, msg);
|
||||
//kafkaTemplate.send(topic, msg);
|
||||
_logger.debug("send to Message Queue finished .");
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ maxkey.server.authz.uri =${maxkey.server.name}:${server.
|
||||
maxkey.server.frontend.uri =/maxkey
|
||||
#InMemory 0 , Redis 2
|
||||
maxkey.server.persistence =${SERVER_PERSISTENCE:0}
|
||||
#identity none, Kafka ,RocketMQ
|
||||
#identity none, provision
|
||||
maxkey.server.message.queue =${SERVER_MESSAGE_QUEUE:none}
|
||||
#issuer name
|
||||
maxkey.app.issuer =CN=ConSec,CN=COM,CN=SH
|
||||
@@ -150,44 +150,6 @@ spring.mail.properties.mailotp.message.template ={0} You Token is {1} , it valid
|
||||
spring.mail.properties.mailotp.message.type =html
|
||||
spring.mail.properties.mailotp.message.validity =300
|
||||
|
||||
############################################################################
|
||||
#Spring Session for Cluster configuration #
|
||||
############################################################################
|
||||
# Session store type.
|
||||
spring.session.store-type =none
|
||||
#spring.session.store-type=redis
|
||||
# Session timeout. If a duration suffix is not specified, seconds is used.
|
||||
#server.servlet.session.timeout=1800
|
||||
# Sessions flush mode.
|
||||
#spring.session.redis.flush-mode=on_save
|
||||
# Namespace for keys used to store sessions.
|
||||
#spring.session.redis.namespace=spring:session
|
||||
|
||||
############################################################################
|
||||
#Kafka for connectors configuration #
|
||||
############################################################################
|
||||
spring.kafka.bootstrap-servers =${KAFKA_SERVERS:localhost:9092}
|
||||
# retries
|
||||
spring.kafka.producer.retries =0
|
||||
# acks
|
||||
spring.kafka.producer.acks =1
|
||||
# batch-size
|
||||
spring.kafka.producer.batch-size =16384
|
||||
# linger.ms
|
||||
spring.kafka.producer.properties.linger.ms =0
|
||||
# buffer-memory
|
||||
spring.kafka.producer.buffer-memory =33554432
|
||||
# serializer
|
||||
spring.kafka.producer.key-serializer =org.apache.kafka.common.serialization.StringSerializer
|
||||
spring.kafka.producer.value-serializer =org.apache.kafka.common.serialization.StringSerializer
|
||||
# partitioner
|
||||
#spring.kafka.producer.properties.partitioner.class=com.felix.kafka.producer.CustomizePartitioner
|
||||
############################################################################
|
||||
#RocketMQ for connectors configuration #
|
||||
############################################################################
|
||||
rocketmq.name-server =${ROCKETMQ_SERVERS:localhost:9876}
|
||||
rocketmq.producer.enable =true
|
||||
rocketmq.producer.group =maxkey_identity
|
||||
############################################################################
|
||||
#Time-based One-Time Password configuration #
|
||||
############################################################################
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
"org.maxkey.identity.rest",
|
||||
"org.maxkey.identity.scim.controller",
|
||||
"org.maxkey.persistence",
|
||||
"org.maxkey.provision",
|
||||
"org.maxkey.synchronizer",
|
||||
"org.maxkey.web",
|
||||
"org.maxkey.web.access.contorller",
|
||||
|
||||
@@ -33,7 +33,7 @@ maxkey.server.mgt.uri =${maxkey.server.uri}
|
||||
maxkey.server.authz.uri =https://${maxkey.server.domain}/maxkey
|
||||
#InMemory 0 , Redis 2
|
||||
maxkey.server.persistence =0
|
||||
#identity none, Kafka ,RocketMQ
|
||||
#identity none, provision
|
||||
maxkey.server.message.queue =${SERVER_MESSAGE_QUEUE:none}
|
||||
|
||||
maxkey.session.timeout =${SERVER_SESSION_TIMEOUT:1800}
|
||||
@@ -124,44 +124,6 @@ spring.mail.properties.mailotp.message.template ={0} You Token is {1} , it valid
|
||||
spring.mail.properties.mailotp.message.type =html
|
||||
spring.mail.properties.mailotp.message.validity =300
|
||||
|
||||
############################################################################
|
||||
#Spring Session for Cluster configuration #
|
||||
############################################################################
|
||||
# Session store type.
|
||||
spring.session.store-type =none
|
||||
#spring.session.store-type=redis
|
||||
# Session timeout. If a duration suffix is not specified, seconds is used.
|
||||
#server.servlet.session.timeout=1800
|
||||
# Sessions flush mode.
|
||||
#spring.session.redis.flush-mode=on_save
|
||||
# Namespace for keys used to store sessions.
|
||||
#spring.session.redis.namespace=spring:session
|
||||
|
||||
############################################################################
|
||||
#Kafka for connectors configuration #
|
||||
############################################################################
|
||||
spring.kafka.bootstrap-servers =${KAFKA_SERVERS:localhost:9092}
|
||||
# retries
|
||||
spring.kafka.producer.retries =0
|
||||
# acks
|
||||
spring.kafka.producer.acks =1
|
||||
# batch-size
|
||||
spring.kafka.producer.batch-size =16384
|
||||
# linger.ms
|
||||
spring.kafka.producer.properties.linger.ms =0
|
||||
# buffer-memory
|
||||
spring.kafka.producer.buffer-memory =33554432
|
||||
# serializer
|
||||
spring.kafka.producer.key-serializer =org.apache.kafka.common.serialization.StringSerializer
|
||||
spring.kafka.producer.value-serializer =org.apache.kafka.common.serialization.StringSerializer
|
||||
# partitioner
|
||||
#spring.kafka.producer.properties.partitioner.class=com.felix.kafka.producer.CustomizePartitioner
|
||||
############################################################################
|
||||
#RocketMQ for connectors configuration #
|
||||
############################################################################
|
||||
rocketmq.name-server =${ROCKETMQ_SERVERS:localhost:9876}
|
||||
rocketmq.producer.enable =true
|
||||
rocketmq.producer.group =maxkey_identity
|
||||
############################################################################
|
||||
#Time-based One-Time Password configuration #
|
||||
############################################################################
|
||||
|
||||
Reference in New Issue
Block a user