indexs, ParameterDynamicZookeeper.DataChangeCallback callback) throws Exception;
11 |
12 | void getAndWatchProxy(String instance, ParameterDynamicZookeeper.DataChangeCallback callback) throws Exception;
13 |
14 | void shutdown();
15 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/chronos/constants/Constant.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.chronos.constants;
2 |
3 |
4 | public class Constant {
5 | public static final String PROPERTY_KEY_FROM_CHRONOS = "from_chronos";
6 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/chronos/enums/Actions.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.chronos.enums;
2 |
3 |
4 | public enum Actions {
5 |
6 | UNKNOWN(0),
7 | ADD(1),
8 | CANCEL(2);
9 |
10 | Actions(int val) {
11 | this.value = val;
12 | }
13 |
14 | public int getValue() {
15 | return this.value;
16 | }
17 |
18 | private int value;
19 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/chronos/enums/MsgTypes.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.chronos.enums;
2 |
3 |
4 | public enum MsgTypes {
5 | TOMBSTONE(0),
6 | REAL_TIME(1),
7 | DELAY(2),
8 | LOOP_DELAY(3),
9 | LOOP_EXPONENT_DELAY(4);
10 |
11 | MsgTypes(int val) {
12 | this.value = val;
13 | }
14 |
15 | public int getValue() {
16 | return this.value;
17 | }
18 |
19 | private int value;
20 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/config/AppendContext.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.config;
2 |
3 |
4 | public enum AppendContext {
5 |
6 | TOPIC,GROUP,OFFSET,QID,SOURCE,MSG_KEY,TOKEN,PROPERTIES
7 |
8 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/config/CompressType.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.config;
2 |
3 |
4 | public enum CompressType {
5 | PRIMORDIAL, SNAPPY
6 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/config/ConfigConstants.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.config;
2 |
3 |
4 | public class ConfigConstants {
5 | public static final long LIMITER_FAILURE_RETRY_INTERVAL_FROM_CLUSTER = -1;
6 | public static final long LIMITER_FAILURE_RETRY_INTERVAL_DISABLE = 0;
7 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/config/ConfigurationValidator.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.config;
2 |
3 |
4 | public interface ConfigurationValidator {
5 |
6 | boolean validate() throws ConfigException;
7 |
8 | class ConfigException extends Exception {
9 | public ConfigException(String message) {
10 | super(message);
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/metric/ErrorMetrics.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.metric;
2 |
3 | import org.slf4j.Logger;
4 |
5 | import java.util.concurrent.TimeUnit;
6 |
7 | import static org.slf4j.LoggerFactory.getLogger;
8 |
9 |
10 | public class ErrorMetrics {
11 | public static final Logger METRIC_LOGGER = getLogger("MetricLogger");
12 | private static final int REPORT_INTERVAL_S = 10;
13 |
14 | private CounterMetric errorCounter;
15 |
16 | public ErrorMetrics() {
17 | errorCounter = MetricFactory.getCounterMetric("errorCounter", REPORT_INTERVAL_S, TimeUnit.SECONDS, METRIC_LOGGER, "error_type");
18 | }
19 |
20 | public void incErrorCount(String type) {
21 | errorCounter.inc(type);
22 | }
23 |
24 | public void shutDown() {
25 | errorCounter.shutDown();
26 | }
27 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/metric/MetricBuffer.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.metric;
2 |
3 | import java.util.concurrent.ConcurrentHashMap;
4 |
5 |
6 | public class MetricBuffer extends ConcurrentHashMap {
7 |
8 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/metric/MetricKey.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.metric;
2 |
3 | import java.util.Arrays;
4 |
5 |
6 | public class MetricKey {
7 | private String[] tags;
8 |
9 | public MetricKey(String[] tags) {
10 | this.tags = tags;
11 | }
12 |
13 | public String[] getTags() {
14 | return tags;
15 | }
16 |
17 | @Override
18 | public boolean equals(Object o) {
19 | if (this == o) return true;
20 | if (o == null || getClass() != o.getClass()) return false;
21 |
22 | MetricKey metricKey = (MetricKey) o;
23 |
24 | // Probably incorrect - comparing Object[] arrays with Arrays.equals
25 | return Arrays.equals(tags, metricKey.tags);
26 | }
27 |
28 | @Override
29 | public int hashCode() {
30 | return Arrays.hashCode(tags);
31 | }
32 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/metric/RateMetric.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.metric;
2 |
3 | import org.slf4j.Logger;
4 |
5 | import java.util.concurrent.TimeUnit;
6 |
7 |
8 | public class RateMetric extends CounterMetric {
9 | public RateMetric(String metricName, long step, TimeUnit unit, Logger metricLogger, String... metricTags) {
10 | super(metricName, step, unit, metricLogger, metricTags);
11 | }
12 |
13 | protected long calcValue(long value) {
14 | return (long) Math.ceil((double) value / step);
15 | }
16 | }
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/thrift/producerProxyConstants.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | package com.xiaojukeji.carrera.thrift;
8 |
9 | @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
10 | public class producerProxyConstants {
11 |
12 | public static final String PRESSURE_TRAFFIC_KEY = "isPressureTraffic";
13 |
14 | public static final String PRESSURE_TRAFFIC_ENABLE = "true";
15 |
16 | public static final String PRESSURE_TRAFFIC_DISABLE = "false";
17 |
18 | public static final String TRACE_ID = "traceId";
19 |
20 | public static final String SPAN_ID = "spanId";
21 |
22 | public static final String CARRERA_HEADERS = "carrera_headers";
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/carrera-common/src/main/java/com/xiaojukeji/carrera/utils/GroovyUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.utils;
2 |
3 | import groovy.lang.GroovyClassLoader;
4 |
5 |
6 | public class GroovyUtils {
7 |
8 | private static GroovyClassLoader loader = new GroovyClassLoader();
9 |
10 | public static Class parseClass(String groovy) {
11 | return loader.parseClass(groovy);
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/carrera-console/README.md:
--------------------------------------------------------------------------------
1 | **English** | [中文](./README_CN.md)
2 | ## DDMQ Console ##
3 | DDMQ Console is a Web service developed with Spring and Vue. Console is used to manage Topic/Group/Subscription, responsible for pushing configurations to zookeeper.
4 |
5 |
6 |
7 | ### Deploy ###
8 | * Front-End
9 |
10 | > Guide: [console-frontend](carrera-console-fe/README.md)
11 |
12 | * console-backend
13 | > Init MySQL table (use ddl/ddmq_init.sql)
14 |
15 | > run ```build.sh && control.sh start ```
16 | * add pproxy & cproxy
17 | > http://console_address:8080/carrera/api/odin/internal/v4/addPProxy?cluster=ddmq&host=pproxy_addr
18 |
19 | > http://console_address:8080/carrera/api/odin/internal/v4/addCProxy?cluster=ddmq&host=cproxy_addr
20 |
21 |
22 | * add broker & namesvr
23 | > need to manually update mq_server and cluster_mqserver_relation table.
24 |
--------------------------------------------------------------------------------
/carrera-console/README_CN.md:
--------------------------------------------------------------------------------
1 | [English](./README.md) | **中文**
2 | ## DDMQ Console ##
3 | DDMQ Console 是用户控制台的 Web 服务,使用 Spring 框架开发。负责 topic/group/subscription 等资源的配置和维护,负责推送和更新配置到 Zookeeper。提供了 CProxy 和 PProxy 等模块的配置信息。
4 |
5 |
6 | ### 部署 ###
7 | * 前端项目
8 |
9 | > 参考: [console-frontend](carrera-console-fe/README.md)
10 |
11 | * console-backend
12 | > 初始化 MySQL 表结构,使用 ddl/ddmq_init.sql
13 |
14 | > 执行 ```build.sh && control.sh start ```
15 |
16 | ### 扩容 & 缩容 ###
17 |
18 | * 增加 PProxy
19 | > 调用接口 http://console_address:8080/carrera/api/odin/internal/v4/addPProxy?cluster=ddmq&host=pproxy_addr
20 |
21 | * 增加 CProxy
22 | > 调用接口 http://console_address:8080/carrera/api/odin/internal/v4/addCProxy?cluster=ddmq&host=cproxy_addr
23 |
24 | * 扩容 broker & namesvr
25 | > 扩容 broker 自动生效
26 |
27 | > 扩容 namesvr 目前需要手动修改 mq_server 和 cluster_mqserver_relation表
--------------------------------------------------------------------------------
/carrera-console/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | BASEDIR=$(dirname "$0")
4 | cd ${BASEDIR}
5 | WKDIR=`pwd`
6 |
7 | # cd ${BASEDIR}/carrera-console-fe
8 | # sh build.sh
9 | # cd ..
10 | # rm -rf carrera-console/src/main/webapp/build carrera-console/src/main/webapp/static carrera-console/src/main/webapp/index.html
11 | # cp -R carrera-console-fe/dist/* carrera-console/src/main/webapp
12 |
13 |
14 | cd ${BASEDIR}/carrera-console
15 |
16 | mvn clean package -Pdev -Dmaven.test.skip=true
17 |
18 | cd ..
19 | OUTPATH=${WKDIR}/output
20 | mkdir -p ${OUTPATH}
21 | cp control.sh ${OUTPATH}/
22 | cp carrera-console/target/carrera.war ${OUTPATH}/
23 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/.eslintignore:
--------------------------------------------------------------------------------
1 | /tools/
2 | /lib/
3 | /examples/
4 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/**
2 | lib/**
3 | npm-debug.log
4 | .idea
5 | .vscode/
6 | dist/**
7 | temp/
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/README.md:
--------------------------------------------------------------------------------
1 | **English** | [中文](./README_CN.md)
2 | ## Usage for develop
3 | * cd carrera-console-fe
4 | * npm i
5 | * cd build, and modify the config in webpack.base.config.js:
6 | ``` js
7 | devServer: {
8 | ...
9 | proxy: {
10 | '/carrera/api': {
11 | // Modify target
12 | target: 'http://xxxxxx',
13 | changeOrigin: true,
14 | secure: false,
15 | },
16 | },
17 | }
18 | ```
19 | * npm run start
20 | * Visit DDMQ Web Console
21 |
22 | >
23 |
24 |
25 | ## Usage for deploy
26 | * cd carrera-console-fe
27 | * ./build.sh, the generated static resources are placed in the dist folder
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/README_CN.md:
--------------------------------------------------------------------------------
1 | [English](./README.md) | **中文**
2 | ## 开发使用
3 | * 1. 进入 carrera-console-fe 文件夹
4 | * 2. npm i 安装依赖包
5 | * 3. 修改build文件夹下webpack.base.config.js文件,
6 | ``` js
7 | devServer: {
8 | ...
9 | proxy: {
10 | '/carrera/api': {
11 | // 修改 target
12 | target: 'http://xxxxxx',
13 | changeOrigin: true,
14 | secure: false,
15 | },
16 | },
17 | }
18 | ```
19 | * 4. npm run start 启动服务
20 | * 5. 浏览器输入 http://0.0.0.0:8080/ 即可访问
21 |
22 |
23 | ## 部署使用
24 | * 进入 carrera-console-fe 文件夹
25 | * 执行./build.sh 等待打包编译,编译生成的静态资源放置在dist文件夹。
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/build.sh:
--------------------------------------------------------------------------------
1 |
2 |
3 | OUTPUT_DIR='dist'
4 |
5 | # Clean
6 | echo "Clean file..."
7 | rm -rf $OUTPUT_DIR node_modules dist
8 |
9 | # Install dependency package
10 | echo "Install dependency package..."
11 | npm install --color=false
12 |
13 | # Build start
14 | mkdir -p $OUTPUT_DIR
15 | echo "Start build..."
16 | npm run build
17 |
18 | echo "All codes in \"${OUTPUT_DIR}\""
19 |
20 | # Build success
21 | echo -e "Build done"
22 | exit 0
23 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/build/utils.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const path = require('path');
4 |
5 | module.exports = {
6 | resolve: function (dir) {
7 | return path.join(__dirname, '..', dir);
8 | },
9 |
10 | assetsPath: function (_path) {
11 | const assetsSubDirectory = 'static';
12 | return path.posix.join(assetsSubDirectory, _path);
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | DDMQ Console
7 |
8 |
9 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/app.vue:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
10 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/components/header/index.vue:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/src/components/header/index.vue
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/components/index.js:
--------------------------------------------------------------------------------
1 | import Header from './header/index.vue';
2 | import Sidebar from './sidebar/index.vue';
3 | import FilterInputSearcher from './filter-input-searcher/index.vue';
4 | // import Row from './grid/row.vue';
5 | // import Col from './grid/col.vue';
6 |
7 | const components = {
8 | Sidebar,
9 | Header,
10 | FilterInputSearcher
11 | // Row,
12 | // Col,
13 | };
14 |
15 | const install = function (Vue) {
16 | if (install.installed) {
17 | return;
18 | }
19 |
20 | Object.keys(components).forEach((key) => {
21 | let component = components[key];
22 |
23 | Vue.component(key, component);
24 | });
25 | };
26 |
27 | if (typeof widnow !== 'undefined' && window.Vue) {
28 | install(window.Vue);
29 | }
30 |
31 | export default Object.assign(components, {
32 | install
33 | });
34 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/components/main/index.js:
--------------------------------------------------------------------------------
1 | import Main from './main.vue'
2 | export default Main;
3 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/eventbus.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 |
3 | export default new Vue();
4 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/mixins/apis/login.js:
--------------------------------------------------------------------------------
1 | import request from '../request.js';
2 |
3 | export default {
4 |
5 | methods: {
6 | request,
7 |
8 | // login
9 | requestPostLogin (options) {
10 | let method = 'get';
11 | let url = '/carrera/api/odin/internal/login';
12 | return this.request(method, url, options);
13 | },
14 | // logout
15 | requestPostLogout (options) {
16 | let method = 'get';
17 | let url = '/carrera/api/odin/internal/logout';
18 | return this.request(method, url, options);
19 | }
20 | }
21 | };
22 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/router/group.js:
--------------------------------------------------------------------------------
1 | import IndexPage from '../pages/group/index.vue';
2 | import ConsumePage from '../pages/group/consume.vue';
3 |
4 | const routes = [
5 | {
6 | path: '/groups',
7 | name: 'groups',
8 | component: IndexPage,
9 | },
10 | {
11 | path: '/group/:id/:name',
12 | name: 'consume',
13 | component: ConsumePage,
14 | },
15 | ];
16 |
17 | export default routes;
18 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/router/subscribe.js:
--------------------------------------------------------------------------------
1 | import IndexPage from '../pages/subscribe/index.vue';
2 | // import DetailPage from '../pages/group/modals/detail.vue';
3 |
4 | const routes = [
5 | {
6 | path: '/subscribes',
7 | name: 'subscribes',
8 | component: IndexPage,
9 | },
10 | // {
11 | // path: '/topics/:id',
12 | // name: 'topicDetail',
13 | // component: DetailPage,
14 | // },
15 | ];
16 |
17 | export default routes;
18 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/schemas/group.js:
--------------------------------------------------------------------------------
1 | // 修改负责RD
2 | exports.createGroup = {
3 | groupName: [{
4 | required: true, message: 'Please input consumer group',
5 | }, {
6 | pattern: /^[A-Za-z0-9_-]*$/, message: 'Contain only letters, numbers, underscore(_) and dashes(-)',
7 | }],
8 |
9 | };
10 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/styles/drawer.less:
--------------------------------------------------------------------------------
1 |
2 | .bc-drawer{
3 |
4 | &-header {
5 | padding: 32px 32px 24px;
6 | border: none;
7 |
8 | &__inner {
9 | line-height: 32px;
10 | height: 32px;
11 | color: #333333;
12 | font-size: 24px;
13 | font-weight: 600;
14 | border: none;
15 | }
16 |
17 | p {
18 | line-height: 32px;
19 | height: 32px;
20 | }
21 | }
22 |
23 | &-body {
24 | padding: 0 60px;
25 | }
26 |
27 | &-footer {
28 | padding: 12px 32px 32px;
29 | border: none;
30 | }
31 |
32 | &-close {
33 | color: #D6D9DF;
34 | font-size: 14px;
35 | font-weight: 600;
36 | right: 40px;
37 | top: 40px;
38 | transition: all 0.3s;
39 | &:hover {
40 | color: #333;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/styles/form.less:
--------------------------------------------------------------------------------
1 | .bcui-form-item {
2 | margin-bottom: 20px;
3 | }
4 |
5 | .bcui-form-item__label {
6 | display: inline-block;
7 | padding: 0 0 4px 0;
8 | font-size: 14px;
9 | color: #333333;
10 | position: relative;
11 | }
12 |
13 | .bcui-form-item--required .bcui-form-item__label::before {
14 | content: '';
15 | display: none;
16 | }
17 |
18 | .bcui-form-item--required .bcui-form-item__label::after {
19 | content: "*";
20 | display: inline-block;
21 | margin-right: 4px;
22 | line-height: 1;
23 | font-size: 14px;
24 | font-weight: 300;
25 | color: #2D77EE;
26 | position: absolute;
27 | top: 0;
28 | right: -12px;
29 | }
30 |
31 | .bcui-form-item-tooltip {
32 | position: absolute;
33 | top: 0;
34 | right: -26px;
35 | color: #999;
36 | &:hover {
37 | color: #333;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/styles/index.less:
--------------------------------------------------------------------------------
1 | @import "./style.less";
2 | @import './detail.less';
3 | @import './modal.less';
4 | @import './form.less';
5 | @import './drawer.less';
6 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/alert/index.js:
--------------------------------------------------------------------------------
1 | import Alert from './alert.vue';
2 |
3 | export default Alert;
4 | export {
5 | Alert,
6 | };
7 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/autocomplete/index.js:
--------------------------------------------------------------------------------
1 | import AutoComplete from './index.vue';
2 |
3 | export { AutoComplete };
4 | export default AutoComplete;
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/autocomplete/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | category: Components
3 | subtitle: 按钮
4 | type: Form
5 | noinstant: true
6 | title: AutoComplete
7 | ---
8 |
9 | # AutoComplete 自动完成
10 |
11 | ## 基础用法
12 |
13 | ::: demo 基本用法
14 |
15 | 基础的按钮用法.
16 |
17 | ```html
18 |
19 |
20 |
25 | {{match}}
26 |
27 |
28 |
45 | ```
46 | :::
47 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/autocomplete/option.vue:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/src/ui-core/components/autocomplete/option.vue
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/base-drop/index.js:
--------------------------------------------------------------------------------
1 | import BaseDrop from './base-drop.vue';
2 |
3 | export { BaseDrop };
4 | export default BaseDrop;
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/breadcrumb/breadcrumb.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
18 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/breadcrumb/index.js:
--------------------------------------------------------------------------------
1 | import Breadcrumb from './breadcrumb.vue';
2 | import BreadcrumbItem from './breadcrumb-item.vue';
3 |
4 | export {
5 | Breadcrumb,
6 | BreadcrumbItem,
7 | };
8 | export default Breadcrumb;
9 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/button/index.js:
--------------------------------------------------------------------------------
1 | import Button from './button.vue';
2 | import ButtonGroup from './button-group.vue';
3 |
4 | Button.install = (Vue) => {
5 | Vue.component(Button.name, Button);
6 | };
7 |
8 | export default Button;
9 | export { Button, ButtonGroup };
10 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/card/index.js:
--------------------------------------------------------------------------------
1 | import Card from './card.vue';
2 |
3 | Card.install = (Vue) => {
4 | Vue.component(Card.name, Card);
5 | };
6 |
7 | export { Card };
8 | export default Card;
9 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/checkbox/index.js:
--------------------------------------------------------------------------------
1 | import Checkbox from './checkbox.vue';
2 | import CheckboxGroup from './checkbox-group.vue';
3 |
4 | export default Checkbox;
5 | export { Checkbox, CheckboxGroup };
6 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/drawer/index.js:
--------------------------------------------------------------------------------
1 | import Drawer from './drawer.vue';
2 |
3 | export { Drawer };
4 | export default Drawer;
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/dropdown/dropdown-menu.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/dropdown/index.js:
--------------------------------------------------------------------------------
1 | import Dropdown from './dropdown.vue';
2 | import DropdownMenu from './dropdown-menu.vue';
3 | import DropdownItem from './dropdown-item.vue';
4 |
5 | export { Dropdown, DropdownMenu, DropdownItem };
6 | export default Dropdown;
7 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/form/index.js:
--------------------------------------------------------------------------------
1 | import Form from './form.vue';
2 | import FormItem from './form-item.vue';
3 |
4 | export {
5 | Form,
6 | FormItem,
7 | };
8 | export default Form;
9 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/grid/index.js:
--------------------------------------------------------------------------------
1 | import Row from './row.vue';
2 | import Col from './col.vue';
3 |
4 | export { Row, Col };
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/icon/icon.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
23 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/icon/index.js:
--------------------------------------------------------------------------------
1 | import Icon from './icon.vue';
2 |
3 | export default Icon;
4 | export { Icon, };
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/input/index.js:
--------------------------------------------------------------------------------
1 | import Input from './input.vue';
2 |
3 | export default Input;
4 | export {Input};
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/loading/index.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/src/ui-core/components/loading/index.js
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/menu/index.js:
--------------------------------------------------------------------------------
1 | import Menu from './menu.vue';
2 | import MenuItem from './menu-item.vue';
3 | import MenuGroup from './menu-group.vue';
4 | import Submenu from './submenu.vue';
5 |
6 | export { Menu, MenuItem, MenuGroup, Submenu };
7 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/menu/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | category: Components
3 | subtitle: 菜单
4 | type: Navigation
5 | noinstant: true
6 | title: Menu
7 | ---
8 | # Menu 导航菜单 🙈🙈🙈
9 |
10 | 敬请期待
11 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/menu/menu-group.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
20 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/pagination/index.js:
--------------------------------------------------------------------------------
1 | import Pagination from './pagination.vue';
2 | import Options from './options.vue';
3 | export default Pagination;
4 | export {
5 | Pagination,
6 | Options,
7 | };
8 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/popover/index.js:
--------------------------------------------------------------------------------
1 | import Popover from './index.vue';
2 |
3 | export default Popover;
4 | export { Popover };
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/popover/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/src/ui-core/components/popover/index.less
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/progress/index.js:
--------------------------------------------------------------------------------
1 | import Progress from './index.vue';
2 |
3 | export { Progress };
4 | export default Progress;
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/progress/index.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/src/ui-core/components/progress/index.md
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/radio/index.js:
--------------------------------------------------------------------------------
1 | import Radio from './radio.vue';
2 | import RadioGroup from './radio-group.vue';
3 |
4 | export default Radio;
5 | export { Radio, RadioGroup };
6 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/render-cell/index.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: 'RenderCell',
3 | functional: true,
4 | props: {
5 | render: Function,
6 | },
7 | render: (h, ctx) => {
8 | return ctx.props.render(h);
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/select/index.js:
--------------------------------------------------------------------------------
1 | import Select from './select.vue';
2 | import Option from './option.vue';
3 | import OptionGroup from './option-group.vue';
4 |
5 | export default Select;
6 | export { Select, Option, OptionGroup };
7 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/steps/index.js:
--------------------------------------------------------------------------------
1 | import Steps from './steps.vue';
2 | import StepsItem from './steps-item.vue';
3 |
4 | export {
5 | Steps,
6 | StepsItem,
7 | };
8 | export default Steps;
9 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/steps/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | category: Components
3 | subtitle: 步骤条
4 | type: Navigation
5 | noinstant: true
6 | title: Steps
7 | ---
8 |
9 | # Steps 步骤条 🙈🙈🙈
10 |
11 | 当任务复杂或者存在先后关系时,将其分解成一系列步骤,从而简化任务。
12 |
13 | ## 基础用法
14 |
15 | 敬请期待
16 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/switch/index.js:
--------------------------------------------------------------------------------
1 | import Switch from './switch.vue';
2 |
3 | export default Switch;
4 | export { Switch };
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/tab/index.js:
--------------------------------------------------------------------------------
1 | import Tab from './tab.vue';
2 | import TabPane from './tab-pane.vue';
3 |
4 | export { Tab, TabPane };
5 | export default Tab;
6 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/table/index.js:
--------------------------------------------------------------------------------
1 | import Table from '.src/components/table.vue';
2 | import TableColunm from './src/components/table-colunm.vue';
3 | import ExpandRow from '.src/components/expand-row.vue';
4 |
5 | export default Table;
6 |
7 | export {
8 | Table,
9 | TableColunm,
10 | ExpandRow,
11 | };
12 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/table/src/components/custom-render/table-th-label.vue:
--------------------------------------------------------------------------------
1 |
6 |
33 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/table/src/components/tableCell.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: 'bc-table-cell',
3 | render: function(createElement) {
4 | return createElement(
5 | 'div', // tag name 标签名称
6 | this.custom // 子组件中的阵列
7 | );
8 | },
9 | props: ['custom']
10 | };
11 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/table/src/images/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/src/ui-core/components/table/src/images/bg.jpg
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/table/src/images/logo@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/src/ui-core/components/table/src/images/logo@1x.png
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/table/src/images/logo@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/src/ui-core/components/table/src/images/logo@2x.png
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/table/src/index.js:
--------------------------------------------------------------------------------
1 | import Table from './components/table.vue';
2 | import TableColunm from './components/table-colunm.vue';
3 | import ExpandRow from './components/expand-row.vue';
4 | const install = function(Vue) {
5 | if (install.installed) {
6 | return;
7 | }
8 | Vue.component(Table.name, Table);
9 | Vue.component(TableColunm.name, TableColunm);
10 | Vue.component(ExpandRow.name, ExpandRow);
11 | };
12 | if (typeof window !== 'undefined' && window.Vue) {
13 | install(window.Vue);
14 | }
15 | export default Object.assign(Table, { install });
16 | export { Table };
17 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/tag/index.js:
--------------------------------------------------------------------------------
1 | import Tag from './tag.vue';
2 |
3 | export default Tag;
4 | export {
5 | Tag,
6 | };
7 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/tooltip/index.js:
--------------------------------------------------------------------------------
1 | import Tooltip from './tooltip.vue';
2 |
3 | export default Tooltip;
4 | export { Tooltip };
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/tree/index.js:
--------------------------------------------------------------------------------
1 | import Tree from './tree.vue';
2 |
3 | Tree.install = (Vue) => {
4 | Vue.component(Tree.name, Tree);
5 | };
6 |
7 | export default Tree;
8 | export { Tree };
9 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/components/tree/tree.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
37 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/directives/auto-focus.js:
--------------------------------------------------------------------------------
1 | export default {
2 |
3 | /**
4 | * inserted: called when the bound element has been inserted into its parent node (this only guarantees parent node presence, not necessarily in-document).
5 | * 根据以上官方描述得知并不确定 el 是否插入到document,所以通过 setTimeout 延迟执行 focus 方法
6 | * @param {*} el
7 | * @param {*} binding
8 | */
9 | inserted(el, binding) {
10 | const autoFocus = binding.value;
11 | if (autoFocus) {
12 | setTimeout(() => el.focus());
13 | }
14 | },
15 | };
16 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/directives/clickoutside.js:
--------------------------------------------------------------------------------
1 | export default {
2 | bind(el, binding, vnode) {
3 | function documentHandler(e) {
4 | if (el.contains(e.target)) {
5 | return false;
6 | }
7 | if (binding.expression) {
8 | binding.value(e);
9 | }
10 | }
11 | el.__vueClickOutside__ = documentHandler;
12 | document.addEventListener('click', documentHandler);
13 | },
14 | update() {
15 |
16 | },
17 | unbind(el, binding) {
18 | document.removeEventListener('click', el.__vueClickOutside__);
19 | delete el.__vueClickOutside__;
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/animation/fade.less:
--------------------------------------------------------------------------------
1 | .fade-motion(@className, @keyframeName) {
2 | .make-motion(@className, @keyframeName);
3 | .@{className}-enter-active,
4 | .@{className}-appear {
5 | opacity: 0;
6 | animation-timing-function: linear;
7 | }
8 | .@{className}-leave-active {
9 | animation-timing-function: linear;
10 | }
11 | }
12 |
13 | .fade-motion(fade, ivuFade);
14 | @keyframes ivuFadeIn {
15 | 0% {
16 | opacity: 0;
17 | }
18 | 100% {
19 | opacity: 1;
20 | }
21 | }
22 |
23 | @keyframes ivuFadeOut {
24 | 0% {
25 | opacity: 1;
26 | }
27 | 100% {
28 | opacity: 0;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/animation/index.less:
--------------------------------------------------------------------------------
1 | .motion-common() {
2 | animation-duration: @animation-time;
3 | animation-fill-mode: both;
4 | }
5 |
6 | .make-motion(@className, @keyframeName) {
7 | .@{className}-enter-active, .@{className}-appear {
8 | .motion-common();
9 | animation-play-state: paused;
10 | }
11 | .@{className}-leave-active {
12 | .motion-common();
13 | animation-play-state: paused;
14 | }
15 | .@{className}-enter-active, .@{className}-appear {
16 | animation-name: ~"@{keyframeName}In";
17 | animation-play-state: running;
18 | }
19 | .@{className}-leave-active {
20 | animation-name: ~"@{keyframeName}Out";
21 | animation-play-state: running;
22 | }
23 | }
24 |
25 | @import "fade";
26 | @import "move";
27 | @import "ease";
28 | @import "slide";
29 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/common/index.less:
--------------------------------------------------------------------------------
1 | @import "./variables";
2 | @import "./normalize";
3 | @import "./base";
4 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/common/mixins.less:
--------------------------------------------------------------------------------
1 | .clearfix() {
2 | *zoom: 1;
3 |
4 | &:before,
5 | &:after {
6 | display: table;
7 | line-height: 0;
8 | content: "";
9 | }
10 |
11 | &:after {
12 | clear: both;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/components/breadcrumb.less:
--------------------------------------------------------------------------------
1 | @import (reference) '../common/variables.less';
2 |
3 | .bcui-breadcrumb {
4 | font-size: 13px;
5 | line-height: 1;
6 |
7 | &__separator {
8 | margin: 0 6px;
9 | color: #d7dde4;
10 | }
11 |
12 | & .bcui-breadcrumb__item:last-child {
13 | font-weight: 600;
14 |
15 | & .bcui-breadcrumb__separator {
16 | display: none;
17 | }
18 | }
19 | }
20 |
21 | .bcui-breadcrumb__item {
22 | display: inline-block;
23 | color: rgba(0,0,0,.65);
24 |
25 | &-link {
26 | color: rgba(0,0,0,.65);
27 | text-decoration: none;
28 | transition: color 0.2s ease-in-out;
29 |
30 | &:link {
31 | color: rgba(0,0,0,.65);
32 | }
33 |
34 | &:hover {
35 | color: @primary-color;
36 | }
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/components/icon.less:
--------------------------------------------------------------------------------
1 | [class*=" bcui-icon"],
2 | [class^="bcui-icon"] {
3 | speak: none;
4 | font-family: 'iconfont';
5 | font-style: normal;
6 | font-weight: 400;
7 | text-transform: none;
8 | line-height: 1;
9 | vertical-align: baseline;
10 | display: inline-block;
11 | -webkit-font-smoothing: antialiased;
12 | font-variant: normal normal;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/components/progress.less:
--------------------------------------------------------------------------------
1 | .bcui-progress {
2 | &-bar {
3 | width: 100%;
4 | height: 4px;
5 | border-radius: 4px;
6 | &__inner {
7 | height: 100%;
8 | border-radius: 4px;
9 | background: #f0f0f0;
10 | }
11 | &__bar {
12 | height: 100%;
13 | border-radius: 4px;
14 | background: #2d77ee;
15 | }
16 | }
17 |
18 | &-circle {
19 | position: relative;
20 | &__inner {
21 | width: 100%;
22 | height: 100%;
23 | text-align: center;
24 | margin: 0;
25 | position: absolute;
26 | top: 50%;
27 | left: 0;
28 | transform: translateY(-50%);
29 |
30 | display: flex;
31 | flex-direction: column;
32 | align-items: center;
33 | justify-content: center;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/components/table.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/src/ui-core/styles/components/table.less
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/components/tree.less:
--------------------------------------------------------------------------------
1 | .bcui-tree {
2 | &node {
3 | margin: 0;
4 | padding: 0;
5 | cursor: pointer;
6 | font-size: 1.3rem;
7 |
8 | li {
9 | list-style-type: none;
10 | }
11 |
12 | .bold {
13 | font-weight: 600;
14 | }
15 | }
16 |
17 | &node-arrow {
18 | display: inline-block;
19 | transition: all .2s ease-in-out;
20 |
21 | &--open {
22 | transform: rotate(90deg);
23 | }
24 | }
25 |
26 | &node-name {
27 | &:hover {
28 | text-decoration: underline;
29 | }
30 | }
31 |
32 | &node > &node {
33 | margin: 0;
34 | padding-left: 16px;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/mixins/index.less:
--------------------------------------------------------------------------------
1 | @import "./size";
2 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/ui-core/styles/mixins/size.less:
--------------------------------------------------------------------------------
1 | .size(@width; @height) {
2 | width: @width;
3 | height: @height;
4 | }
5 |
6 | .square(@size) {
7 | .size(@size; @size);
8 | }
9 |
10 | // fix chrome 12px bug, support ie
11 | .iconfont-size-under-12px(@size, @rotate: 0deg) {
12 | display: inline-block;
13 | @font-scale: unit(@size / @font-size-base);
14 | font-size: @font-size-base;
15 | font-size: ~"@{size} \9"; // ie8-9
16 | transform: scale(@font-scale) rotate(@rotate);
17 | :root & {
18 | font-size: @font-size-base; // reset ie9 and above
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/utils/index.js:
--------------------------------------------------------------------------------
1 | import Cookies from './cookies';
2 | import * as login from './login';
3 |
4 | export {
5 | Cookies,
6 | login
7 | }
8 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/src/utils/login.js:
--------------------------------------------------------------------------------
1 | import { Cookies } from './index';
2 | const COOKIE_KEY = 'carrera-console-ddmq-login-token'
3 | const cookieExpires = 1; // default 1 day
4 |
5 | export const setToken = (token) => {
6 | Cookies.set(COOKIE_KEY, token, { expires: cookieExpires || 1 })
7 | }
8 |
9 | export const getToken = () => {
10 | const token = Cookies.get(COOKIE_KEY)
11 | if (token) return token
12 | else return false
13 | }
14 |
15 | export const removeToken = () => {
16 | Cookies.remove(COOKIE_KEY)
17 | }
18 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/static/.gitkeep
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/static/favicon.ico
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/static/iconfont/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/static/iconfont/iconfont.eot
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/static/iconfont/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/static/iconfont/iconfont.ttf
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/static/iconfont/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/static/iconfont/iconfont.woff
--------------------------------------------------------------------------------
/carrera-console/carrera-console-fe/static/logo-with-text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console-fe/static/logo-with-text.png
--------------------------------------------------------------------------------
/carrera-console/carrera-console/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | src/main/webapp/iconfont/**
3 | src/main/webapp/1.index.css
4 | src/main/webapp/ddmq-logo.svg
5 | src/main/webapp/favicon.ico
6 | src/main/webapp/index.css
7 | src/main/webapp/index.js
8 | src/main/webapp/index.html
9 | src/main/webapp/logo-with-text.png
10 | src/main/webapp/vendors.js
11 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console/setting/carrera-console-dev.properties:
--------------------------------------------------------------------------------
1 | #logs
2 | logs.level=INFO
3 | logs.file.path=./logs
4 |
5 |
6 | #ddmq\u6570\u636E\u5E93
7 | jdbc.ddmq.driver=com.mysql.jdbc.Driver
8 | jdbc.ddmq.url=jdbc:mysql://127.0.0.1:3306/carrera_open_source?useUnicode=true&characterEncoding=utf8&autoReconnect=true
9 | jdbc.ddmq.user=carrera
10 | jdbc.ddmq.password=123456
11 |
12 |
13 | console.carrera.zookeeper=127.0.0.1:2181
14 |
15 | console.env=test
16 |
17 | console.carrera.admin.user=[admin]
18 |
19 | console.carrera.admin.password=[admin]
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/common/util/CacheLockUtils.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.common.util;
2 |
3 | import java.util.concurrent.ConcurrentHashMap;
4 |
5 |
6 | public class CacheLockUtils {
7 | private static final ConcurrentHashMap CACHE_LOCK = new ConcurrentHashMap<>();
8 |
9 | public static boolean lock(String key) {
10 | return CACHE_LOCK.putIfAbsent(key, 1) == null;
11 | }
12 |
13 | public static void unlock(String key) {
14 | CACHE_LOCK.remove(key);
15 | }
16 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/common/util/LogUtils.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.common.util;
2 |
3 | import java.util.Random;
4 |
5 |
6 | public class LogUtils {
7 |
8 | private static final Random random = new Random();
9 |
10 | public static String genLogid() {
11 | Long logid = (System.currentTimeMillis() << 22) + random.nextInt(1 << 23);
12 | return logid.toString();
13 | }
14 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/dao/BaseMapper.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.dao;
2 |
3 |
4 | public interface BaseMapper {
5 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/dao/DaoUtil.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.dao;
2 |
3 | import org.apache.commons.lang3.StringUtils;
4 |
5 |
6 | public class DaoUtil {
7 |
8 | public static String getLikeField(String field) {
9 | if(StringUtils.isEmpty(field)) {
10 | return null;
11 | }
12 | return "%" + field + "%";
13 | }
14 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/dao/mapper/custom/TopicConfCustomMapper.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.dao.mapper.custom;
2 |
3 | import java.util.List;
4 |
5 | import com.didi.carrera.console.dao.model.custom.CustomTopicConf;
6 |
7 |
8 | public interface TopicConfCustomMapper {
9 |
10 | List selectByTopicId(List list);
11 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/dao/model/custom/TopicConfConfig.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.dao.model.custom;
2 |
3 | import java.io.Serializable;
4 | import java.util.Map;
5 | import java.util.Set;
6 |
7 |
8 | public class TopicConfConfig implements Serializable {
9 | public static final String key_proxies = "proxies";
10 |
11 | private Map> proxies;
12 |
13 | public Map> getProxies() {
14 | return proxies;
15 | }
16 |
17 | public void setProxies(Map> proxies) {
18 | this.proxies = proxies;
19 | }
20 |
21 | @Override
22 | public String toString() {
23 | return "TopicConfConfig{" +
24 | "proxies=" + proxies +
25 | '}';
26 | }
27 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/service/ClusterMqserverRelationService.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.service;
2 |
3 | import com.didi.carrera.console.dao.dict.ClusterMqServerRelationType;
4 | import com.didi.carrera.console.dao.model.ClusterMqserverRelation;
5 |
6 | import java.util.List;
7 |
8 |
9 | public interface ClusterMqserverRelationService {
10 |
11 | List findByClusterId(Long clusterId);
12 |
13 | List findByClusterId(Long clusterId, ClusterMqServerRelationType type);
14 |
15 | List findByMqServerId(Long mqServerId);
16 |
17 | boolean insert(ClusterMqserverRelation relation);
18 |
19 | boolean updateByPrimaryKey(ClusterMqserverRelation relation);
20 |
21 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/service/ClusterService.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.service;
2 |
3 | import com.didi.carrera.console.dao.model.Cluster;
4 |
5 | import java.util.List;
6 | import java.util.Map;
7 |
8 |
9 | public interface ClusterService {
10 |
11 | Cluster findById(Long clusterId);
12 |
13 | Cluster findByClusterName(String clusterName);
14 |
15 | List findAll();
16 |
17 | Map findMap();
18 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/service/MqServerService.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.service;
2 |
3 | import com.didi.carrera.console.dao.model.MqServer;
4 | import com.didi.carrera.console.web.ConsoleBaseResponse;
5 | import com.didi.carrera.console.web.controller.bo.MqServerBo;
6 |
7 | import java.util.List;
8 |
9 |
10 | public interface MqServerService {
11 |
12 | List findAll();
13 |
14 | MqServer findById(Long mqServerId);
15 |
16 | MqServer findByName(String mqServerName);
17 |
18 | ConsoleBaseResponse> create(MqServerBo bo) throws Exception;
19 |
20 | boolean updateAddrById(Long mqServerId, String addr);
21 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/service/OffsetManagerService.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.service;
2 |
3 | import java.util.Date;
4 | import java.util.Map;
5 |
6 |
7 | public interface OffsetManagerService {
8 | void resetOffsetToLatest(Long clusterId, Long groupId, Long topicId) throws Exception;
9 |
10 | void resetOffsetByTime(Long clusterId, Long groupId, Long topicId, Date time) throws Exception;
11 |
12 | void resetOffsetByOffset(Long clusterId, Long groupId, Long topicId, String qid, long offset) throws Exception;
13 |
14 | Map> getProduceOffset(Long clusterId, Long topicId) throws Exception;
15 | Map> getConsumeOffset(Long clusterId, Long groupId, Long topicId) throws Exception;
16 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/service/exception/ConvertDataException.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.service.exception;
2 |
3 |
4 | public class ConvertDataException extends Exception {
5 |
6 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/service/exception/MqException.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.service.exception;
2 |
3 |
4 | public class MqException extends Exception {
5 | public MqException(String message) {
6 | super(message);
7 | }
8 |
9 | public MqException(String message, Throwable cause) {
10 | super(message, cause);
11 | }
12 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/service/exception/ZkConfigException.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.service.exception;
2 |
3 |
4 | public class ZkConfigException extends Exception {
5 | public ZkConfigException(String message) {
6 | super(message);
7 | }
8 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/service/vo/SearchItemVo.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.service.vo;
2 |
3 |
4 | public class SearchItemVo {
5 | private Long id;
6 | private String desc;
7 |
8 | public SearchItemVo(Long id, String desc) {
9 | this.id = id;
10 | this.desc = desc;
11 | }
12 |
13 | public Long getId() {
14 | return id;
15 | }
16 |
17 | public void setId(Long id) {
18 | this.id = id;
19 | }
20 |
21 | public String getDesc() {
22 | return desc;
23 | }
24 |
25 | public void setDesc(String desc) {
26 | this.desc = desc;
27 | }
28 |
29 | @Override
30 | public String toString() {
31 | return "SearchItemVo{" +
32 | "id=" + id +
33 | ", desc='" + desc + '\'' +
34 | '}';
35 | }
36 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/web/controller/bo/BaseBo.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.web.controller.bo;
2 |
3 | import com.alibaba.fastjson.annotation.JSONField;
4 | import org.hibernate.validator.constraints.NotBlank;
5 |
6 |
7 | public class BaseBo {
8 |
9 | @NotBlank(message = "当前用户不能为空")
10 | @JSONField(serialize = false)
11 | private String user;
12 |
13 | public String getUser() {
14 | return user;
15 | }
16 |
17 | public void setUser(String user) {
18 | this.user = user;
19 | }
20 |
21 | @Override
22 | public String toString() {
23 | return "BaseBo{" +
24 | "user='" + user + '\'' +
25 | '}';
26 | }
27 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/web/util/RemoteSource.java:
--------------------------------------------------------------------------------
1 | package com.didi.carrera.console.web.util;
2 |
3 |
4 | public class RemoteSource {
5 | protected RemoteSource(String ip, String source) {
6 | this.ip = ip;
7 | this.source = source;
8 | }
9 |
10 | public String toString() {
11 | return "ip=" + ip + "||ipSrc=" + source;
12 | }
13 |
14 | public final String ip;
15 | public final String source;
16 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/java/com/didi/carrera/console/web/util/StringPropertyEditor.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Kuaidadi.com Inc.
3 | * Copyright (c) 2012-2015 All Rights Reserved.
4 | */
5 | package com.didi.carrera.console.web.util;
6 |
7 | import org.apache.commons.lang3.StringUtils;
8 |
9 | import java.beans.PropertyEditorSupport;
10 |
11 |
12 | public class StringPropertyEditor extends PropertyEditorSupport {
13 |
14 | @Override
15 | public void setAsText(String text) throws IllegalArgumentException {
16 | if (StringUtils.isBlank(text)) {
17 | setValue(null);
18 | } else {
19 | setValue(text.trim());
20 | }
21 | }
22 |
23 | }
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/resources/console.yaml:
--------------------------------------------------------------------------------
1 | zookeeper: ${console.carrera.zookeeper}
2 | env: ${console.env}
3 | carreraAdminUser: ${console.carrera.admin.user}
4 | carreraAdminPassword: ${console.carrera.admin.password}
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/resources/jdbc.properties:
--------------------------------------------------------------------------------
1 | jdbc.ddmq.driver=${jdbc.ddmq.driver}
2 | jdbc.ddmq.url=${jdbc.ddmq.url}
3 | jdbc.ddmq.user=${jdbc.ddmq.user}
4 | jdbc.ddmq.password=${jdbc.ddmq.password}
5 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/resources/spring/mybatis-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/webapp/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console/src/main/webapp/favicon.ico
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/webapp/iconfont/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console/src/main/webapp/iconfont/iconfont.eot
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/webapp/iconfont/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console/src/main/webapp/iconfont/iconfont.ttf
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/webapp/iconfont/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console/src/main/webapp/iconfont/iconfont.woff
--------------------------------------------------------------------------------
/carrera-console/carrera-console/src/main/webapp/logo-with-text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-console/carrera-console/src/main/webapp/logo-with-text.png
--------------------------------------------------------------------------------
/carrera-console/version:
--------------------------------------------------------------------------------
1 | 1.5
--------------------------------------------------------------------------------
/carrera-consumer/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | /.settings/
3 | conf
4 | logs
5 | /.DS_Store
6 |
--------------------------------------------------------------------------------
/carrera-consumer/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | BASEDIR=$(dirname "$0")
5 | cd ${BASEDIR}
6 | WKDIR=`pwd`
7 | cd ${BASEDIR}
8 |
9 | mvn -U clean assembly:assembly -Dmaven.test.skip=true
10 | ret=$?
11 | if [ $ret -ne 0 ];then
12 | echo "===== maven build failure ====="
13 | exit $ret
14 | else
15 | echo -n "===== maven build successfully! ====="
16 | fi
17 |
18 | OUTPATH=${WKDIR}/output
19 | mkdir -p ${OUTPATH}
20 | mkdir -p ${OUTPATH}/conf
21 | cp control.sh ${OUTPATH}/
22 | cp src/main/resources/carrera.yaml ${OUTPATH}/conf/
23 | cp src/main/resources/log4j2.xml ${OUTPATH}/conf/
24 | cp target/carrera-consumer-1.0.0-SNAPSHOT-jar-with-dependencies.jar ${OUTPATH}/
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/actions/AsyncAction.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.actions;
2 |
3 | import com.xiaojukeji.carrera.cproxy.config.ConsumerGroupConfig;
4 |
5 |
6 | public class AsyncAction extends OrderAction {
7 |
8 | AsyncAction(ConsumerGroupConfig config) {
9 | super(config);
10 | executor.startBackgroundThreads();
11 | }
12 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/actions/NonBlockAsyncAction.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.actions;
2 |
3 | import com.xiaojukeji.carrera.cproxy.config.ConsumerGroupConfig;
4 | import com.xiaojukeji.carrera.cproxy.utils.LogUtils;
5 |
6 |
7 | public class NonBlockAsyncAction extends OrderAction {
8 |
9 | NonBlockAsyncAction(ConsumerGroupConfig config) {
10 | super(config);
11 | LogUtils.logMainInfo("NonBlockAsyncAction, group:{}", config.getGroupBrokerCluster());
12 | }
13 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/actions/hbase/HbaseCommand.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.actions.hbase;
2 |
3 | import org.apache.hadoop.hbase.client.Mutation;
4 |
5 |
6 | public class HbaseCommand {
7 |
8 | private String tableName;
9 |
10 | private Mutation mutation;
11 |
12 | public HbaseCommand(String tableName, Mutation mutation) {
13 | this.tableName = tableName;
14 | this.mutation = mutation;
15 | }
16 |
17 | public String getTableName() {
18 | return tableName;
19 | }
20 |
21 | public void setTableName(String tableName) {
22 | this.tableName = tableName;
23 | }
24 |
25 | public Mutation getMutation() {
26 | return mutation;
27 | }
28 |
29 | public void setMutation(Mutation mutation) {
30 | this.mutation = mutation;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/actions/hbase/HbaseConst.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.actions.hbase;
2 |
3 | public class HbaseConst {
4 |
5 | public static String ZK_QUORUM = "hbase.zookeeper.quorum";
6 | public static String CLIENT_BUFFER = "hbase.client.write.buffer";
7 | public static String ZK_CLIENT_PORT = "hbase.zookeeper.property.clientPort";
8 | public static String USER_NAME = "hbase.user.name";
9 | public static String PASSWORD = "hbase.user.password";
10 | }
11 |
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/actions/http/HttpParam.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.actions.http;
2 |
3 |
4 | public class HttpParam {
5 |
6 | public enum HttpParamType {
7 | HEADER, QUERY, FORM
8 | }
9 |
10 | public HttpParamType type;
11 | public String key;
12 | public String value;
13 |
14 | public HttpParam(HttpParamType type, String key, String value) {
15 | this.type = type;
16 | this.key = key;
17 | this.value = value;
18 | }
19 |
20 | @Override
21 | public String toString() {
22 | return type + "{" + key + "=" + value + '}';
23 | }
24 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/actions/redis/RedisCommand.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.actions.redis;
2 |
3 | import redis.clients.jedis.Jedis;
4 |
5 |
6 | public interface RedisCommand {
7 | String getCommandName();
8 |
9 | String getKey();
10 |
11 | String execute(Jedis jedis);
12 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/actions/redis/RedisMset.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.actions.redis;
2 |
3 | import redis.clients.jedis.Jedis;
4 |
5 |
6 | public class RedisMset implements RedisCommand {
7 | String[] kvs;
8 |
9 | public RedisMset(String[] kvs) {
10 | this.kvs = kvs;
11 | }
12 |
13 | @Override
14 | public String getCommandName() {
15 | return "mset";
16 | }
17 |
18 | @Override
19 | public String getKey() {
20 | return null;
21 | }
22 |
23 | @Override
24 | public String execute(Jedis jedis) {
25 | return jedis.mset(kvs);
26 | }
27 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/consumer/ResultCallBack.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.consumer;
2 |
3 |
4 | public interface ResultCallBack {
5 |
6 | void setResult(boolean success);
7 |
8 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/consumer/exception/CarreraClientException.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.consumer.exception;
2 |
3 |
4 | public class CarreraClientException extends Exception {
5 |
6 | public CarreraClientException(String message, Throwable cause) {
7 | super(message, cause);
8 | }
9 |
10 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/consumer/handler/AsyncMessageHandler.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.consumer.handler;
2 |
3 | import com.xiaojukeji.carrera.cproxy.consumer.CommonMessage;
4 | import com.xiaojukeji.carrera.cproxy.consumer.ConsumeContext;
5 | import com.xiaojukeji.carrera.cproxy.consumer.ResultCallBack;
6 |
7 |
8 | public interface AsyncMessageHandler {
9 |
10 | void process(CommonMessage message, ConsumeContext context, ResultCallBack resultCallBack) throws InterruptedException;
11 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/consumer/lowlevel/Fetcher.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.consumer.lowlevel;
2 |
3 |
4 | import com.xiaojukeji.carrera.thrift.consumer.AckResult;
5 | import com.xiaojukeji.carrera.thrift.consumer.FetchRequest;
6 | import com.xiaojukeji.carrera.thrift.consumer.FetchResponse;
7 |
8 |
9 | public interface Fetcher {
10 |
11 | boolean start();
12 |
13 | void shutdown();
14 |
15 | FetchResponse fetch(FetchRequest request);
16 |
17 | boolean ack(AckResult result);
18 |
19 | long getLastFetchTimestamp();
20 |
21 | void logMetrics();
22 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/consumer/lowlevel/LowLevelMessage.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.consumer.lowlevel;
2 |
3 | import com.xiaojukeji.carrera.cproxy.consumer.CommonMessage;
4 | import com.xiaojukeji.carrera.cproxy.consumer.ConsumeContext;
5 |
6 |
7 | public class LowLevelMessage {
8 |
9 | private CommonMessage message;
10 |
11 | private ConsumeContext context;
12 |
13 | public LowLevelMessage(CommonMessage message, ConsumeContext context) {
14 | this.message = message;
15 | this.context = context;
16 | }
17 |
18 | public CommonMessage getMessage() {
19 | return message;
20 | }
21 |
22 | public ConsumeContext getContext() {
23 | return context;
24 | }
25 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/utils/CommonUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.utils;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 | import java.util.Set;
6 |
7 |
8 | public class CommonUtils {
9 | public static Map mapRemoveKeys(Map map, Set deleteKeys) {
10 | if (map == null) {
11 | return null;
12 | }
13 |
14 | Map mapNew = new HashMap<>(map);
15 | deleteKeys.forEach(mapNew::remove);
16 |
17 | if (mapNew.isEmpty()) {
18 | return null;
19 | }
20 | return mapNew;
21 | }
22 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/utils/MixAll.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.utils;
2 |
3 |
4 | public class MixAll {
5 | public static String BROKER_CLUSTER_GENERAL_NAME = "ALL";
6 |
7 | public static final String INSTANCE_SPLITER = "#";
8 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/utils/StringUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.utils;
2 |
3 |
4 | public class StringUtils extends org.apache.commons.lang3.StringUtils {
5 |
6 | public static String newString(byte[] bytes) {
7 | return org.apache.commons.codec.binary.StringUtils.newStringUtf8(bytes);
8 | }
9 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/java/com/xiaojukeji/carrera/cproxy/utils/TimeUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.cproxy.utils;
2 |
3 |
4 | public class TimeUtils {
5 | public static long getCurTime() {
6 | return System.currentTimeMillis();
7 | }
8 |
9 | public static long getElapseTime(long preTime) {
10 | return System.currentTimeMillis() - preTime;
11 | }
12 | }
--------------------------------------------------------------------------------
/carrera-consumer/src/main/resources/carrera.yaml:
--------------------------------------------------------------------------------
1 | zookeeperAddr: 127.0.0.1:2181/carrera/v4/config # config zk cluster address here.
2 | host: 127.0.0.1 # local ip
3 | port: 9713 # thrift server port.
4 |
--------------------------------------------------------------------------------
/carrera-consumer/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | # this is for kafka client log.
2 | #log4j.rootLogger = DEBUG,stdout
3 | log4j.rootLogger = WARN,KAFKA_CLIENT_LOG
4 |
5 | log4j.appender.stdout = org.apache.log4j.ConsoleAppender
6 | log4j.appender.stdout.Target = System.out
7 | log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
8 | log4j.appender.stdout.layout.ConversionPattern = %d{ISO8601} %5p %c{1}:%L | %m%n
9 |
10 | log4j.appender.KAFKA_CLIENT_LOG = org.apache.log4j.FileAppender
11 | log4j.appender.KAFKA_CLIENT_LOG.File = logs/kafka-client.log
12 | log4j.appender.KAFKA_CLIENT_LOG.Append = true
13 | log4j.appender.KAFKA_CLIENT_LOG.Threshold = WARN
14 | log4j.appender.KAFKA_CLIENT_LOG.layout = org.apache.log4j.PatternLayout
15 | log4j.appender.KAFKA_CLIENT_LOG.layout.ConversionPattern = %d{ISO8601} [%p] %c{1} | %m%n
--------------------------------------------------------------------------------
/carrera-docker/.gitignore:
--------------------------------------------------------------------------------
1 | console/carrera.war
--------------------------------------------------------------------------------
/carrera-docker/README_CN.md:
--------------------------------------------------------------------------------
1 | [English](./README.md) | **中文**
2 | ## DDMQ Docker ##
3 |
4 | DDMQ 涉及到的模块较多,集群部署步骤比较复杂。为了方便开发者体验 DDMQ 的各项功能,我们制作了 docker 镜像,将涉及到的模块都打包到一个镜像中,方便用户运行一个单机版的 DDMQ。
5 |
6 | ### 容器内容 ###
7 |
8 | * 一个单机版的 Zookeeper(版本 3.4.10)
9 | * Web 应用服务器 tomcat 9 和 console 服务
10 | * rocketmq 存储引擎(一个 namesvr、一个 master broker)
11 | * 单 consumer-proxy 实例
12 | * 单 producer-proxy 实例
13 | * 单 chronos 实例(延迟模块)
14 |
15 | 备注:DDMQ 容器依赖一个 mysql 5.7 的容器
16 |
17 | ### 使用方式 ###
18 | * 安装 Docker
19 | * 安装 MySQL 客户端(建议使用 5.7.x版本)
20 | * 运行 ```build.sh``` 构建打包
21 | * 运行 ```play-ddmq.sh``` (首次执行将下载 centos7,mysql,tomcat,zookeeper 等依赖,大约20分钟,具体情况视网络情况)
22 | * 打开 DDMQ 用户控制台
23 |
24 | >
25 |
26 |
27 |
28 |
29 |
30 |
31 | *备注:producer-proxy port: 9613、consumer-proxy port: 9713*
32 |
--------------------------------------------------------------------------------
/carrera-docker/broker/bin/runbroker:
--------------------------------------------------------------------------------
1 | @echo off
2 | rem Licensed to the Apache Software Foundation (ASF) under one or more
3 | rem contributor license agreements. See the NOTICE file distributed with
4 | rem this work for additional information regarding copyright ownership.
5 | rem The ASF licenses this file to You under the Apache License, Version 2.0
6 | rem (the "License"); you may not use this file except in compliance with
7 | rem the License. You may obtain a copy of the License at
8 | rem
9 | rem http://www.apache.org/licenses/LICENSE-2.0
10 | rem
11 | rem Unless required by applicable law or agreed to in writing, software
12 | rem distributed under the License is distributed on an "AS IS" BASIS,
13 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | rem See the License for the specific language governing permissions and
15 | rem limitations under the License.
16 |
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/commons-cli-1.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/commons-cli-1.2.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/commons-lang3-3.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/commons-lang3-3.4.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/fastjson-1.2.29.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/fastjson-1.2.29.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/guava-19.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/guava-19.0.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/javassist-3.20.0-GA.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/javassist-3.20.0-GA.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/jna-4.2.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/jna-4.2.2.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/logback-classic-1.0.13.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/logback-classic-1.0.13.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/logback-core-1.0.13.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/logback-core-1.0.13.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/netty-all-4.0.42.Final.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/netty-all-4.0.42.Final.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/netty-tcnative-1.1.33.Fork22-osx-x86_64.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/netty-tcnative-1.1.33.Fork22-osx-x86_64.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/openmessaging-api-0.1.0-alpha.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/openmessaging-api-0.1.0-alpha.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-broker-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-broker-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-client-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-client-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-common-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-common-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-example-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-example-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-filter-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-filter-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-filtersrv-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-filtersrv-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-namesrv-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-namesrv-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-openmessaging-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-openmessaging-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-remoting-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-remoting-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-srvutil-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-srvutil-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-store-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-store-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/rocketmq-tools-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/rocketmq-tools-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/broker/lib/slf4j-api-1.7.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/broker/lib/slf4j-api-1.7.7.jar
--------------------------------------------------------------------------------
/carrera-docker/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | (cd ../carrera-common && mvn clean install -DskipTests)
4 | (cd ../carrera-sdk/consumer/java/carrera-consumer-sdk && mvn clean install -DskipTests)
5 | (cd ../carrera-sdk/producer/java/carrera-producer-sdk && mvn clean install -DskipTests)
6 |
7 | ../carrera-producer/build.sh && cp ../carrera-producer/target/carrera-producer-1.0.0-SNAPSHOT-jar-with-dependencies.jar producer/
8 | ../carrera-consumer/build.sh && cp ../carrera-consumer/target/carrera-consumer-1.0.0-SNAPSHOT-jar-with-dependencies.jar consumer/
9 | ../carrera-chronos/build.sh && cp ../carrera-chronos/target/chronos-1.0.0-SNAPSHOT-jar-with-dependencies.jar chronos/
10 | ../carrera-console/build.sh && cp ../carrera-console/carrera-console/target/carrera.war console/
11 |
--------------------------------------------------------------------------------
/carrera-docker/consumer/conf/carrera.yaml:
--------------------------------------------------------------------------------
1 | zookeeperAddr: 127.0.0.1:2181/carrera/v4/config # config zk cluster address here.
2 | host: 127.0.0.1 # local ip
3 | port: 9713 # thrift server port.
4 |
--------------------------------------------------------------------------------
/carrera-docker/mysql/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mysql:5.7
2 |
3 | ENV MYSQL_ALLOW_EMPTY_PASSWORD yes
4 | ENV MYSQL_DATABASE=carrera_open_source
5 | ENV MYSQL_ROOT_PASSWORD=123456
6 |
7 | ADD ddmq.sql /docker-entrypoint-initdb.d
8 |
9 | EXPOSE 3306
10 |
--------------------------------------------------------------------------------
/carrera-docker/namesvr/README.md:
--------------------------------------------------------------------------------
1 | ## Apache RocketMQ Didi 内部分支,作为DDMQ的存储引擎之一。
2 |
3 |
--------------------------------------------------------------------------------
/carrera-docker/namesvr/bin/runbroker:
--------------------------------------------------------------------------------
1 | @echo off
2 | rem Licensed to the Apache Software Foundation (ASF) under one or more
3 | rem contributor license agreements. See the NOTICE file distributed with
4 | rem this work for additional information regarding copyright ownership.
5 | rem The ASF licenses this file to You under the Apache License, Version 2.0
6 | rem (the "License"); you may not use this file except in compliance with
7 | rem the License. You may obtain a copy of the License at
8 | rem
9 | rem http://www.apache.org/licenses/LICENSE-2.0
10 | rem
11 | rem Unless required by applicable law or agreed to in writing, software
12 | rem distributed under the License is distributed on an "AS IS" BASIS,
13 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | rem See the License for the specific language governing permissions and
15 | rem limitations under the License.
16 |
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/commons-cli-1.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/commons-cli-1.2.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/commons-lang3-3.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/commons-lang3-3.4.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/fastjson-1.2.29.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/fastjson-1.2.29.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/guava-19.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/guava-19.0.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/javassist-3.20.0-GA.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/javassist-3.20.0-GA.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/jna-4.2.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/jna-4.2.2.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/logback-classic-1.0.13.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/logback-classic-1.0.13.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/logback-core-1.0.13.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/logback-core-1.0.13.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/netty-all-4.0.42.Final.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/netty-all-4.0.42.Final.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/netty-tcnative-1.1.33.Fork22-osx-x86_64.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/netty-tcnative-1.1.33.Fork22-osx-x86_64.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/openmessaging-api-0.1.0-alpha.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/openmessaging-api-0.1.0-alpha.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-broker-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-broker-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-client-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-client-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-common-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-common-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-example-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-example-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-filter-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-filter-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-filtersrv-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-filtersrv-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-namesrv-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-namesrv-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-openmessaging-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-openmessaging-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-remoting-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-remoting-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-srvutil-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-srvutil-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-store-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-store-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/rocketmq-tools-4.2.1-SNAPSHOT.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/rocketmq-tools-4.2.1-SNAPSHOT.jar
--------------------------------------------------------------------------------
/carrera-docker/namesvr/lib/slf4j-api-1.7.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-docker/namesvr/lib/slf4j-api-1.7.7.jar
--------------------------------------------------------------------------------
/carrera-docker/play-ddmq.sh:
--------------------------------------------------------------------------------
1 | # build mysql image
2 | if [[ "$(docker images -q mysql:1.0 2> /dev/null)" == "" ]]; then
3 | docker build -t mysql:1.0 ./mysql
4 | fi
5 |
6 | # build ddmq image
7 | if [[ "$(docker images -q ddmq:1.0 2> /dev/null)" == "" ]]; then
8 | docker build -t ddmq:1.0 .
9 | fi
10 |
11 | # run mysql container
12 | echo 'start mysql container...'
13 | docker run -d --rm --name mysql -p 127.0.0.1:3306:3306 -t mysql:1.0
14 |
15 | # run ddmq container
16 | echo 'start ddmq container.'
17 | docker run -i --rm -t -p 127.0.0.1:8080:8080 -p 127.0.0.1:9613:9613 -p 127.0.0.1:9713:9713 --name ddmq --link mysql ddmq:1.0
18 |
--------------------------------------------------------------------------------
/carrera-docker/producer/conf/carrera.yaml:
--------------------------------------------------------------------------------
1 | zookeeperAddr: 127.0.0.1:2181/carrera/v4/config # config zk cluster address here.
2 | host: 127.0.0.1 # local ip
3 | port: 9613 # thrift server port.
4 |
--------------------------------------------------------------------------------
/carrera-docker/start.sh:
--------------------------------------------------------------------------------
1 |
2 | sh /root/zookeeper-3.4.10/bin/zkServer.sh start
3 | cd /root/console && sh ./control.sh start
4 |
5 | while ! nc -z localhost 8080; do
6 | sleep 0.1
7 | done
8 |
9 | curl http://localhost:8080/carrera/api/odin/internal/v4/initZkPath
10 | curl http://localhost:8080/carrera/api/odin/internal/v4/initAllZk
11 |
12 | cd /root/namesvr && sh ./control.sh start
13 | cd /root/broker && sh ./control.sh start
14 |
15 | cd /root/consumer && sh ./control.sh start
16 | cd /root/producer && sh ./control.sh start
17 | cd /root/chronos && sh ./control.sh start
--------------------------------------------------------------------------------
/carrera-monitor/README.md:
--------------------------------------------------------------------------------
1 | ## DDMQ Monitor ##
2 |
3 | Monitor provide important monitor features to DDMQ.
4 |
5 |
6 | ### Features ###
7 |
8 | * Broker Monitor: monitor broker and namesvr
9 | * Inspection Monitor: monitor cproxy and pproxy
10 | * Lag Monitor: monitor consume lag and consume delay time
11 |
12 |
13 | ### Deploy ###
14 | * create inspection topic and cg_inspection group in User Console
15 | * modify monitor.yaml
16 | * run ```build.sh``` to build package
17 | * start monitor with ```control.sh start```
--------------------------------------------------------------------------------
/carrera-monitor/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | BASEDIR=$(dirname "$0")
5 | cd ${BASEDIR}
6 | WKDIR=`pwd`
7 | cd ${BASEDIR}
8 |
9 | mvn -U clean assembly:assembly -Dmaven.test.skip=true
10 | ret=$?
11 | if [ $ret -ne 0 ];then
12 | echo "===== maven build failure ====="
13 | exit $ret
14 | else
15 | echo -n "===== maven build successfully! ====="
16 | fi
17 |
18 | OUTPATH=${WKDIR}/output
19 | mkdir -p ${OUTPATH}
20 | mkdir -p ${OUTPATH}/conf
21 | mkdir -p ${OUTPATH}/target
22 |
23 | cp control.sh ${OUTPATH}/
24 | cp src/main/resources/monitor.yaml ${OUTPATH}/conf/
25 | cp src/main/resources/logback.xml ${OUTPATH}/conf/
26 | cp target/carrera-monitor-1.0.0-SNAPSHOT-jar-with-dependencies.jar ${OUTPATH}/target
--------------------------------------------------------------------------------
/carrera-monitor/src/main/java/com/xiaojukeji/carrera/monitor/app/CarreraMonitor.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.monitor.app;
2 |
3 | import org.slf4j.Logger;
4 | import org.slf4j.LoggerFactory;
5 |
6 | public class CarreraMonitor {
7 |
8 | private static final Logger LOGGER = LoggerFactory.getLogger(CarreraMonitor.class);
9 |
10 | public static void main(String[] args) throws InterruptedException {
11 | LOGGER.info("Monitor start");
12 |
13 | if (args.length < 1) {
14 | LOGGER.error("param error");
15 | return;
16 | }
17 |
18 | MonitorApp app = new MonitorApp(args[0]);
19 | try {
20 | app.start();
21 | } catch (Exception e) {
22 | LOGGER.info("Monitor start error", e);
23 | }
24 |
25 | LOGGER.info("Monitor shutdown");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/carrera-monitor/src/main/java/com/xiaojukeji/carrera/monitor/utils/ConfigurationLoader.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.monitor.utils;
2 |
3 | import com.xiaojukeji.carrera.config.ConfigurationValidator;
4 | import org.yaml.snakeyaml.Yaml;
5 |
6 | import java.io.InputStream;
7 | import java.nio.file.Files;
8 | import java.nio.file.Paths;
9 |
10 | public class ConfigurationLoader {
11 | public static T newConfig(String configFile, Class clz) throws Exception {
12 | T config;
13 | Yaml yaml = new Yaml();
14 | try (InputStream in = Files.newInputStream(Paths.get(configFile))) {
15 | config = yaml.loadAs(in, clz);
16 | }
17 | if (!config.validate()) {
18 | throw new Exception("invalid config.");
19 | }
20 | return config;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/carrera-monitor/src/main/java/com/xiaojukeji/carrera/monitor/utils/Const.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.monitor.utils;
2 |
3 |
4 |
5 | public class Const {
6 |
7 | public static final String DEFAULT_INSPECTION_TOPIC = "inspection";
8 |
9 | public static final String DEFAULT_INSPECTION_GROUP = "cg_inspection";
10 | }
11 |
--------------------------------------------------------------------------------
/carrera-monitor/src/main/resources/monitor.yaml:
--------------------------------------------------------------------------------
1 | zookeeperAddr: 127.0.0.1:2181/carrera/v4/config
2 | broker: R_test
--------------------------------------------------------------------------------
/carrera-producer/.gitignore:
--------------------------------------------------------------------------------
1 | target/classes/**
2 | target/maven-archiver/**
3 | target/maven-status/**
4 | output/**
5 |
6 |
--------------------------------------------------------------------------------
/carrera-producer/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | BASEDIR=$(dirname "$0")
5 | cd ${BASEDIR}
6 | WKDIR=`pwd`
7 | cd ${BASEDIR}
8 |
9 | mvn -U clean assembly:assembly -Dmaven.test.skip=true
10 | ret=$?
11 | if [ $ret -ne 0 ];then
12 | echo "===== maven build failure ====="
13 | exit $ret
14 | else
15 | echo -n "===== maven build successfully! ====="
16 | fi
17 |
18 | OUTPATH=${WKDIR}/output
19 | mkdir -p ${OUTPATH}
20 | mkdir -p ${OUTPATH}/conf
21 | cp control.sh ${OUTPATH}/
22 | cp src/main/resources/carrera.yaml ${OUTPATH}/conf/
23 | cp src/main/resources/log4j2.xml ${OUTPATH}/conf/
24 | cp target/carrera-producer-1.0.0-SNAPSHOT-jar-with-dependencies.jar ${OUTPATH}/
--------------------------------------------------------------------------------
/carrera-producer/src/main/java/com/xiaojukeji/carrera/pproxy/constants/Constant.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.pproxy.constants;
2 |
3 |
4 | public class Constant {
5 |
6 | public static final int DEFAULT_MQ_SEND_TIMEOUT_MS = 5000;
7 |
8 | public static final int DEFAULT_MQ_ASYNC_REQUEST_TIMEOUT_MS = 10000;
9 |
10 | public static final long DEFAULT_MQ_SEND_RETRY_TIMEOUT_MS = 30;
11 |
12 | public static final int DEFAULT_MQ_SEND_RETRY_TIMES = 1;
13 |
14 | }
--------------------------------------------------------------------------------
/carrera-producer/src/main/java/com/xiaojukeji/carrera/pproxy/constants/TopicConfigValue.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.pproxy.constants;
2 |
3 |
4 | public class TopicConfigValue {
5 |
6 | public static final long LIMITER_FAILURE_RETRY_INTERVAL_MIN_MS = 10;
7 |
8 | public static final long LIMITER_FAILURE_RETRY_INTERVAL_MAX_MS = 100;
9 |
10 | }
--------------------------------------------------------------------------------
/carrera-producer/src/main/java/com/xiaojukeji/carrera/pproxy/producer/ClusterProducer.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.pproxy.producer;
2 |
3 |
4 | public interface ClusterProducer {
5 |
6 | void initProducer() throws Exception;
7 |
8 | void warmUp();
9 |
10 | void updateConfig() throws Exception;
11 |
12 | ProducerType getType();
13 |
14 | int getPartitionsSize(String topic);
15 |
16 | void send(CarreraRequest request) throws Exception;
17 |
18 | void shutdown();
19 |
20 | }
--------------------------------------------------------------------------------
/carrera-producer/src/main/java/com/xiaojukeji/carrera/pproxy/producer/ProducerType.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.pproxy.producer;
2 |
3 |
4 | public enum ProducerType {
5 | KAFKA, RMQ
6 | }
--------------------------------------------------------------------------------
/carrera-producer/src/main/java/com/xiaojukeji/carrera/pproxy/ratelimit/IGroupRequestLimiter.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.pproxy.ratelimit;
2 |
3 | import com.xiaojukeji.carrera.pproxy.producer.TopicConfigManager;
4 |
5 |
6 | public interface IGroupRequestLimiter {
7 |
8 | boolean tryEnter(String group);
9 |
10 | void updateConfig(TopicConfigManager config);
11 |
12 | void updateNodeConfig(double warningRatio, int totalLimit);
13 |
14 | void shutdown();
15 | }
--------------------------------------------------------------------------------
/carrera-producer/src/main/java/com/xiaojukeji/carrera/pproxy/server/Server.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.pproxy.server;
2 |
3 |
4 | public interface Server {
5 |
6 | void startServer();
7 |
8 | void stopServer();
9 | }
--------------------------------------------------------------------------------
/carrera-producer/src/main/java/com/xiaojukeji/carrera/pproxy/utils/ConfigConvertUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.pproxy.utils;
2 |
3 |
4 | public class ConfigConvertUtils {
5 |
6 | public static String addMarkForDelayTopic(String originName) {
7 | return originName + "_from_chronos";
8 | }
9 |
10 | }
--------------------------------------------------------------------------------
/carrera-producer/src/main/java/com/xiaojukeji/carrera/pproxy/utils/RandomUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.pproxy.utils;
2 |
3 | import org.apache.commons.collections4.CollectionUtils;
4 |
5 | import java.util.List;
6 | import java.util.Random;
7 |
8 |
9 | public class RandomUtils {
10 | private static final Random rand = new Random();
11 |
12 | public static int nextInt(int bound) {
13 | return rand.nextInt(bound);
14 | }
15 |
16 | public static T pick(List list) {
17 | if (CollectionUtils.isEmpty(list)) {
18 | return null;
19 | } else {
20 | return list.get(rand.nextInt(list.size()));
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/carrera-producer/src/main/java/com/xiaojukeji/carrera/pproxy/utils/RoundRobinPickerList.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.pproxy.utils;
2 |
3 |
4 | import java.util.ArrayList;
5 | import java.util.concurrent.atomic.AtomicInteger;
6 |
7 |
8 | public class RoundRobinPickerList extends ArrayList {
9 | private final AtomicInteger pickIdx = new AtomicInteger(0);
10 |
11 | public RoundRobinPickerList() {
12 | }
13 |
14 | public RoundRobinPickerList(int initialCapacity) {
15 | super(initialCapacity);
16 | }
17 |
18 | public E pick() {
19 | int idx = pickIdx.getAndIncrement();
20 | if (idx < 0) {
21 | pickIdx.set(0);
22 | }
23 |
24 | return get(idx % size());
25 | }
26 | }
--------------------------------------------------------------------------------
/carrera-producer/src/main/java/com/xiaojukeji/carrera/pproxy/utils/TimeUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.pproxy.utils;
2 |
3 |
4 | public class TimeUtils {
5 |
6 | public static long getCurTime() {
7 | return System.nanoTime();
8 | }
9 |
10 | public static double getElapseTime(long preTime) {
11 | return (System.nanoTime() - preTime) / 1000 / 1000.0;
12 | }
13 |
14 | public static long getElapseMicros(long preTime) {
15 | return (System.nanoTime() - preTime) / 1000;
16 | }
17 |
18 | public static long getElapseMills(long preTime) {
19 | return (System.nanoTime() - preTime) / 1000000;
20 | }
21 | }
--------------------------------------------------------------------------------
/carrera-producer/src/main/resources/carrera.yaml:
--------------------------------------------------------------------------------
1 | zookeeperAddr: 127.0.0.1:2181/carrera/v4/config # config zk cluster address here.
2 | host: 127.0.0.1 # local ip
3 | port: 9613 # thrift server port.
--------------------------------------------------------------------------------
/carrera-producer/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | log4j.rootLogger=info,INFO_LOG
2 | log4j.appender.INFO_LOG=org.apache.log4j.DailyRollingFileAppender
3 | log4j.appender.INFO_LOG.File=logs/log4j.log
4 | log4j.appender.INFO_LOG.Append=true
5 | log4j.appender.INFO_LOG.Threshold=INFO
6 | log4j.appender.INFO_LOG.layout=org.apache.log4j.PatternLayout
7 | log4j.appender.INFO_LOG.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [ %p ] %m%n
8 |
--------------------------------------------------------------------------------
/carrera-sdk/README.md:
--------------------------------------------------------------------------------
1 | **English** | [中文](./README_CN.md)
2 | ## DDMQ SDK ##
3 | DDMQ provides producer&consumer SDK in major programming languages. Since most of the logics and features are implemented in proxy side, SDK is relatively easy to implement.
4 |
5 | producer SDK:
6 |
7 | * Java
8 | * Go
9 | * PhP
10 | * C/C++
11 | * Python
12 |
13 | consumer SDK:
14 |
15 | * Java
16 | * Go
17 | * C/C++
18 |
19 |
--------------------------------------------------------------------------------
/carrera-sdk/README_CN.md:
--------------------------------------------------------------------------------
1 | [English](./README.md) | **中文**
2 | ## DDMQ SDK ##
3 | DDMQ 提供多语言的生产和消费 SDK,由于主要逻辑都集中在 producer proxy 和 consumer proxy 中,SDK 的逻辑比较简单。SDK 均提供 Demo 代码方便开发者接入和使用。具体提供的语言如下:
4 |
5 | producer SDK:
6 |
7 | * Java
8 | * Go
9 | * PhP
10 | * C/C++
11 | * Python
12 |
13 | consumer SDK:
14 |
15 | * Java
16 | * Go
17 | * C/C++
18 |
19 | *todo 待补充版本信息.*
20 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/CarreraDefine.h:
--------------------------------------------------------------------------------
1 | #ifndef CARRERA_RETURNCODE_H
2 | #define CARRERA_RETURNCODE_H
3 |
4 | #define CARRERA_VERSION "cpp.2.0"
5 |
6 | #define MAX_HOST_NAME_LEN 512
7 | #define MAX_CLIENT_ID_LEN 1024
8 |
9 | #define DEFAULT_LOGGER "default_consumer_logger"
10 | #define DEFAULT_LOG_FILE_MAX_SIZE (1024 * 1204 * 100) // 100M
11 | #define DEFAULT_LOG_FILE_NUM 10
12 |
13 | #define STATE_INIT 0
14 | #define STATE_START 1
15 | #define STATE_STOP 2
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/carreraServiceDiscovery_constants.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #include "carreraServiceDiscovery_constants.h"
8 |
9 | namespace CarreraServiceDiscovery {
10 |
11 | const carreraServiceDiscoveryConstants g_carreraServiceDiscovery_constants;
12 |
13 | carreraServiceDiscoveryConstants::carreraServiceDiscoveryConstants() {
14 | }
15 |
16 | } // namespace
17 |
18 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/carreraServiceDiscovery_constants.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #ifndef carreraServiceDiscovery_CONSTANTS_H
8 | #define carreraServiceDiscovery_CONSTANTS_H
9 |
10 | #include "carreraServiceDiscovery_types.h"
11 |
12 | namespace CarreraServiceDiscovery {
13 |
14 | class carreraServiceDiscoveryConstants {
15 | public:
16 | carreraServiceDiscoveryConstants();
17 |
18 | };
19 |
20 | extern const carreraServiceDiscoveryConstants g_carreraServiceDiscovery_constants;
21 |
22 | } // namespace
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_C.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_C.bin
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_CXX.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_CXX.bin
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.0/CMakeSystem.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_HOST_SYSTEM "Darwin-16.7.0")
2 | set(CMAKE_HOST_SYSTEM_NAME "Darwin")
3 | set(CMAKE_HOST_SYSTEM_VERSION "16.7.0")
4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
5 |
6 |
7 |
8 | set(CMAKE_SYSTEM "Darwin-16.7.0")
9 | set(CMAKE_SYSTEM_NAME "Darwin")
10 | set(CMAKE_SYSTEM_VERSION "16.7.0")
11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64")
12 |
13 | set(CMAKE_CROSSCOMPILING "FALSE")
14 |
15 | set(CMAKE_SYSTEM_LOADED 1)
16 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.0/CompilerIdC/a.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.0/CompilerIdC/a.out
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.0/CompilerIdCXX/a.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.0/CompilerIdCXX/a.out
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.1/CMakeDetermineCompilerABI_C.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.1/CMakeDetermineCompilerABI_C.bin
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.1/CMakeDetermineCompilerABI_CXX.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.1/CMakeDetermineCompilerABI_CXX.bin
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.1/CMakeSystem.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_HOST_SYSTEM "Darwin-17.7.0")
2 | set(CMAKE_HOST_SYSTEM_NAME "Darwin")
3 | set(CMAKE_HOST_SYSTEM_VERSION "17.7.0")
4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
5 |
6 |
7 |
8 | set(CMAKE_SYSTEM "Darwin-17.7.0")
9 | set(CMAKE_SYSTEM_NAME "Darwin")
10 | set(CMAKE_SYSTEM_VERSION "17.7.0")
11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64")
12 |
13 | set(CMAKE_CROSSCOMPILING "FALSE")
14 |
15 | set(CMAKE_SYSTEM_LOADED 1)
16 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.1/CompilerIdC/a.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.1/CompilerIdC/a.out
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.1/CompilerIdCXX/a.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.1/CompilerIdCXX/a.out
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_C.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_C.bin
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_CXX.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_CXX.bin
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.2/CMakeSystem.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_HOST_SYSTEM "Darwin-17.7.0")
2 | set(CMAKE_HOST_SYSTEM_NAME "Darwin")
3 | set(CMAKE_HOST_SYSTEM_VERSION "17.7.0")
4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
5 |
6 |
7 |
8 | set(CMAKE_SYSTEM "Darwin-17.7.0")
9 | set(CMAKE_SYSTEM_NAME "Darwin")
10 | set(CMAKE_SYSTEM_VERSION "17.7.0")
11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64")
12 |
13 | set(CMAKE_CROSSCOMPILING "FALSE")
14 |
15 | set(CMAKE_SYSTEM_LOADED 1)
16 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.2/CompilerIdC/a.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.2/CompilerIdC/a.out
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.2/CompilerIdCXX/a.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/3.12.2/CompilerIdCXX/a.out
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake:
--------------------------------------------------------------------------------
1 | # CMAKE generated file: DO NOT EDIT!
2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12
3 |
4 | # Relative path conversion top directories.
5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/zanglei/Developer/carrera-sdk/consumer/cpp/Consumer")
6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/zanglei/Developer/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug")
7 |
8 | # Force unix paths in dependencies.
9 | set(CMAKE_FORCE_UNIX_PATHS 1)
10 |
11 |
12 | # The C and CXX include file regular expressions for this directory.
13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
17 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/Consumer.dir/depend.make:
--------------------------------------------------------------------------------
1 | # Empty dependencies file for Consumer.
2 | # This may be replaced when dependencies are built.
3 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/Consumer.dir/link.txt:
--------------------------------------------------------------------------------
1 | /Library/Developer/CommandLineTools/usr/bin/c++ -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/opt/openssl/lib CMakeFiles/Consumer.dir/thirdparty/thrift/concurrency/StdMonitor.cpp.o CMakeFiles/Consumer.dir/thirdparty/thrift/concurrency/StdMutex.cpp.o CMakeFiles/Consumer.dir/thirdparty/thrift/concurrency/StdThreadFactory.cpp.o CMakeFiles/Consumer.dir/CarreraConsumer.cpp.o CMakeFiles/Consumer.dir/CarreraClientExample.cpp.o CMakeFiles/Consumer.dir/consumerProxy_constants.cpp.o CMakeFiles/Consumer.dir/consumerProxy_types.cpp.o CMakeFiles/Consumer.dir/ConsumerService.cpp.o CMakeFiles/Consumer.dir/mq_logger.cpp.o CMakeFiles/Consumer.dir/SimpleCarreraClient.cpp.o -o Consumer
2 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/Consumer.dir/progress.make:
--------------------------------------------------------------------------------
1 | CMAKE_PROGRESS_1 = 1
2 | CMAKE_PROGRESS_2 = 2
3 | CMAKE_PROGRESS_3 = 3
4 | CMAKE_PROGRESS_4 = 4
5 | CMAKE_PROGRESS_5 = 5
6 | CMAKE_PROGRESS_6 = 6
7 | CMAKE_PROGRESS_7 = 7
8 | CMAKE_PROGRESS_8 = 8
9 | CMAKE_PROGRESS_9 = 9
10 | CMAKE_PROGRESS_10 = 10
11 | CMAKE_PROGRESS_11 = 11
12 |
13 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/TargetDirectories.txt:
--------------------------------------------------------------------------------
1 | /Users/zanglei/Developer/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/rebuild_cache.dir
2 | /Users/zanglei/Developer/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/edit_cache.dir
3 | /Users/zanglei/Developer/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/Consumer.dir
4 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/clion-environment.txt:
--------------------------------------------------------------------------------
1 | Options:
2 |
3 | Options:
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/cmake.check_cache:
--------------------------------------------------------------------------------
1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file
2 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/feature_tests.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/feature_tests.bin
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/cmake-build-debug/CMakeFiles/progress.marks:
--------------------------------------------------------------------------------
1 | 11
2 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/consumerProxy_constants.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #include "consumerProxy_constants.h"
8 |
9 | namespace CarreraConsumer {
10 |
11 | const consumerProxyConstants g_consumerProxy_constants;
12 |
13 | consumerProxyConstants::consumerProxyConstants() {
14 | }
15 |
16 | } // namespace
17 |
18 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/consumerProxy_constants.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #ifndef consumerProxy_CONSTANTS_H
8 | #define consumerProxy_CONSTANTS_H
9 |
10 | #include "consumerProxy_types.h"
11 |
12 | namespace CarreraConsumer {
13 |
14 | class consumerProxyConstants {
15 | public:
16 | consumerProxyConstants();
17 |
18 | };
19 |
20 | extern const consumerProxyConstants g_consumerProxy_constants;
21 |
22 | } // namespace
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/mq_logger.h:
--------------------------------------------------------------------------------
1 | #ifndef LEGO_MQLogger_H_
2 | #define LEGO_MQLogger_H_
3 |
4 | #include
5 |
6 | namespace CarreraConsumer {
7 |
8 |
9 | typedef void (* LEGO_LOG_FUNC)(const char *);
10 |
11 |
12 | class MQLogger
13 | {
14 | public:
15 | MQLogger():func_(&DefaultOutputWrapper){}
16 |
17 | virtual ~MQLogger(){}
18 |
19 | void SetOutputFunction(LEGO_LOG_FUNC func);
20 |
21 | void Print(const char *message);
22 |
23 | void Printf(const char *message, ...);
24 |
25 | static void DefaultOutputWrapper(const char* msg);
26 |
27 | private:
28 | LEGO_LOG_FUNC func_;
29 | };
30 |
31 | extern MQLogger mq_logger;
32 |
33 | }
34 |
35 |
36 | #endif // LEGO_MQLogger_H_
37 |
38 |
39 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/thirdparty/carrera/consumerProxy_constants.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #ifndef consumerProxy_CONSTANTS_H
8 | #define consumerProxy_CONSTANTS_H
9 |
10 | #include "consumerProxy_types.h"
11 |
12 | namespace CarreraConsumer {
13 |
14 | class consumerProxyConstants {
15 | public:
16 | consumerProxyConstants();
17 |
18 | };
19 |
20 | extern const consumerProxyConstants g_consumerProxy_constants;
21 |
22 | } // namespace
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/thirdparty/carrera/mq_logger.h:
--------------------------------------------------------------------------------
1 | #ifndef LEGO_MQLogger_H_
2 | #define LEGO_MQLogger_H_
3 |
4 | #include
5 |
6 | namespace CarreraConsumer {
7 |
8 |
9 | typedef void (* LEGO_LOG_FUNC)(const char *);
10 |
11 |
12 | class MQLogger
13 | {
14 | public:
15 | MQLogger():func_(&DefaultOutputWrapper){}
16 |
17 | virtual ~MQLogger(){}
18 |
19 | void SetOutputFunction(LEGO_LOG_FUNC func);
20 |
21 | void Print(const char *message);
22 |
23 | void Printf(const char *message, ...);
24 |
25 | static void DefaultOutputWrapper(const char* msg);
26 |
27 | private:
28 | LEGO_LOG_FUNC func_;
29 | };
30 |
31 | extern MQLogger mq_logger;
32 |
33 | }
34 |
35 |
36 | #endif // LEGO_MQLogger_H_
37 |
38 |
39 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/thirdparty/spdlog/fmt/bundled/locale.h:
--------------------------------------------------------------------------------
1 | // Formatting library for C++ - locale support
2 | //
3 | // Copyright (c) 2012 - 2016, Victor Zverovich
4 | // All rights reserved.
5 | //
6 | // For the license information refer to format.h.
7 |
8 | #include "format.h"
9 | #include
10 |
11 | namespace fmt {
12 | class locale
13 | {
14 | private:
15 | std::locale locale_;
16 |
17 | public:
18 | explicit locale(std::locale loc = std::locale())
19 | : locale_(loc)
20 | {
21 | }
22 | std::locale get()
23 | {
24 | return locale_;
25 | }
26 | };
27 | } // namespace fmt
28 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/thirdparty/spdlog/fmt/fmt.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright(c) 2016-2018 Gabi Melman.
3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 | //
5 |
6 | #pragma once
7 |
8 | //
9 | // Include a bundled header-only copy of fmtlib or an external one.
10 | // By default spdlog include its own copy.
11 | //
12 |
13 | #if !defined(SPDLOG_FMT_EXTERNAL)
14 | #ifndef FMT_HEADER_ONLY
15 | #define FMT_HEADER_ONLY
16 | #endif
17 | #ifndef FMT_USE_WINDOWS_H
18 | #define FMT_USE_WINDOWS_H 0
19 | #endif
20 | #include "bundled/core.h"
21 | #include "bundled/format.h"
22 | #else // external fmtlib
23 | #include
24 | #include
25 | #endif
26 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/thirdparty/spdlog/fmt/ostr.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright(c) 2016 Gabi Melman.
3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 | //
5 |
6 | #pragma once
7 | //
8 | // include bundled or external copy of fmtlib's ostream support
9 | //
10 | #if !defined(SPDLOG_FMT_EXTERNAL)
11 | #ifndef FMT_HEADER_ONLY
12 | #define FMT_HEADER_ONLY
13 | #endif
14 | #include "bundled/ostream.h"
15 | #include "fmt.h"
16 | #else
17 | #include
18 | #endif
19 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/thirdparty/spdlog/formatter.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright(c) 2015 Gabi Melman.
3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 | //
5 |
6 | #pragma once
7 |
8 | #include "fmt/fmt.h"
9 | #include "spdlog/details/log_msg.h"
10 |
11 | namespace spdlog {
12 |
13 | class formatter
14 | {
15 | public:
16 | virtual ~formatter() = default;
17 | virtual void format(const details::log_msg &msg, fmt::memory_buffer &dest) = 0;
18 | virtual std::unique_ptr clone() const = 0;
19 | };
20 | } // namespace spdlog
21 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/thirdparty/spdlog/sinks/null_sink.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright(c) 2015 Gabi Melman.
3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 | //
5 |
6 | #pragma once
7 |
8 | #include "spdlog/details/null_mutex.h"
9 | #include "spdlog/sinks/base_sink.h"
10 |
11 | #include
12 |
13 | namespace spdlog {
14 | namespace sinks {
15 |
16 | template
17 | class null_sink : public base_sink
18 | {
19 | protected:
20 | void sink_it_(const details::log_msg &) override {}
21 | void flush_() override {}
22 | };
23 |
24 | using null_sink_mt = null_sink;
25 | using null_sink_st = null_sink;
26 |
27 | } // namespace sinks
28 | } // namespace spdlog
29 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/thirdparty/spdlog/version.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright(c) 2015 Gabi Melman.
3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 | //
5 |
6 | #pragma once
7 |
8 | #define SPDLOG_VER_MAJOR 1
9 | #define SPDLOG_VER_MINOR 1
10 | #define SPDLOG_VER_PATCH 0
11 |
12 | #define SPDLOG_VERSION (SPDLOG_VER_MAJOR * 10000 + SPDLOG_VER_MINOR * 100 + SPDLOG_VER_PATCH)
13 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/Consumer/thirdparty/thrift/BUILD:
--------------------------------------------------------------------------------
1 | # generated by genlibbuild
2 |
3 | cc_library(
4 | name = "thrift",
5 | deps = '#pthread',
6 | prebuilt=True
7 | )
8 |
9 | cc_library(
10 | name = "thriftnb",
11 | deps = [
12 | "#pthread",
13 | "//thirdparty/event2:event",
14 | "//thirdparty/event2:event_core",
15 | "//thirdparty/event2:event_pthreads",
16 | ],
17 | prebuilt=True
18 | )
19 |
20 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.12)
2 | project(LowlevelConsumer)
3 |
4 | set(CMAKE_CXX_STANDARD 14)
5 |
6 | include_directories(src)
7 |
8 | add_executable(LowlevelConsumer
9 | src/Consumer.cpp
10 | src/Consumer.h
11 | src/ConsumerConfig.cpp
12 | src/ConsumerConfig.h
13 | src/ConsumerLogger.cpp
14 | src/ConsumerLogger.h
15 | src/ConsumerPool.cpp
16 | src/ConsumerPool.h
17 | src/consumerProxy_constants.cpp
18 | src/consumerProxy_constants.h
19 | src/consumerProxy_types.cpp
20 | src/consumerProxy_types.h
21 | src/ConsumerService.cpp
22 | src/ConsumerService.h
23 | src/ConsumerWrapper.cpp
24 | src/consumerwrapper.h
25 | src/test_consumer.c
26 | src/test_consumer_pool.cpp)
27 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/README.md:
--------------------------------------------------------------------------------
1 | ## Dependency
2 |
3 | - log4cpp(1.1.3): logging utility library.
4 | - thrift(0.9.2): rpc utility library.
5 | - boost(1.64.0): refer to thrift install guide.
6 |
7 | ## Compile
8 |
9 | - Step 0: `make dep`
10 | - Step 1: `make`
11 | - Step 2: `sudo make install`
12 |
13 | ## Use case
14 |
15 | - Step0: Include corresponding header files in source file like `src/test_consumer_pool.cpp` or `src/test_consumer.c`
16 | - Step1: Compile with flags `-I/path/to/the/header/file -lconsumer`, refer to Makefile for details.
17 |
18 | Note: default.conf is the sample configuration for log4cpp.
19 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_C.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_C.bin
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_CXX.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/3.12.0/CMakeDetermineCompilerABI_CXX.bin
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/3.12.0/CMakeSystem.cmake:
--------------------------------------------------------------------------------
1 | set(CMAKE_HOST_SYSTEM "Darwin-16.7.0")
2 | set(CMAKE_HOST_SYSTEM_NAME "Darwin")
3 | set(CMAKE_HOST_SYSTEM_VERSION "16.7.0")
4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
5 |
6 |
7 |
8 | set(CMAKE_SYSTEM "Darwin-16.7.0")
9 | set(CMAKE_SYSTEM_NAME "Darwin")
10 | set(CMAKE_SYSTEM_VERSION "16.7.0")
11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64")
12 |
13 | set(CMAKE_CROSSCOMPILING "FALSE")
14 |
15 | set(CMAKE_SYSTEM_LOADED 1)
16 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/3.12.0/CompilerIdC/a.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/3.12.0/CompilerIdC/a.out
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/3.12.0/CompilerIdCXX/a.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/3.12.0/CompilerIdCXX/a.out
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake:
--------------------------------------------------------------------------------
1 | # CMAKE generated file: DO NOT EDIT!
2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12
3 |
4 | # Relative path conversion top directories.
5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/zanglei/Developer/carrera-sdk/consumer/cpp/LowlevelConsumer")
6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/zanglei/Developer/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug")
7 |
8 | # Force unix paths in dependencies.
9 | set(CMAKE_FORCE_UNIX_PATHS 1)
10 |
11 |
12 | # The C and CXX include file regular expressions for this directory.
13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
17 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/LowlevelConsumer.dir/depend.make:
--------------------------------------------------------------------------------
1 | # Empty dependencies file for LowlevelConsumer.
2 | # This may be replaced when dependencies are built.
3 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/LowlevelConsumer.dir/flags.make:
--------------------------------------------------------------------------------
1 | # CMAKE generated file: DO NOT EDIT!
2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12
3 |
4 | # compile C with /Library/Developer/CommandLineTools/usr/bin/cc
5 | # compile CXX with /Library/Developer/CommandLineTools/usr/bin/c++
6 | C_FLAGS = -g
7 |
8 | C_DEFINES =
9 |
10 | C_INCLUDES = -I/Users/zanglei/Developer/carrera-sdk/consumer/cpp/LowlevelConsumer/src
11 |
12 | CXX_FLAGS = -g -std=gnu++14
13 |
14 | CXX_DEFINES =
15 |
16 | CXX_INCLUDES = -I/Users/zanglei/Developer/carrera-sdk/consumer/cpp/LowlevelConsumer/src
17 |
18 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/LowlevelConsumer.dir/link.txt:
--------------------------------------------------------------------------------
1 | /Library/Developer/CommandLineTools/usr/bin/c++ -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/opt/openssl/lib CMakeFiles/LowlevelConsumer.dir/src/Consumer.cpp.o CMakeFiles/LowlevelConsumer.dir/src/ConsumerConfig.cpp.o CMakeFiles/LowlevelConsumer.dir/src/ConsumerLogger.cpp.o CMakeFiles/LowlevelConsumer.dir/src/ConsumerPool.cpp.o CMakeFiles/LowlevelConsumer.dir/src/consumerProxy_constants.cpp.o CMakeFiles/LowlevelConsumer.dir/src/consumerProxy_types.cpp.o CMakeFiles/LowlevelConsumer.dir/src/ConsumerService.cpp.o CMakeFiles/LowlevelConsumer.dir/src/ConsumerWrapper.cpp.o CMakeFiles/LowlevelConsumer.dir/src/test_consumer.c.o CMakeFiles/LowlevelConsumer.dir/src/test_consumer_pool.cpp.o -o LowlevelConsumer
2 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/LowlevelConsumer.dir/progress.make:
--------------------------------------------------------------------------------
1 | CMAKE_PROGRESS_1 = 1
2 | CMAKE_PROGRESS_2 = 2
3 | CMAKE_PROGRESS_3 = 3
4 | CMAKE_PROGRESS_4 = 4
5 | CMAKE_PROGRESS_5 = 5
6 | CMAKE_PROGRESS_6 = 6
7 | CMAKE_PROGRESS_7 = 7
8 | CMAKE_PROGRESS_8 = 8
9 | CMAKE_PROGRESS_9 = 9
10 | CMAKE_PROGRESS_10 = 10
11 | CMAKE_PROGRESS_11 = 11
12 |
13 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/TargetDirectories.txt:
--------------------------------------------------------------------------------
1 | /Users/zanglei/Developer/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/rebuild_cache.dir
2 | /Users/zanglei/Developer/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/edit_cache.dir
3 | /Users/zanglei/Developer/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/LowlevelConsumer.dir
4 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/clion-environment.txt:
--------------------------------------------------------------------------------
1 | Options:
2 |
3 | Options:
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/clion-log.txt:
--------------------------------------------------------------------------------
1 | /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/zanglei/Developer/carrera-sdk/consumer/cpp/LowlevelConsumer
2 | -- Configuring done
3 | -- Generating done
4 | -- Build files have been written to: /Users/zanglei/Developer/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug
5 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/cmake.check_cache:
--------------------------------------------------------------------------------
1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file
2 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/feature_tests.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/feature_tests.bin
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/cmake-build-debug/CMakeFiles/progress.marks:
--------------------------------------------------------------------------------
1 | 11
2 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/default_log.conf:
--------------------------------------------------------------------------------
1 | # set log level and appender
2 | log4cpp.rootCategory=DEBUG, logFileAppender
3 |
4 | # change log-file when log-file is large enough
5 | log4cpp.appender.logFileAppender=RollingFileAppender
6 |
7 | # max size of one log-file
8 | log4cpp.appender.logFileAppender.maxFileSize=400000
9 |
10 | # max num of log file
11 | log4cpp.appender.logFileAppender.maxBackupIndex=3
12 |
13 | # log-file name
14 | log4cpp.appender.logFileAppender.fileName=consumer.log
15 |
16 | # layout
17 | log4cpp.appender.logFileAppender.layout=PatternLayout
18 |
19 | log4cpp.appender.logFileAppender.append=false
20 | log4cpp.appender.logFileAppender.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S.%l} - [%p] : %m%n
21 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/src/ConsumerLogger.cpp:
--------------------------------------------------------------------------------
1 | #include "ConsumerLogger.h"
2 |
3 | #include
4 | #include
5 |
6 | namespace CarreraConsumer {
7 |
8 | // Logger initiation
9 |
10 | ConsumerLogger* ConsumerLogger::logger_ = NULL;
11 | ConsumerLogger::Helpler ConsumerLogger::helpler_;
12 | pthread_once_t ConsumerLogger::once_ = PTHREAD_ONCE_INIT;
13 | std::string ConsumerLogger::conf_file_;
14 |
15 | } // namespace CarreraConsumer
16 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/src/consumer.log:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/consumer/cpp/LowlevelConsumer/src/consumer.log
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/src/consumerProxy_constants.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #include "consumerProxy_constants.h"
8 |
9 | namespace CarreraConsumer {
10 |
11 | const consumerProxyConstants g_consumerProxy_constants;
12 |
13 | consumerProxyConstants::consumerProxyConstants() {
14 | }
15 |
16 | } // namespace
17 |
18 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/cpp/LowlevelConsumer/src/consumerProxy_constants.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #ifndef consumerProxy_CONSTANTS_H
8 | #define consumerProxy_CONSTANTS_H
9 |
10 | #include "consumerProxy_types.h"
11 |
12 | namespace CarreraConsumer {
13 |
14 | class consumerProxyConstants {
15 | public:
16 | consumerProxyConstants();
17 |
18 | };
19 |
20 | extern const consumerProxyConstants g_consumerProxy_constants;
21 |
22 | } // namespace
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/go/src/carrera/common/const.go:
--------------------------------------------------------------------------------
1 | package common
2 |
3 | const (
4 | CUR_SDK_VERSION = "newgo_sdk_2.0.3"
5 | )
6 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/go/src/carrera/consumer/CarreraConsumer/constants.go:
--------------------------------------------------------------------------------
1 | // Autogenerated by Thrift Compiler (0.9.2)
2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
3 |
4 | package CarreraConsumer
5 |
6 | import (
7 | "bytes"
8 | "fmt"
9 | "go.intra.xiaojukeji.com/golang/thrift-lib/0.9.2"
10 | )
11 |
12 | // (needed to ensure safety because of naive import list construction.)
13 | var _ = thrift.ZERO
14 | var _ = fmt.Printf
15 | var _ = bytes.Equal
16 |
17 | const PRESSURE_TRAFFIC_KEY = "isPressureTraffic"
18 | const PRESSURE_TRAFFIC_ENABLE = "true"
19 | const PRESSURE_TRAFFIC_DISABLE = "false"
20 | const TRACE_ID = "traceId"
21 | const SPAN_ID = "spanId"
22 |
23 | func init() {
24 | }
25 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/java/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | carrera-consumer-sdk/logs/
3 | carrera-consumer-sdk/target/
4 | carrera-consumer-sdk-examples/target/
5 | carrera-thrift-consumer-sdk/target/
6 | carrera-thrift-consumer-sdk-example/target/
7 | carrera-apache-storm/target/
--------------------------------------------------------------------------------
/carrera-sdk/consumer/java/carrera-consumer-sdk/src/main/java/com/xiaojukeji/carrera/consumer/thrift/client/BaseMessageProcessor.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.consumer.thrift.client;
2 |
3 |
4 | public interface BaseMessageProcessor {
5 | public enum Result {
6 | SUCCESS, // 表示消费成功,offset将会被持久化
7 | FAIL, // 表示消费失败,按照服务端的失败处理逻辑决定是否重新消费
8 | SKIP // 表示不将结果提交给服务端,按照服务端的超时处理逻辑决定是否重新消费
9 | }
10 | }
--------------------------------------------------------------------------------
/carrera-sdk/consumer/java/carrera-consumer-sdk/src/main/java/com/xiaojukeji/carrera/consumer/thrift/client/BatchMessageProcessor.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.consumer.thrift.client;
2 |
3 | import com.xiaojukeji.carrera.consumer.thrift.Context;
4 | import com.xiaojukeji.carrera.consumer.thrift.Message;
5 |
6 | import java.util.List;
7 | import java.util.Map;
8 |
9 |
10 | public interface BatchMessageProcessor extends BaseMessageProcessor {
11 | Map> process(List messages, Context context);
12 | }
--------------------------------------------------------------------------------
/carrera-sdk/consumer/java/carrera-consumer-sdk/src/main/java/com/xiaojukeji/carrera/consumer/thrift/client/MessageProcessor.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.consumer.thrift.client;
2 |
3 | import com.xiaojukeji.carrera.consumer.thrift.Context;
4 | import com.xiaojukeji.carrera.consumer.thrift.Message;
5 |
6 |
7 | public interface MessageProcessor extends BaseMessageProcessor {
8 | Result process(Message message, Context context);
9 | }
--------------------------------------------------------------------------------
/carrera-sdk/consumer/java/carrera-consumer-sdk/src/main/java/com/xiaojukeji/carrera/consumer/thrift/client/node/LocalNodeManager.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.consumer.thrift.client.node;
2 |
3 | import com.xiaojukeji.carrera.consumer.thrift.client.CarreraConfig;
4 |
5 | import java.util.ArrayList;
6 | import java.util.List;
7 |
8 |
9 | public class LocalNodeManager extends NodeManager {
10 | List nodes = new ArrayList<>();
11 |
12 | public LocalNodeManager(CarreraConfig config) {
13 | super(config);
14 | String[] servers = config.getServers().split(";");
15 | for (String server : servers) {
16 | nodes.add(new Node(server));
17 | }
18 | }
19 |
20 | @Override
21 | public List getNodes() {
22 | return nodes;
23 | }
24 | }
--------------------------------------------------------------------------------
/carrera-sdk/consumer/java/carrera-consumer-sdk/src/main/java/com/xiaojukeji/carrera/consumer/thrift/client/node/NodeUpdateInterface.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.consumer.thrift.client.node;
2 |
3 | import java.util.List;
4 |
5 |
6 | public interface NodeUpdateInterface {
7 | boolean updateNodes(List nodes) throws Exception;
8 | }
--------------------------------------------------------------------------------
/carrera-sdk/consumer/java/carrera-consumer-sdk/src/main/java/com/xiaojukeji/carrera/consumer/thrift/client/util/MessageUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.consumer.thrift.client.util;
2 |
3 | import com.xiaojukeji.carrera.consumer.thrift.Message;
4 | import com.xiaojukeji.carrera.consumer.thrift.consumerProxyConstants;
5 |
6 |
7 | public class MessageUtils {
8 |
9 | public static boolean isPressureTraffic(Message message) {
10 | if (message == null || message.getProperties() == null) {
11 | return false;
12 | }
13 |
14 | if (message.properties.containsKey(consumerProxyConstants.PRESSURE_TRAFFIC_KEY)) {
15 | return Boolean.valueOf(message.properties.get(consumerProxyConstants.PRESSURE_TRAFFIC_KEY));
16 | }
17 |
18 | return false;
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/carrera-sdk/consumer/java/carrera-consumer-sdk/src/main/resources/carrera_consumer_sdk_version.properties:
--------------------------------------------------------------------------------
1 | version=java_${project.version}
2 |
--------------------------------------------------------------------------------
/carrera-sdk/consumer/java/carrera-consumer-sdk/src/test/java/com/xiaojukeji/carrera/consumer/thrift/client/util/VersionUtilsTest.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.consumer.thrift.client.util;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.assertTrue;
6 |
7 |
8 | public class VersionUtilsTest {
9 | @Test
10 | public void getVersion() throws Exception {
11 | assertTrue(VersionUtils.getVersion().matches("java_([\\d.]+)([-]?)([\\w]*)"));
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/carreraServiceDiscovery_constants.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #include "carreraServiceDiscovery_constants.h"
8 |
9 | namespace CarreraServiceDiscovery {
10 |
11 | const carreraServiceDiscoveryConstants g_carreraServiceDiscovery_constants;
12 |
13 | carreraServiceDiscoveryConstants::carreraServiceDiscoveryConstants() {
14 | }
15 |
16 | } // namespace
17 |
18 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/carreraServiceDiscovery_constants.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #ifndef carreraServiceDiscovery_CONSTANTS_H
8 | #define carreraServiceDiscovery_CONSTANTS_H
9 |
10 | #include "carreraServiceDiscovery_types.h"
11 |
12 | namespace CarreraServiceDiscovery {
13 |
14 | class carreraServiceDiscoveryConstants {
15 | public:
16 | carreraServiceDiscoveryConstants();
17 |
18 | };
19 |
20 | extern const carreraServiceDiscoveryConstants g_carreraServiceDiscovery_constants;
21 |
22 | } // namespace
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/producerProxy_constants.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #include "producerProxy_constants.h"
8 |
9 | namespace CarreraProducer {
10 |
11 | const producerProxyConstants g_producerProxy_constants;
12 |
13 | producerProxyConstants::producerProxyConstants() {
14 | PRESSURE_TRAFFIC_KEY = "isPressureTraffic";
15 |
16 | PRESSURE_TRAFFIC_ENABLE = "true";
17 |
18 | PRESSURE_TRAFFIC_DISABLE = "false";
19 |
20 | TRACE_ID = "traceId";
21 |
22 | SPAN_ID = "spanId";
23 |
24 | CARRERA_HEADERS = "carrera_headers";
25 |
26 | DIDI_HEADER_RID = "didi-header-rid";
27 |
28 | DIDI_HEADER_SPANID = "didi-header-spanid";
29 |
30 | }
31 |
32 | } // namespace
33 |
34 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/producerProxy_constants.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #ifndef producerProxy_CONSTANTS_H
8 | #define producerProxy_CONSTANTS_H
9 |
10 | #include "producerProxy_types.h"
11 |
12 | namespace CarreraProducer {
13 |
14 | class producerProxyConstants {
15 | public:
16 | producerProxyConstants();
17 |
18 | std::string PRESSURE_TRAFFIC_KEY;
19 | std::string PRESSURE_TRAFFIC_ENABLE;
20 | std::string PRESSURE_TRAFFIC_DISABLE;
21 | std::string TRACE_ID;
22 | std::string SPAN_ID;
23 | std::string CARRERA_HEADERS;
24 | std::string DIDI_HEADER_RID;
25 | std::string DIDI_HEADER_SPANID;
26 | };
27 |
28 | extern const producerProxyConstants g_producerProxy_constants;
29 |
30 | } // namespace
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/carrera/carreraServiceDiscovery_constants.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #ifndef carreraServiceDiscovery_CONSTANTS_H
8 | #define carreraServiceDiscovery_CONSTANTS_H
9 |
10 | #include "carreraServiceDiscovery_types.h"
11 |
12 | namespace CarreraServiceDiscovery {
13 |
14 | class carreraServiceDiscoveryConstants {
15 | public:
16 | carreraServiceDiscoveryConstants();
17 |
18 | };
19 |
20 | extern const carreraServiceDiscoveryConstants g_carreraServiceDiscovery_constants;
21 |
22 | } // namespace
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/carrera/lib64_release/libcarrera.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/producer/cpp/Producer/thirdparty/carrera/lib64_release/libcarrera.a
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/carrera/producerProxy_constants.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Autogenerated by Thrift Compiler (0.9.2)
3 | *
4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | * @generated
6 | */
7 | #ifndef producerProxy_CONSTANTS_H
8 | #define producerProxy_CONSTANTS_H
9 |
10 | #include "producerProxy_types.h"
11 |
12 | namespace CarreraProducer {
13 |
14 | class producerProxyConstants {
15 | public:
16 | producerProxyConstants();
17 |
18 | std::string PRESSURE_TRAFFIC_KEY;
19 | std::string PRESSURE_TRAFFIC_ENABLE;
20 | std::string PRESSURE_TRAFFIC_DISABLE;
21 | std::string TRACE_ID;
22 | std::string SPAN_ID;
23 | std::string CARRERA_HEADERS;
24 | std::string DIDI_HEADER_RID;
25 | std::string DIDI_HEADER_SPANID;
26 | };
27 |
28 | extern const producerProxyConstants g_producerProxy_constants;
29 |
30 | } // namespace
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/curl/lib64_release/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/producer/cpp/Producer/thirdparty/curl/lib64_release/libcurl.a
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/curl/lib64_release/libcurl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/producer/cpp/Producer/thirdparty/curl/lib64_release/libcurl.so
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/curl/lib64_release/libcurl.so.4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/producer/cpp/Producer/thirdparty/curl/lib64_release/libcurl.so.4
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/curl/lib64_release/libcurl.so.4.3.0:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/producer/cpp/Producer/thirdparty/curl/lib64_release/libcurl.so.4.3.0
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/jsoncpp/json/autolink.h:
--------------------------------------------------------------------------------
1 | // Copyright 2007-2010 Baptiste Lepilleur
2 | // Distributed under MIT license, or public domain if desired and
3 | // recognized in your jurisdiction.
4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5 |
6 | #ifndef JSON_AUTOLINK_H_INCLUDED
7 | #define JSON_AUTOLINK_H_INCLUDED
8 |
9 | #include "config.h"
10 |
11 | #ifdef JSON_IN_CPPTL
12 | #include
13 | #endif
14 |
15 | #if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \
16 | !defined(JSON_IN_CPPTL)
17 | #define CPPTL_AUTOLINK_NAME "json"
18 | #undef CPPTL_AUTOLINK_DLL
19 | #ifdef JSON_DLL
20 | #define CPPTL_AUTOLINK_DLL
21 | #endif
22 | #include "autolink.h"
23 | #endif
24 |
25 | #endif // JSON_AUTOLINK_H_INCLUDED
26 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/jsoncpp/json/json.h:
--------------------------------------------------------------------------------
1 | // Copyright 2007-2010 Baptiste Lepilleur
2 | // Distributed under MIT license, or public domain if desired and
3 | // recognized in your jurisdiction.
4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5 |
6 | #ifndef JSON_JSON_H_INCLUDED
7 | #define JSON_JSON_H_INCLUDED
8 |
9 | #include "autolink.h"
10 | #include "value.h"
11 | #include "reader.h"
12 | #include "writer.h"
13 | #include "features.h"
14 |
15 | #endif // JSON_JSON_H_INCLUDED
16 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/jsoncpp/json/version.h:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT. This file is generated by CMake from "version"
2 | // and "version.h.in" files.
3 | // Run CMake configure step to update it.
4 | #ifndef JSON_VERSION_H_INCLUDED
5 | # define JSON_VERSION_H_INCLUDED
6 |
7 | # define JSONCPP_VERSION_STRING "1.6.0"
8 | # define JSONCPP_VERSION_MAJOR 1
9 | # define JSONCPP_VERSION_MINOR 6
10 | # define JSONCPP_VERSION_PATCH 0
11 | # define JSONCPP_VERSION_QUALIFIER
12 | # define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
13 |
14 | #endif // JSON_VERSION_H_INCLUDED
15 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/jsoncpp/json_sample.txt:
--------------------------------------------------------------------------------
1 | {
2 | "t1":"2",
3 | "t2":"3",
4 | "t3":"4",
5 | }
6 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/jsoncpp/makefile:
--------------------------------------------------------------------------------
1 |
2 |
3 | %.o:%.cpp
4 | g++ -Wall -c $?
5 |
6 | test_json:test_json.o
7 | g++ -o $@ $^ -L./build64_release -ljsoncpp
8 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/spdlog/fmt/bundled/locale.h:
--------------------------------------------------------------------------------
1 | // Formatting library for C++ - locale support
2 | //
3 | // Copyright (c) 2012 - 2016, Victor Zverovich
4 | // All rights reserved.
5 | //
6 | // For the license information refer to format.h.
7 |
8 | #include "format.h"
9 | #include
10 |
11 | namespace fmt {
12 | class locale
13 | {
14 | private:
15 | std::locale locale_;
16 |
17 | public:
18 | explicit locale(std::locale loc = std::locale())
19 | : locale_(loc)
20 | {
21 | }
22 | std::locale get()
23 | {
24 | return locale_;
25 | }
26 | };
27 | } // namespace fmt
28 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/spdlog/fmt/fmt.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright(c) 2016-2018 Gabi Melman.
3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 | //
5 |
6 | #pragma once
7 |
8 | //
9 | // Include a bundled header-only copy of fmtlib or an external one.
10 | // By default spdlog include its own copy.
11 | //
12 |
13 | #if !defined(SPDLOG_FMT_EXTERNAL)
14 | #ifndef FMT_HEADER_ONLY
15 | #define FMT_HEADER_ONLY
16 | #endif
17 | #ifndef FMT_USE_WINDOWS_H
18 | #define FMT_USE_WINDOWS_H 0
19 | #endif
20 | #include "bundled/core.h"
21 | #include "bundled/format.h"
22 | #else // external fmtlib
23 | #include
24 | #include
25 | #endif
26 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/spdlog/fmt/ostr.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright(c) 2016 Gabi Melman.
3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 | //
5 |
6 | #pragma once
7 | //
8 | // include bundled or external copy of fmtlib's ostream support
9 | //
10 | #if !defined(SPDLOG_FMT_EXTERNAL)
11 | #ifndef FMT_HEADER_ONLY
12 | #define FMT_HEADER_ONLY
13 | #endif
14 | #include "bundled/ostream.h"
15 | #include "fmt.h"
16 | #else
17 | #include
18 | #endif
19 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/spdlog/formatter.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright(c) 2015 Gabi Melman.
3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 | //
5 |
6 | #pragma once
7 |
8 | #include "fmt/fmt.h"
9 | #include "spdlog/details/log_msg.h"
10 |
11 | namespace spdlog {
12 |
13 | class formatter
14 | {
15 | public:
16 | virtual ~formatter() = default;
17 | virtual void format(const details::log_msg &msg, fmt::memory_buffer &dest) = 0;
18 | virtual std::unique_ptr clone() const = 0;
19 | };
20 | } // namespace spdlog
21 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/spdlog/sinks/null_sink.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright(c) 2015 Gabi Melman.
3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 | //
5 |
6 | #pragma once
7 |
8 | #include "spdlog/details/null_mutex.h"
9 | #include "spdlog/sinks/base_sink.h"
10 |
11 | #include
12 |
13 | namespace spdlog {
14 | namespace sinks {
15 |
16 | template
17 | class null_sink : public base_sink
18 | {
19 | protected:
20 | void sink_it_(const details::log_msg &) override {}
21 | void flush_() override {}
22 | };
23 |
24 | using null_sink_mt = null_sink;
25 | using null_sink_st = null_sink;
26 |
27 | } // namespace sinks
28 | } // namespace spdlog
29 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/spdlog/version.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright(c) 2015 Gabi Melman.
3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT)
4 | //
5 |
6 | #pragma once
7 |
8 | #define SPDLOG_VER_MAJOR 1
9 | #define SPDLOG_VER_MINOR 1
10 | #define SPDLOG_VER_PATCH 0
11 |
12 | #define SPDLOG_VERSION (SPDLOG_VER_MAJOR * 10000 + SPDLOG_VER_MINOR * 100 + SPDLOG_VER_PATCH)
13 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/thrift/BUILD:
--------------------------------------------------------------------------------
1 | # generated by genlibbuild
2 |
3 | cc_library(
4 | name = "thrift",
5 | deps = '#pthread',
6 | prebuilt=True
7 | )
8 |
9 | cc_library(
10 | name = "thriftnb",
11 | deps = [
12 | "#pthread",
13 | "//thirdparty/event2:event",
14 | "//thirdparty/event2:event_core",
15 | "//thirdparty/event2:event_pthreads",
16 | ],
17 | prebuilt=True
18 | )
19 |
20 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/cpp/Producer/thirdparty/thrift/t.go:
--------------------------------------------------------------------------------
1 | package main
2 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/.deploy/service.json:
--------------------------------------------------------------------------------
1 | {
2 | "cluster": "cluster",
3 | "service_name": "service_name"
4 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/CarreraProducer/constants.go:
--------------------------------------------------------------------------------
1 | // Autogenerated by Thrift Compiler (0.9.2)
2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
3 |
4 | package CarreraProducer
5 |
6 | import (
7 | "bytes"
8 | "fmt"
9 | "go.intra.xiaojukeji.com/golang/thrift-lib/0.9.2"
10 | )
11 |
12 | // (needed to ensure safety because of naive import list construction.)
13 | var _ = thrift.ZERO
14 | var _ = fmt.Printf
15 | var _ = bytes.Equal
16 |
17 | const PRESSURE_TRAFFIC_KEY = "isPressureTraffic"
18 | const PRESSURE_TRAFFIC_ENABLE = "true"
19 | const PRESSURE_TRAFFIC_DISABLE = "false"
20 | const TRACE_ID = "traceId"
21 | const SPAN_ID = "spanId"
22 | const CARRERA_HEADERS = "carrera_headers"
23 | const DIDI_HEADER_RID = "didi-header-rid"
24 | const DIDI_HEADER_SPANID = "didi-header-spanid"
25 |
26 | func init() {
27 | }
28 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/addTxMonitorMessageBuilder.go:
--------------------------------------------------------------------------------
1 | package carrera
2 |
3 | import "carrera/CarreraProducer"
4 |
5 | type AddTxMonitorMessageBuilder struct {
6 | addDelayMessageBuilder *AddDelayMessageBuilder
7 | }
8 |
9 | func NewAddTxMonitorMessageBuilder(addDelayMessageBuilder *AddDelayMessageBuilder) *AddTxMonitorMessageBuilder {
10 | return &AddTxMonitorMessageBuilder{addDelayMessageBuilder:addDelayMessageBuilder}
11 | }
12 |
13 | func (addTxMonitorMessageBuilder *AddTxMonitorMessageBuilder) Send() *CarreraProducer.DelayResult {
14 | return addTxMonitorMessageBuilder.addDelayMessageBuilder.Send()
15 | }
16 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/cancelTxMonitorMessageBuilder.go:
--------------------------------------------------------------------------------
1 | package carrera
2 |
3 | import "carrera/CarreraProducer"
4 |
5 | type CancelTxMonitorMessageBuilder struct {
6 | cancelDelayMessageBuilder *CancelDelayMessageBuilder
7 | }
8 |
9 | func NewCancelTxMonitorMessageBuilder(cancelDelayMessageBuilder *CancelDelayMessageBuilder) *CancelTxMonitorMessageBuilder {
10 | return &CancelTxMonitorMessageBuilder{cancelDelayMessageBuilder:cancelDelayMessageBuilder}
11 | }
12 |
13 | func (cancelTxMonitorMessageBuilder *CancelTxMonitorMessageBuilder) Send() *CarreraProducer.DelayResult {
14 | return cancelTxMonitorMessageBuilder.cancelDelayMessageBuilder.Send()
15 | }
16 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/carrera_dpool.go:
--------------------------------------------------------------------------------
1 | package carrera
2 |
3 | import (
4 | "time"
5 | "carrera/pool"
6 | "go.intra.xiaojukeji.com/golang/thrift-lib/0.9.2"
7 | "math"
8 | )
9 |
10 | func newCarreraDPool(servers []string, config *CarreraConfig) *pool.DPool {
11 | connFactory := &DPooledConnFactory{
12 | config: config,
13 | transportFactory: thrift.NewTFramedTransportFactory(thrift.NewTTransportFactory()),
14 | protocolFactory: thrift.NewTCompactProtocolFactory(),
15 | }
16 | poolConfig := pool.PoolConfig{
17 | MaxIdle: int(math.Ceil(float64(config.carreraPoolSize)/2)),
18 | MaxActive: config.carreraPoolSize,
19 | IdleTimeout: 300 * time.Second,
20 | MaxFails: 5,
21 | }
22 |
23 | return pool.NewDPool(servers, connFactory, poolConfig)
24 | }
25 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/common/const.go:
--------------------------------------------------------------------------------
1 | package common
2 |
3 | const (
4 | CUR_SDK_VERSION = "go_sdk_2.0.3"
5 | )
6 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/common/errinfo/error_info.go:
--------------------------------------------------------------------------------
1 | package errinfo
2 |
3 | import (
4 | "fmt"
5 | "strconv"
6 | )
7 |
8 | const (
9 | HTTP_ERROR = 400
10 | )
11 |
12 | type ErrorInfo struct {
13 | ErrNo int
14 | ErrMsg string
15 | }
16 |
17 | func (e *ErrorInfo) Error() string {
18 | return e.String()
19 | }
20 |
21 | func (e *ErrorInfo) String() string {
22 | if e == nil {
23 | return "[errno:-1, errmsg:nil]"
24 | }
25 | return "[errno:" + strconv.Itoa(e.ErrNo) + "errmsg:" + e.ErrMsg + "]"
26 | }
27 |
28 | func New(errno int, errmsg string) *ErrorInfo {
29 | return newError(errno, errmsg)
30 | }
31 |
32 | func Errorf(errno int, format string, a ...interface{}) *ErrorInfo {
33 | return newError(errno, fmt.Sprintf(format, a...))
34 | }
35 |
36 | func newError(errno int, errmsg string) *ErrorInfo {
37 | return &ErrorInfo{errno, errmsg}
38 | }
39 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/common/util/datetime_util.go:
--------------------------------------------------------------------------------
1 | package util
2 |
3 | import "time"
4 |
5 | func DateTimeToString(dateTime time.Time) (dateTimeStr string) {
6 | return dateTime.Format("2006-01-02 15:04:05")
7 | }
8 |
9 | func DateToString(dateTime time.Time) (dateStr string) {
10 | return dateTime.Format("2006-01-02")
11 | }
12 |
13 | func NowInS() int64 {
14 | return time.Now().Unix()
15 | }
16 |
17 | func NowInNs() int64 {
18 | return time.Now().UnixNano()
19 | }
20 |
21 | func NowInMs() int64 {
22 | return time.Now().UnixNano() / int64(time.Millisecond)
23 | }
24 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/common/util/randKey_util.go:
--------------------------------------------------------------------------------
1 | package util
2 |
3 | import (
4 | "go.intra.xiaojukeji.com/golang/go.uuid"
5 | )
6 |
7 | func GenRandKey() string {
8 | return uuid.NewV1().String()
9 | }
10 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/pool/pool_config.go:
--------------------------------------------------------------------------------
1 | package pool
2 | import (
3 | "time"
4 | )
5 |
6 | type PoolConfig struct {
7 | // Maximum idle connections per shard
8 | MaxIdle int
9 |
10 | // The maximum number of active connections that can be allocated from per pool shard at the same time.
11 | // The default value is 100
12 | MaxActive int
13 |
14 | // Timeout to evict idle connections
15 | IdleTimeout time.Duration
16 |
17 | // Test if connection broken on borrow
18 | // If set this flag, the "test" function should also provided.
19 | TestOnBorrow bool
20 |
21 | // Number of max fails threshold to triger health check
22 | MaxFails int
23 | }
24 |
25 | var DefaultPoolConfig = PoolConfig{
26 | MaxIdle: 50,
27 | MaxActive: 100,
28 | IdleTimeout: 300 * time.Second,
29 | MaxFails: 5,
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/pool/pooled_conn_factory.go:
--------------------------------------------------------------------------------
1 | package pool
2 |
3 | // This idea is borrowed from the famous Apache Commons Pool
4 | type PooledConnFactory interface {
5 | // Function to create a new pooled client for server @serverAddr
6 | Create(addr string) (Poolable, error)
7 |
8 | // testOnBorrow is an optional application supplied function for checking
9 | // the health of an idle connection before the connection is used again by
10 | // the application. Argument t is the time that the connection was returned
11 | // to the pool. If the function returns an error, then the connection is
12 | // closed.
13 | Validate(c Poolable) error
14 |
15 | // Function to destroy a connection
16 | Close(c Poolable) error
17 | }
18 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/carrera/txBusinessMessageBuilder.go:
--------------------------------------------------------------------------------
1 | package carrera
2 |
3 | import "carrera/CarreraProducer"
4 |
5 | type TxBusinessMessageBuilder struct {
6 | messageBuilder *MessageBuilder
7 | }
8 |
9 | func NewTxBusinessMessageBuilder(messageBuilder *MessageBuilder) *TxBusinessMessageBuilder {
10 | return &TxBusinessMessageBuilder{messageBuilder:messageBuilder}
11 | }
12 |
13 | func (txBusinessMessageBuilder *TxBusinessMessageBuilder) Send() *CarreraProducer.Result {
14 | return txBusinessMessageBuilder.messageBuilder.Send()
15 | }
16 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/.gitignore:
--------------------------------------------------------------------------------
1 | logrus
2 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - 1.3
4 | - 1.4
5 | - 1.5
6 | - 1.6
7 | - tip
8 | install:
9 | - go get -t ./...
10 | script: GOMAXPROCS=4 GORACE="halt_on_error=1" go test -race -v ./...
11 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
3 |
4 |
5 | The simplest way to use Logrus is simply the package-level exported logger:
6 |
7 | package main
8 |
9 | import (
10 | log "github.com/Sirupsen/logrus"
11 | )
12 |
13 | func main() {
14 | log.WithFields(log.Fields{
15 | "animal": "walrus",
16 | "number": 1,
17 | "size": 10,
18 | }).Info("A walrus appears")
19 | }
20 |
21 | Output:
22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10
23 |
24 | For a full guide visit https://github.com/Sirupsen/logrus
25 | */
26 | package logrus
27 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/hooks/syslog/syslog_test.go:
--------------------------------------------------------------------------------
1 | package logrus_syslog
2 |
3 | import (
4 | "github.com/Sirupsen/logrus"
5 | "log/syslog"
6 | "testing"
7 | )
8 |
9 | func TestLocalhostAddAndPrint(t *testing.T) {
10 | log := logrus.New()
11 | hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "")
12 |
13 | if err != nil {
14 | t.Errorf("Unable to connect to local syslog.")
15 | }
16 |
17 | log.Hooks.Add(hook)
18 |
19 | for _, level := range hook.Levels() {
20 | if len(log.Hooks[level]) != 1 {
21 | t.Errorf("SyslogHook was not added. The length of log.Hooks[%v]: %v", level, len(log.Hooks[level]))
22 | }
23 | }
24 |
25 | log.Info("Congratulations!")
26 | }
27 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/terminal_appengine.go:
--------------------------------------------------------------------------------
1 | // +build appengine
2 |
3 | package logrus
4 |
5 | // IsTerminal returns true if stderr's file descriptor is a terminal.
6 | func IsTerminal() bool {
7 | return true
8 | }
9 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/terminal_bsd.go:
--------------------------------------------------------------------------------
1 | // +build darwin freebsd openbsd netbsd dragonfly
2 | // +build !appengine
3 |
4 | package logrus
5 |
6 | import "syscall"
7 |
8 | const ioctlReadTermios = syscall.TIOCGETA
9 |
10 | type Termios syscall.Termios
11 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/terminal_linux.go:
--------------------------------------------------------------------------------
1 | // Based on ssh/terminal:
2 | // Copyright 2013 The Go Authors. All rights reserved.
3 | // Use of this source code is governed by a BSD-style
4 | // license that can be found in the LICENSE file.
5 |
6 | // +build !appengine
7 |
8 | package logrus
9 |
10 | import "syscall"
11 |
12 | const ioctlReadTermios = syscall.TCGETS
13 |
14 | type Termios syscall.Termios
15 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/terminal_notwindows.go:
--------------------------------------------------------------------------------
1 | // Based on ssh/terminal:
2 | // Copyright 2011 The Go Authors. All rights reserved.
3 | // Use of this source code is governed by a BSD-style
4 | // license that can be found in the LICENSE file.
5 |
6 | // +build linux darwin freebsd openbsd netbsd dragonfly
7 | // +build !appengine
8 |
9 | package logrus
10 |
11 | import (
12 | "syscall"
13 | "unsafe"
14 | )
15 |
16 | // IsTerminal returns true if stderr's file descriptor is a terminal.
17 | func IsTerminal() bool {
18 | fd := syscall.Stderr
19 | var termios Termios
20 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
21 | return err == 0
22 | }
23 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/terminal_solaris.go:
--------------------------------------------------------------------------------
1 | // +build solaris,!appengine
2 |
3 | package logrus
4 |
5 | import (
6 | "os"
7 |
8 | "golang.org/x/sys/unix"
9 | )
10 |
11 | // IsTerminal returns true if the given file descriptor is a terminal.
12 | func IsTerminal() bool {
13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA)
14 | return err == nil
15 | }
16 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/terminal_windows.go:
--------------------------------------------------------------------------------
1 | // Based on ssh/terminal:
2 | // Copyright 2011 The Go Authors. All rights reserved.
3 | // Use of this source code is governed by a BSD-style
4 | // license that can be found in the LICENSE file.
5 |
6 | // +build windows,!appengine
7 |
8 | package logrus
9 |
10 | import (
11 | "syscall"
12 | "unsafe"
13 | )
14 |
15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll")
16 |
17 | var (
18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode")
19 | )
20 |
21 | // IsTerminal returns true if stderr's file descriptor is a terminal.
22 | func IsTerminal() bool {
23 | fd := syscall.Stderr
24 | var st uint32
25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0)
26 | return r != 0 && e == 0
27 | }
28 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/logrus/vendor/vendor.json:
--------------------------------------------------------------------------------
1 | {
2 | "comment": "",
3 | "ignore": "test",
4 | "package": [],
5 | "rootPath": "go.intra.xiaojukeji.com/golang/logrus"
6 | }
7 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/lumberjack/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | _testmain.go
21 |
22 | *.exe
23 | *.test
24 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/lumberjack/chown.go:
--------------------------------------------------------------------------------
1 | // +build !linux
2 |
3 | package lumberjack
4 |
5 | import (
6 | "os"
7 | )
8 |
9 | func chown(_ string, _ os.FileInfo) error {
10 | return nil
11 | }
12 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/lumberjack/chown_linux.go:
--------------------------------------------------------------------------------
1 | package lumberjack
2 |
3 | import (
4 | "os"
5 | "syscall"
6 | )
7 |
8 | // os_Chown is a var so we can mock it out during tests.
9 | var os_Chown = os.Chown
10 |
11 | func chown(name string, info os.FileInfo) error {
12 | f, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, info.Mode())
13 | if err != nil {
14 | return err
15 | }
16 | f.Close()
17 | stat := info.Sys().(*syscall.Stat_t)
18 | return os_Chown(name, int(stat.Uid), int(stat.Gid))
19 | }
20 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/lumberjack/example_test.go:
--------------------------------------------------------------------------------
1 | package lumberjack_test
2 |
3 | import (
4 | "log"
5 |
6 | "gopkg.in/natefinch/lumberjack.v2"
7 | )
8 |
9 | // To use lumberjack with the standard library's log package, just pass it into
10 | // the SetOutput function when your application starts.
11 | func Example() {
12 | log.SetOutput(&lumberjack.Logger{
13 | Filename: "/var/log/myapp/foo.log",
14 | MaxSize: 500, // megabytes
15 | MaxBackups: 3,
16 | MaxAge: 28, // days
17 | })
18 | }
19 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/go/src/go.intra.xiaojukeji.com/golang/lumberjack/rotate_test.go:
--------------------------------------------------------------------------------
1 | // +build linux
2 |
3 | package lumberjack_test
4 |
5 | import (
6 | "log"
7 | "os"
8 | "os/signal"
9 | "syscall"
10 |
11 | "gopkg.in/natefinch/lumberjack.v2"
12 | )
13 |
14 | // Example of how to rotate in response to SIGHUP.
15 | func ExampleLogger_Rotate() {
16 | l := &lumberjack.Logger{}
17 | log.SetOutput(l)
18 | c := make(chan os.Signal, 1)
19 | signal.Notify(c, syscall.SIGHUP)
20 |
21 | go func() {
22 | for {
23 | <-c
24 | l.Rotate()
25 | }
26 | }()
27 | }
28 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/java/com/xiaojukeji/carrera/exception/CarreraException.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.exception;
2 |
3 |
4 | public class CarreraException extends Exception {
5 |
6 | public CarreraException(String message) {
7 | super(message);
8 | }
9 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/java/com/xiaojukeji/carrera/nodemgr/LocalNodeManager.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.nodemgr;
2 |
3 | import com.xiaojukeji.carrera.config.CarreraConfig;
4 |
5 | import java.util.List;
6 |
7 |
8 | public class LocalNodeManager extends NodeManager {
9 |
10 | public LocalNodeManager(CarreraConfig config, List hosts) {
11 | super(config);
12 | for (String host : hosts) {
13 | Node node = new Node(host);
14 | allNodesMap.put(node, new NodeInfo(host));
15 | healthyNodes.add(node);
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/java/com/xiaojukeji/carrera/producer/LocalCarreraProducer.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.producer;
2 |
3 | import com.xiaojukeji.carrera.config.CarreraConfig;
4 | import com.xiaojukeji.carrera.nodemgr.NodeManager;
5 |
6 |
7 | public class LocalCarreraProducer extends CarreraProducerBase implements ProducerInterface {
8 |
9 | public LocalCarreraProducer(CarreraConfig config) {
10 | super(config);
11 | }
12 |
13 | @Override
14 | protected void initNodeMgr() throws Exception {
15 | nodeMgr = NodeManager.newLocalNodeManager(config, config.getCarreraProxyList());
16 | nodeMgr.initConnectionPool();
17 | }
18 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/java/com/xiaojukeji/carrera/producer/tx/AddTxMonitorMessageBuilder.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.producer.tx;
2 |
3 | import com.xiaojukeji.carrera.producer.AddDelayMessageBuilder;
4 | import com.xiaojukeji.carrera.thrift.DelayResult;
5 |
6 |
7 | public class AddTxMonitorMessageBuilder {
8 |
9 | private AddDelayMessageBuilder addDelayMessageBuilder;
10 |
11 | public AddTxMonitorMessageBuilder(AddDelayMessageBuilder addDelayMessageBuilder) {
12 | this.addDelayMessageBuilder = addDelayMessageBuilder;
13 | }
14 |
15 | public DelayResult send() {
16 | return this.addDelayMessageBuilder.send();
17 | }
18 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/java/com/xiaojukeji/carrera/producer/tx/CancelTxMonitorMessageBuilder.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.producer.tx;
2 |
3 | import com.xiaojukeji.carrera.producer.CancelDelayMessageBuilder;
4 | import com.xiaojukeji.carrera.thrift.DelayResult;
5 |
6 |
7 | public class CancelTxMonitorMessageBuilder {
8 |
9 | private CancelDelayMessageBuilder cancelDelayMessageBuilder;
10 |
11 | public CancelTxMonitorMessageBuilder(CancelDelayMessageBuilder cancelDelayMessageBuilder) {
12 | this.cancelDelayMessageBuilder = cancelDelayMessageBuilder;
13 | }
14 |
15 | public DelayResult send() {
16 | return this.cancelDelayMessageBuilder.send();
17 | }
18 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/java/com/xiaojukeji/carrera/producer/tx/TxBusinessMessageBuilder.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.producer.tx;
2 |
3 | import com.xiaojukeji.carrera.producer.MessageBuilder;
4 | import com.xiaojukeji.carrera.thrift.Result;
5 |
6 |
7 | public class TxBusinessMessageBuilder {
8 |
9 | private MessageBuilder messageBuilder;
10 |
11 | public TxBusinessMessageBuilder(MessageBuilder messageBuilder) {
12 | this.messageBuilder = messageBuilder;
13 | }
14 |
15 | public Result send() {
16 | return this.messageBuilder.send();
17 | }
18 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/java/com/xiaojukeji/carrera/utils/ConstUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.utils;
2 |
3 |
4 | public class ConstUtils {
5 | public static final int PARTITION_HASH = -1;
6 | public static final int PARTITION_RAND = -2;
7 |
8 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/java/com/xiaojukeji/carrera/utils/FastJsonUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.utils;
2 |
3 | import com.alibaba.fastjson.JSON;
4 | import com.alibaba.fastjson.JSONObject;
5 | import com.alibaba.fastjson.TypeReference;
6 | import com.alibaba.fastjson.serializer.SerializerFeature;
7 |
8 |
9 | public class FastJsonUtils {
10 | public static String toJsonString(Object obj) {
11 | return JSONObject.toJSONString(obj, SerializerFeature.WriteDateUseDateFormat, SerializerFeature.WriteMapNullValue, SerializerFeature.DisableCircularReferenceDetect);
12 | }
13 |
14 | public static T parseObject(String json, TypeReference type){
15 | return JSON.parseObject(json, type);
16 | }
17 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/java/com/xiaojukeji/carrera/utils/RandomKeyUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.utils;
2 |
3 |
4 | import org.apache.commons.lang.RandomStringUtils;
5 |
6 |
7 | public class RandomKeyUtils {
8 | public static String randomKey(int keySize) {
9 | return RandomStringUtils.randomAlphanumeric(keySize);
10 | }
11 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/java/com/xiaojukeji/carrera/utils/TimeUtils.java:
--------------------------------------------------------------------------------
1 | package com.xiaojukeji.carrera.utils;
2 |
3 |
4 | public class TimeUtils {
5 | public static long getCurTime() {
6 | return System.currentTimeMillis();
7 | }
8 |
9 | public static long getElapseTime(long preTime) {
10 | return System.currentTimeMillis() - preTime;
11 | }
12 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/java/carrera-producer-sdk/src/main/resources/carrera_producer_sdk_version.properties:
--------------------------------------------------------------------------------
1 | version=java_${project.version}
--------------------------------------------------------------------------------
/carrera-sdk/producer/php/README.md:
--------------------------------------------------------------------------------
1 | php sdk已经合并在php-common中。
2 | 使用方式见:
3 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/php/config/development/config_carrera_cluster.php:
--------------------------------------------------------------------------------
1 | array('127.0.0.1:9613'),
6 | // time out for each send from proxy to mq broker
7 | 'CARRERA_PROXY_TIMEOUT' => 50,
8 | // retry times while sending failed from client to proxy
9 | 'CARRERA_CLIENT_RETRY' => 3,
10 | // time out for each send from client to proxy
11 | 'CARRERA_CLIENT_TIMEOUT' => 100,
12 | // log path
13 | 'CARRERA_CLIENT_LOGPATH' => '/home/xiaoju/webroot/log/mq/',
14 | );
--------------------------------------------------------------------------------
/carrera-sdk/producer/php/config/production/config_carrera_cluster.php:
--------------------------------------------------------------------------------
1 | array('127.0.0.1:9613'),
6 | // time out for each send from proxy to mq broker
7 | 'CARRERA_PROXY_TIMEOUT' => 50,
8 | // retry times while sending failed from client to proxy
9 | 'CARRERA_CLIENT_RETRY' => 3,
10 | // time out for each send from client to proxy
11 | 'CARRERA_CLIENT_TIMEOUT' => 100,
12 | // log path
13 | 'CARRERA_CLIENT_LOGPATH' => '/home/xiaoju/webroot/log/mq/',
14 | );
--------------------------------------------------------------------------------
/carrera-sdk/producer/php/controllers/test/testCarrera.php:
--------------------------------------------------------------------------------
1 | load->library('carrera/Carrera');
11 | $ret = $this->carrera->send('Test', 'Hello World', Carrera::PARTITION_RAND, 0);
12 | var_dump($ret);
13 | }
14 |
15 | }
--------------------------------------------------------------------------------
/carrera-sdk/producer/python/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
--------------------------------------------------------------------------------
/carrera-sdk/producer/python/carrera/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-sdk/producer/python/carrera/__init__.py
--------------------------------------------------------------------------------
/carrera-sdk/producer/python/carrera/producerProxy/__init__.py:
--------------------------------------------------------------------------------
1 | __all__ = ['ttypes', 'constants', 'ProducerService', 'CarreraProducer']
2 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/python/carrera/producerProxy/constants.py:
--------------------------------------------------------------------------------
1 | #
2 | # Autogenerated by Thrift Compiler (0.9.2)
3 | #
4 | # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 | #
6 | # options string: py
7 | #
8 |
9 | from thrift.Thrift import TType, TMessageType, TException, TApplicationException
10 | from ttypes import *
11 |
12 |
--------------------------------------------------------------------------------
/carrera-sdk/producer/python/demo.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | #carrera 使用 0.9.2 版本的thrift
5 | from thrift import Thrift
6 | from carrera.CarreraProducer import CarreraProducer;
7 |
8 | if __name__ == '__main__':
9 | try:
10 | producer = CarreraProducer(host='127.0.0.1', port=9613)
11 | # topic 需要提前在控制台申请
12 | ret = producer.send(topic="test", body="hello");
13 | # 生产结果最好打印到日志中,特别是ret.key,方便追查问题。
14 | if ret.code <= 1:
15 | print "send success, result=", ret
16 | else:
17 | # 生产失败之后,建议实现重试逻辑。
18 | print "send failed. result=", ret
19 | except Thrift.TException as tx:
20 | print('Thrift.TException %s' % tx.message)
21 | except:
22 | print('unknown excpetion')
23 |
24 |
25 |
--------------------------------------------------------------------------------
/image/arch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/arch.png
--------------------------------------------------------------------------------
/image/chronosArch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/chronosArch.png
--------------------------------------------------------------------------------
/image/consumeProgress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/consumeProgress.png
--------------------------------------------------------------------------------
/image/createGroup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/createGroup.png
--------------------------------------------------------------------------------
/image/createSub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/createSub.png
--------------------------------------------------------------------------------
/image/createTopic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/createTopic.png
--------------------------------------------------------------------------------
/image/dingGroup.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/dingGroup.jpg
--------------------------------------------------------------------------------
/image/groovy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/groovy.png
--------------------------------------------------------------------------------
/image/httpConsume.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/httpConsume.png
--------------------------------------------------------------------------------
/image/localDDMQ.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/localDDMQ.png
--------------------------------------------------------------------------------
/image/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/logo.png
--------------------------------------------------------------------------------
/image/resetOffset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/resetOffset.png
--------------------------------------------------------------------------------
/image/roleChange.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/roleChange.png
--------------------------------------------------------------------------------
/image/sampling.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/sampling.png
--------------------------------------------------------------------------------
/image/startSub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/startSub.png
--------------------------------------------------------------------------------
/image/transit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/transit.png
--------------------------------------------------------------------------------
/image/transitMsg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/transitMsg.png
--------------------------------------------------------------------------------
/image/wechatGroup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/image/wechatGroup.png
--------------------------------------------------------------------------------
/rocketmq/.gitignore:
--------------------------------------------------------------------------------
1 | *dependency-reduced-pom.xml
2 | .classpath
3 | .project
4 | .settings/
5 | target/
6 | devenv
7 | *.log*
8 | *.iml
9 | .idea/
10 | *.versionsBackup
11 | !NOTICE-BIN
12 | !LICENSE-BIN
13 | .DS_Store
14 | build-broker/output/*
--------------------------------------------------------------------------------
/rocketmq/NOTICE:
--------------------------------------------------------------------------------
1 | Apache RocketMQ
2 | Copyright 2016-2017 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
--------------------------------------------------------------------------------
/rocketmq/README.md:
--------------------------------------------------------------------------------
1 | ## rocketmq ##
2 |
3 | based on Apache RcoketMQ 4.2.0
4 |
5 |
6 | ### Deploy ###
7 |
8 | * namesvr
9 |
10 | > packaging: ```build-nameserver/build.sh```
11 |
12 | > running: ```build-nameserver/control.sh start```
13 | * broker
14 |
15 | > packaging: ```build-broker/build.sh```
16 |
17 | > running:```build-broker/control.sh start```
18 |
19 | ### Reference ###
20 | Apache RocketMQ deployment:
21 |
--------------------------------------------------------------------------------
/rocketmq/build-broker/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | BASEDIR=$(dirname "$0")
4 | CURDIR=`pwd`
5 | cd ${BASEDIR}/..
6 |
7 | mvn -Prelease-all -DskipTests clean install -U
8 | ret=$?
9 | if [ $ret -ne 0 ];then
10 | echo "===== maven build failure ====="
11 | exit $ret
12 | else
13 | echo -n "===== maven build successfully! ====="
14 | fi
15 |
16 | OUTPUT_PATH=${CURDIR}/output/
17 | mkdir -p ${OUTPUT_PATH}
18 | cp -r distribution/target/apache-rocketmq/* ${OUTPUT_PATH}
19 | cp ${CURDIR}/control.sh ${OUTPUT_PATH}/control.sh
20 |
21 |
--------------------------------------------------------------------------------
/rocketmq/build-nameserver/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | BASEDIR=$(dirname "$0")
4 | CURDIR=`pwd`
5 | cd ${BASEDIR}/..
6 |
7 | mvn -Prelease-all -DskipTests clean install -U
8 | ret=$?
9 | if [ $ret -ne 0 ];then
10 | echo "===== maven build failure ====="
11 | exit $ret
12 | else
13 | echo -n "===== maven build successfully! ====="
14 | fi
15 |
16 | OUTPUT_PATH=${CURDIR}/output/
17 | mkdir -p ${OUTPUT_PATH}
18 | cp -r distribution/target/apache-rocketmq/* ${OUTPUT_PATH}
19 | cp ${CURDIR}/control.sh ${OUTPUT_PATH}/control.sh
20 |
21 |
--------------------------------------------------------------------------------
/rocketmq/distribution/bin/runbroker:
--------------------------------------------------------------------------------
1 | @echo off
2 | rem Licensed to the Apache Software Foundation (ASF) under one or more
3 | rem contributor license agreements. See the NOTICE file distributed with
4 | rem this work for additional information regarding copyright ownership.
5 | rem The ASF licenses this file to You under the Apache License, Version 2.0
6 | rem (the "License"); you may not use this file except in compliance with
7 | rem the License. You may obtain a copy of the License at
8 | rem
9 | rem http://www.apache.org/licenses/LICENSE-2.0
10 | rem
11 | rem Unless required by applicable law or agreed to in writing, software
12 | rem distributed under the License is distributed on an "AS IS" BASIS,
13 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | rem See the License for the specific language governing permissions and
15 | rem limitations under the License.
16 |
--------------------------------------------------------------------------------