├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── README_CN.md ├── carrera-chronos ├── README.md ├── README_CN.md ├── build.sh ├── control.sh ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── xiaojukeji │ │ │ └── chronos │ │ │ ├── ChronosMain.java │ │ │ ├── ChronosStartup.java │ │ │ ├── autobatcher │ │ │ └── Batcher.java │ │ │ ├── benchmark │ │ │ ├── CancelDelaySend.java │ │ │ ├── DelayExpPush.java │ │ │ ├── DelayLoopPush.java │ │ │ ├── DelayPull.java │ │ │ ├── DelayPush.java │ │ │ ├── LeakyLimiter.java │ │ │ ├── LoopDelaySend.java │ │ │ └── config │ │ │ │ ├── BenchmarkConfig.java │ │ │ │ ├── PullConfig.java │ │ │ │ └── PushConfig.java │ │ │ ├── config │ │ │ ├── ChronosConfig.java │ │ │ ├── ConfigManager.java │ │ │ ├── DbConfig.java │ │ │ ├── DeleteConfig.java │ │ │ ├── PullConfig.java │ │ │ ├── PushConfig.java │ │ │ └── ZkConfig.java │ │ │ ├── db │ │ │ ├── BackupDB.java │ │ │ ├── CFManager.java │ │ │ ├── OptionsConfig.java │ │ │ └── RDB.java │ │ │ ├── enums │ │ │ ├── BackupState.java │ │ │ ├── CFHandlerNames.java │ │ │ ├── RestoreState.java │ │ │ └── ServerState.java │ │ │ ├── ha │ │ │ └── MasterElection.java │ │ │ ├── http │ │ │ ├── NettyHttpServer.java │ │ │ ├── NettyHttpServerHandler.java │ │ │ └── ServerInitializer.java │ │ │ ├── metrics │ │ │ ├── MetricMsgAction.java │ │ │ ├── MetricMsgToOrFrom.java │ │ │ ├── MetricMsgType.java │ │ │ ├── MetricPullMsgResult.java │ │ │ ├── MetricPushMsgResult.java │ │ │ ├── MetricService.java │ │ │ └── MetricWriteMsgResult.java │ │ │ ├── model │ │ │ ├── CancelWrap.java │ │ │ ├── InternalPair.java │ │ │ └── InternalValue.java │ │ │ ├── services │ │ │ ├── MetaService.java │ │ │ ├── MqConsumeStatService.java │ │ │ ├── MqPullService.java │ │ │ └── MqPushService.java │ │ │ ├── utils │ │ │ ├── ByteUtils.java │ │ │ ├── CloseUtils.java │ │ │ ├── Constants.java │ │ │ ├── FileIOUtils.java │ │ │ ├── JsonUtils.java │ │ │ ├── KeyUtils.java │ │ │ ├── LogUtils.java │ │ │ ├── TsUtils.java │ │ │ └── ZkUtils.java │ │ │ └── workers │ │ │ ├── DeleteBgWorker.java │ │ │ ├── PullWorker.java │ │ │ └── PushWorker.java │ └── resources │ │ ├── chronos.yaml │ │ ├── log4j2.xml │ │ ├── test-chronos00.yaml │ │ └── test-chronos01.yaml │ └── test │ ├── java │ └── com │ │ └── xiaoju │ │ └── chronos │ │ ├── TestPullService.java │ │ ├── TestPushWorker.java │ │ ├── backup │ │ └── BackupEngineTest.java │ │ ├── db │ │ └── TestDB.java │ │ ├── mq │ │ ├── TestPullDelayMsg.java │ │ ├── TestPushDelayMsg.java │ │ └── TestPushRTMsg.java │ │ └── other │ │ └── TestOther.java │ └── resources │ └── log4j2-test.xml ├── carrera-common ├── README.md ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── xiaojukeji │ └── carrera │ ├── biz │ ├── ProxyService.java │ ├── ZkService.java │ └── ZkServiceImpl.java │ ├── chronos │ ├── constants │ │ └── Constant.java │ ├── enums │ │ ├── Actions.java │ │ └── MsgTypes.java │ └── model │ │ ├── BodyExt.java │ │ └── InternalKey.java │ ├── config │ ├── Actions.java │ ├── AppendContext.java │ ├── CompressType.java │ ├── ConfigConstants.java │ ├── ConfigurationValidator.java │ └── v4 │ │ ├── BrokerConfig.java │ │ ├── CProxyConfig.java │ │ ├── GroupConfig.java │ │ ├── PProxyConfig.java │ │ ├── TopicConfig.java │ │ ├── cproxy │ │ ├── ConsumeServerConfiguration.java │ │ ├── HBaseConfiguration.java │ │ ├── HdfsConfiguration.java │ │ ├── KafkaConfiguration.java │ │ ├── MQServerConfiguration.java │ │ ├── RedisConfiguration.java │ │ ├── RocketMQBaseConfig.java │ │ ├── RocketmqConfiguration.java │ │ ├── UpstreamTopic.java │ │ └── hbase │ │ │ ├── HBaseColumnInfo.java │ │ │ ├── HBaseTableConfig.java │ │ │ └── HBaseTableInfo.java │ │ └── pproxy │ │ ├── BatchMQProducerConfiguration.java │ │ ├── CarreraConfiguration.java │ │ ├── DelayConfiguration.java │ │ ├── KafkaConfiguration.java │ │ ├── RocketmqConfiguration.java │ │ ├── ThriftServerConfiguration.java │ │ ├── TopicConfiguration.java │ │ └── TopicInfoConfiguration.java │ ├── dynamic │ ├── ParameterDynamicConfig.java │ ├── ParameterDynamicZookeeper.java │ └── zk │ │ ├── IZkDataListener.java │ │ ├── ZkClient.java │ │ └── ZkEventThread.java │ ├── metric │ ├── CounterMetric.java │ ├── ErrorMetrics.java │ ├── Metric.java │ ├── MetricBuffer.java │ ├── MetricClient.java │ ├── MetricFactory.java │ ├── MetricKey.java │ ├── MetricReporter.java │ ├── PercentileMetric.java │ ├── RateMetric.java │ └── RecycleArray.java │ ├── thrift │ ├── DelayMessage.java │ ├── DelayMeta.java │ ├── DelayResult.java │ ├── Message.java │ ├── ProducerService.java │ ├── RestMessage.java │ ├── Result.java │ ├── consumer │ │ ├── AckResult.java │ │ ├── ConsumeResult.java │ │ ├── ConsumeStats.java │ │ ├── ConsumeStatsRequest.java │ │ ├── ConsumerService.java │ │ ├── Context.java │ │ ├── FetchRequest.java │ │ ├── FetchResponse.java │ │ ├── Message.java │ │ ├── PullException.java │ │ ├── PullRequest.java │ │ ├── PullResponse.java │ │ ├── QidResponse.java │ │ └── consumerProxyConstants.java │ └── producerProxyConstants.java │ └── utils │ ├── CommonFastJsonUtils.java │ ├── CommonUtils.java │ ├── ConfigUtils.java │ ├── GroovyUtils.java │ ├── HttpUtils.java │ └── PropertyUtils.java ├── carrera-console ├── README.md ├── README_CN.md ├── USAGE.md ├── build.sh ├── carrera-console-fe │ ├── .eslintignore │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── README_CN.md │ ├── build.sh │ ├── build │ │ ├── utils.js │ │ ├── webpack.base.config.js │ │ ├── webpack.dev.config.js │ │ └── webpack.prod.config.js │ ├── index.html │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app.vue │ │ ├── components │ │ │ ├── filter-input-searcher │ │ │ │ └── index.vue │ │ │ ├── grid │ │ │ │ ├── col.vue │ │ │ │ └── row.vue │ │ │ ├── header │ │ │ │ └── index.vue │ │ │ ├── index.js │ │ │ ├── main │ │ │ │ ├── index.js │ │ │ │ └── main.vue │ │ │ └── sidebar │ │ │ │ └── index.vue │ │ ├── eventbus.js │ │ ├── main.js │ │ ├── mixins │ │ │ ├── apis │ │ │ │ ├── group.js │ │ │ │ ├── login.js │ │ │ │ ├── subscribe.js │ │ │ │ └── topic.js │ │ │ ├── common.js │ │ │ ├── constant.js │ │ │ ├── dict.js │ │ │ ├── request.js │ │ │ └── table.js │ │ ├── pages │ │ │ ├── group │ │ │ │ ├── consume.vue │ │ │ │ ├── index.vue │ │ │ │ └── modals │ │ │ │ │ ├── consume-manage.vue │ │ │ │ │ ├── create.vue │ │ │ │ │ └── manage.vue │ │ │ ├── introduce.vue │ │ │ ├── login │ │ │ │ └── index.vue │ │ │ ├── subscribe │ │ │ │ ├── index.vue │ │ │ │ └── modals │ │ │ │ │ ├── create.vue │ │ │ │ │ ├── detail.vue │ │ │ │ │ └── manage.vue │ │ │ └── topic │ │ │ │ ├── detail.vue │ │ │ │ ├── index.vue │ │ │ │ └── modals │ │ │ │ ├── create.vue │ │ │ │ ├── group.vue │ │ │ │ ├── message.vue │ │ │ │ ├── send-message.vue │ │ │ │ └── statistics.vue │ │ ├── router │ │ │ ├── group.js │ │ │ ├── index.js │ │ │ ├── subscribe.js │ │ │ └── topic.js │ │ ├── schemas │ │ │ ├── group.js │ │ │ ├── subscribe.js │ │ │ └── topic.js │ │ ├── styles │ │ │ ├── detail.less │ │ │ ├── drawer.less │ │ │ ├── form.less │ │ │ ├── index.less │ │ │ ├── modal.less │ │ │ └── style.less │ │ ├── ui-core │ │ │ ├── components │ │ │ │ ├── alert │ │ │ │ │ ├── alert.vue │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.md │ │ │ │ ├── autocomplete │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ ├── index.vue │ │ │ │ │ └── option.vue │ │ │ │ ├── base-drop │ │ │ │ │ ├── base-drop.vue │ │ │ │ │ └── index.js │ │ │ │ ├── breadcrumb │ │ │ │ │ ├── breadcrumb-item.vue │ │ │ │ │ ├── breadcrumb.vue │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.md │ │ │ │ ├── button │ │ │ │ │ ├── button-group.vue │ │ │ │ │ ├── button.vue │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.md │ │ │ │ ├── card │ │ │ │ │ ├── card.vue │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.md │ │ │ │ ├── checkbox │ │ │ │ │ ├── checkbox-group.vue │ │ │ │ │ ├── checkbox.vue │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.md │ │ │ │ ├── drawer │ │ │ │ │ ├── drawer.vue │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.md │ │ │ │ ├── dropdown │ │ │ │ │ ├── drop.vue │ │ │ │ │ ├── dropdown-item.vue │ │ │ │ │ ├── dropdown-menu.vue │ │ │ │ │ ├── dropdown.vue │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.md │ │ │ │ ├── form │ │ │ │ │ ├── form-item.vue │ │ │ │ │ ├── form.vue │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.md │ │ │ │ ├── grid │ │ │ │ │ ├── col.vue │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ └── row.vue │ │ │ │ ├── icon │ │ │ │ │ ├── icon.vue │ │ │ │ │ └── index.js │ │ │ │ ├── input │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ └── input.vue │ │ │ │ ├── loading │ │ │ │ │ ├── directive.js │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.md │ │ │ │ ├── menu │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ ├── menu-group.vue │ │ │ │ │ ├── menu-item.vue │ │ │ │ │ ├── menu.vue │ │ │ │ │ └── submenu.vue │ │ │ │ ├── message │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.md │ │ │ │ ├── modal │ │ │ │ │ ├── confirm.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ └── modal.vue │ │ │ │ ├── notice │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.md │ │ │ │ ├── notification │ │ │ │ │ ├── index.js │ │ │ │ │ ├── notice.vue │ │ │ │ │ └── notification.vue │ │ │ │ ├── pagination │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ ├── options.vue │ │ │ │ │ └── pagination.vue │ │ │ │ ├── popover │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.less │ │ │ │ │ ├── index.md │ │ │ │ │ ├── index.vue │ │ │ │ │ └── popover-drop.vue │ │ │ │ ├── progress │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ └── index.vue │ │ │ │ ├── radio │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ ├── radio-group.vue │ │ │ │ │ └── radio.vue │ │ │ │ ├── render-cell │ │ │ │ │ └── index.js │ │ │ │ ├── select │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ ├── option-group.vue │ │ │ │ │ ├── option.vue │ │ │ │ │ └── select.vue │ │ │ │ ├── steps │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ ├── steps-item.vue │ │ │ │ │ └── steps.vue │ │ │ │ ├── switch │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ └── switch.vue │ │ │ │ ├── tab │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ ├── tab-pane.vue │ │ │ │ │ └── tab.vue │ │ │ │ ├── table │ │ │ │ │ ├── README.md │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ ├── lib │ │ │ │ │ │ ├── index.css │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── package.json │ │ │ │ │ ├── src │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ ├── checkbox.vue │ │ │ │ │ │ │ ├── custom-render │ │ │ │ │ │ │ │ ├── table-cell.vue │ │ │ │ │ │ │ │ ├── table-expand-row.vue │ │ │ │ │ │ │ │ └── table-th-label.vue │ │ │ │ │ │ │ ├── expand-row.vue │ │ │ │ │ │ │ ├── pagination.css │ │ │ │ │ │ │ ├── pagination.vue │ │ │ │ │ │ │ ├── table-colunm.vue │ │ │ │ │ │ │ ├── table.vue │ │ │ │ │ │ │ └── tableCell.js │ │ │ │ │ │ ├── images │ │ │ │ │ │ │ ├── bg.jpg │ │ │ │ │ │ │ ├── logo@1x.png │ │ │ │ │ │ │ └── logo@2x.png │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── mixins │ │ │ │ │ │ │ └── sort.js │ │ │ │ │ │ ├── styles │ │ │ │ │ │ │ ├── table.less │ │ │ │ │ │ │ └── variables.less │ │ │ │ │ │ └── utils │ │ │ │ │ │ │ └── tools.js │ │ │ │ │ └── webpack.config.js │ │ │ │ ├── tag │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.md │ │ │ │ │ └── tag.vue │ │ │ │ ├── tooltip │ │ │ │ │ ├── index.js │ │ │ │ │ ├── index.less │ │ │ │ │ ├── index.md │ │ │ │ │ └── tooltip.vue │ │ │ │ └── tree │ │ │ │ │ ├── index.js │ │ │ │ │ ├── tree-node.vue │ │ │ │ │ └── tree.vue │ │ │ ├── directives │ │ │ │ ├── auto-focus.js │ │ │ │ ├── clickoutside.js │ │ │ │ └── transfer-dom.js │ │ │ ├── index.js │ │ │ ├── mixins │ │ │ │ ├── emitter.js │ │ │ │ └── popper.js │ │ │ ├── styles │ │ │ │ ├── animation │ │ │ │ │ ├── ease.less │ │ │ │ │ ├── fade.less │ │ │ │ │ ├── index.less │ │ │ │ │ ├── move.less │ │ │ │ │ └── slide.less │ │ │ │ ├── common │ │ │ │ │ ├── base.less │ │ │ │ │ ├── index.less │ │ │ │ │ ├── mixins.less │ │ │ │ │ ├── normalize.less │ │ │ │ │ └── variables.less │ │ │ │ ├── components │ │ │ │ │ ├── _grid.less │ │ │ │ │ ├── alert.less │ │ │ │ │ ├── breadcrumb.less │ │ │ │ │ ├── button.less │ │ │ │ │ ├── card.less │ │ │ │ │ ├── checkbox.less │ │ │ │ │ ├── dropdown.less │ │ │ │ │ ├── form.less │ │ │ │ │ ├── grid.less │ │ │ │ │ ├── icon.less │ │ │ │ │ ├── input.less │ │ │ │ │ ├── loading.less │ │ │ │ │ ├── menu.less │ │ │ │ │ ├── message.less │ │ │ │ │ ├── modal.less │ │ │ │ │ ├── notice.less │ │ │ │ │ ├── pagination.less │ │ │ │ │ ├── popover.less │ │ │ │ │ ├── progress.less │ │ │ │ │ ├── radio.less │ │ │ │ │ ├── select.less │ │ │ │ │ ├── steps.less │ │ │ │ │ ├── switch.less │ │ │ │ │ ├── tab.less │ │ │ │ │ ├── table.less │ │ │ │ │ ├── tag.less │ │ │ │ │ ├── tooltip.less │ │ │ │ │ └── tree.less │ │ │ │ ├── index.less │ │ │ │ └── mixins │ │ │ │ │ ├── index.less │ │ │ │ │ └── size.less │ │ │ └── utils │ │ │ │ └── tools.js │ │ └── utils │ │ │ ├── cookies.js │ │ │ ├── index.js │ │ │ └── login.js │ └── static │ │ ├── .gitkeep │ │ ├── ddmq-logo.svg │ │ ├── favicon.ico │ │ ├── iconfont │ │ ├── demo.css │ │ ├── demo_fontclass.html │ │ ├── demo_symbol.html │ │ ├── demo_unicode.html │ │ ├── iconfont.css │ │ ├── iconfont.eot │ │ ├── iconfont.js │ │ ├── iconfont.svg │ │ ├── iconfont.ttf │ │ └── iconfont.woff │ │ └── logo-with-text.png ├── carrera-console │ ├── .gitignore │ ├── pom.xml │ ├── setting │ │ └── carrera-console-dev.properties │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── didi │ │ │ └── carrera │ │ │ └── console │ │ │ ├── common │ │ │ ├── offset │ │ │ │ └── RocketMQProduceOffsetFetcher.java │ │ │ └── util │ │ │ │ ├── CacheLockUtils.java │ │ │ │ ├── CodecsUtils.java │ │ │ │ ├── FastJsonUtils.java │ │ │ │ ├── HostUtils.java │ │ │ │ └── LogUtils.java │ │ │ ├── config │ │ │ └── ConsoleConfig.java │ │ │ ├── dao │ │ │ ├── BaseMapper.java │ │ │ ├── DaoUtil.java │ │ │ ├── MybatisInterceptor.java │ │ │ ├── dict │ │ │ │ ├── ClusterMqServerRelationType.java │ │ │ │ ├── ConsumeSubscriptionAlarmType.java │ │ │ │ ├── ConsumeSubscriptionApiType.java │ │ │ │ ├── ConsumeSubscriptionBigDataType.java │ │ │ │ ├── ConsumeSubscriptionConsumeType.java │ │ │ │ ├── ConsumeSubscriptionHttpMethod.java │ │ │ │ ├── ConsumeSubscriptionMsgPushType.java │ │ │ │ ├── ConsumeSubscriptionMsgType.java │ │ │ │ ├── ConsumeSubscriptionPressureTraffic.java │ │ │ │ ├── IsDelete.java │ │ │ │ ├── IsEnable.java │ │ │ │ ├── MqServerType.java │ │ │ │ ├── NodeType.java │ │ │ │ ├── TopicCompressionType.java │ │ │ │ ├── TopicDelayTopic.java │ │ │ │ └── TopicProduceMode.java │ │ │ ├── mapper │ │ │ │ ├── ClusterMapper.java │ │ │ │ ├── ClusterMqserverRelationMapper.java │ │ │ │ ├── ConsumeGroupMapper.java │ │ │ │ ├── ConsumeSubscriptionMapper.java │ │ │ │ ├── IdcMapper.java │ │ │ │ ├── MqServerMapper.java │ │ │ │ ├── NodeMapper.java │ │ │ │ ├── TopicConfMapper.java │ │ │ │ ├── TopicMapper.java │ │ │ │ └── custom │ │ │ │ │ ├── ConsumeGroupCustomMapper.java │ │ │ │ │ ├── ConsumeSubscriptionCustomMapper.java │ │ │ │ │ ├── TopicConfCustomMapper.java │ │ │ │ │ └── TopicCustomMapper.java │ │ │ └── model │ │ │ │ ├── Cluster.java │ │ │ │ ├── ClusterCriteria.java │ │ │ │ ├── ClusterMqserverRelation.java │ │ │ │ ├── ClusterMqserverRelationCriteria.java │ │ │ │ ├── ConsumeGroup.java │ │ │ │ ├── ConsumeGroupCriteria.java │ │ │ │ ├── ConsumeSubscription.java │ │ │ │ ├── ConsumeSubscriptionCriteria.java │ │ │ │ ├── Idc.java │ │ │ │ ├── IdcCriteria.java │ │ │ │ ├── MqServer.java │ │ │ │ ├── MqServerCriteria.java │ │ │ │ ├── Node.java │ │ │ │ ├── NodeCriteria.java │ │ │ │ ├── Topic.java │ │ │ │ ├── TopicConf.java │ │ │ │ ├── TopicConfCriteria.java │ │ │ │ ├── TopicCriteria.java │ │ │ │ └── custom │ │ │ │ ├── ConsumeGroupConfig.java │ │ │ │ ├── ConsumeSubscriptionConfig.java │ │ │ │ ├── CustomConsumeSubscription.java │ │ │ │ ├── CustomSubscriptionStateCount.java │ │ │ │ ├── CustomTopicConf.java │ │ │ │ ├── TopicConfConfig.java │ │ │ │ └── TopicConfig.java │ │ │ ├── data │ │ │ └── Message.java │ │ │ ├── service │ │ │ ├── ClusterMqserverRelationService.java │ │ │ ├── ClusterService.java │ │ │ ├── ConsumeGroupService.java │ │ │ ├── ConsumeSubscriptionService.java │ │ │ ├── MqServerService.java │ │ │ ├── NodeService.java │ │ │ ├── OffsetManagerService.java │ │ │ ├── RmqAdminService.java │ │ │ ├── TopicConfService.java │ │ │ ├── TopicService.java │ │ │ ├── ZKV4ConfigService.java │ │ │ ├── bean │ │ │ │ └── PageModel.java │ │ │ ├── exception │ │ │ │ ├── ConvertDataException.java │ │ │ │ ├── MqException.java │ │ │ │ └── ZkConfigException.java │ │ │ ├── impl │ │ │ │ ├── ClusterMqserverRelationServiceImpl.java │ │ │ │ ├── ClusterServiceImpl.java │ │ │ │ ├── ConsumeGroupServiceImpl.java │ │ │ │ ├── ConsumeSubscriptionServiceImpl.java │ │ │ │ ├── MqServerServiceImpl.java │ │ │ │ ├── NodeServiceImpl.java │ │ │ │ ├── OffsetManagerServiceImpl.java │ │ │ │ ├── RmqAdminServiceImpl.java │ │ │ │ ├── TopicConfServiceImpl.java │ │ │ │ ├── TopicServiceImpl.java │ │ │ │ └── ZKV4ConfigServiceImpl.java │ │ │ └── vo │ │ │ │ ├── ConsumeGroupSearchItemVo.java │ │ │ │ ├── ConsumeGroupVo.java │ │ │ │ ├── GroupConsumeStateVo.java │ │ │ │ ├── SearchItemVo.java │ │ │ │ ├── SubscriptionOrderListVo.java │ │ │ │ ├── TopicConfVo.java │ │ │ │ ├── TopicListGroupVo.java │ │ │ │ ├── TopicMessageVo.java │ │ │ │ ├── TopicOrderVo.java │ │ │ │ ├── TopicSimpleVo.java │ │ │ │ └── TopicStateVo.java │ │ │ └── web │ │ │ ├── AbstractBaseController.java │ │ │ ├── ConsoleBaseResponse.java │ │ │ ├── controller │ │ │ ├── LoginInterceptor.java │ │ │ ├── bo │ │ │ │ ├── AcceptTopicConfBo.java │ │ │ │ ├── BaseBo.java │ │ │ │ ├── BaseOrderBo.java │ │ │ │ ├── ConsumeGroupBo.java │ │ │ │ ├── ConsumeGroupResetOffsetBo.java │ │ │ │ ├── ConsumeSubscriptionBaseBo.java │ │ │ │ ├── ConsumeSubscriptionOrderBo.java │ │ │ │ ├── MqServerBo.java │ │ │ │ ├── NodeBo.java │ │ │ │ ├── TopicConfBo.java │ │ │ │ └── TopicOrderBo.java │ │ │ ├── console │ │ │ │ ├── ConsumeGroupController.java │ │ │ │ ├── ConsumeSubscriptionController.java │ │ │ │ └── TopicController.java │ │ │ ├── odin │ │ │ │ └── InternalController.java │ │ │ └── validator │ │ │ │ ├── AnotherFieldEqualsSpecifiedValue.java │ │ │ │ └── AnotherFieldEqualsSpecifiedValueValidator.java │ │ │ ├── filter │ │ │ ├── ConsoleExceptionFilter.java │ │ │ ├── JsonMessageConverter.java │ │ │ └── RequestContext.java │ │ │ └── util │ │ │ ├── CookieUtil.java │ │ │ ├── DateTimePropertyEditor.java │ │ │ ├── DateUtil.java │ │ │ ├── RemoteSource.java │ │ │ ├── RequestUtil.java │ │ │ └── StringPropertyEditor.java │ │ ├── resources │ │ ├── console.yaml │ │ ├── jdbc.properties │ │ ├── logback.xml │ │ ├── spring │ │ │ ├── mybatis-config.xml │ │ │ ├── spring-dispatcher-servlet.xml │ │ │ ├── spring-mybatis-ddmq.xml │ │ │ └── spring.xml │ │ └── sqlmap │ │ │ └── ddmq │ │ │ ├── ClusterMapper.xml │ │ │ ├── ClusterMqserverRelationMapper.xml │ │ │ ├── ConsumeGroupCustomMapper.xml │ │ │ ├── ConsumeGroupMapper.xml │ │ │ ├── ConsumeSubscriptionCustomMapper.xml │ │ │ ├── ConsumeSubscriptionMapper.xml │ │ │ ├── IdcMapper.xml │ │ │ ├── MqServerMapper.xml │ │ │ ├── NodeMapper.xml │ │ │ ├── TopicConfCustomMapper.xml │ │ │ ├── TopicConfMapper.xml │ │ │ ├── TopicCustomMapper.xml │ │ │ └── TopicMapper.xml │ │ └── webapp │ │ ├── 1.index.css │ │ ├── WEB-INF │ │ └── web.xml │ │ ├── ddmq-logo.svg │ │ ├── favicon.ico │ │ ├── iconfont │ │ ├── demo.css │ │ ├── demo_fontclass.html │ │ ├── demo_symbol.html │ │ ├── demo_unicode.html │ │ ├── iconfont.css │ │ ├── iconfont.eot │ │ ├── iconfont.js │ │ ├── iconfont.svg │ │ ├── iconfont.ttf │ │ └── iconfont.woff │ │ ├── index.css │ │ ├── index.html │ │ ├── index.js │ │ ├── logo-with-text.png │ │ └── vendors.js ├── control.sh ├── ddl │ └── ddmq_init.sql └── version ├── carrera-consumer ├── .gitignore ├── README.md ├── README_CN.md ├── build.sh ├── control.sh ├── idl │ └── consumerProxy.thrift ├── pom.xml └── src │ └── main │ ├── java │ ├── com │ │ └── xiaojukeji │ │ │ └── carrera │ │ │ └── cproxy │ │ │ ├── actions │ │ │ ├── Action.java │ │ │ ├── ActionBuilder.java │ │ │ ├── AsyncAction.java │ │ │ ├── AsyncHttpAction.java │ │ │ ├── FormParamsExtractAction.java │ │ │ ├── FormParamsExtractAction2.java │ │ │ ├── GroovyScriptAction.java │ │ │ ├── HBaseAction.java │ │ │ ├── HDFSAction.java │ │ │ ├── JsonAction.java │ │ │ ├── NonBlockAsyncAction.java │ │ │ ├── OrderAction.java │ │ │ ├── PullServerBufferAction.java │ │ │ ├── QueryParamsExtractAction.java │ │ │ ├── RedisAction.java │ │ │ ├── TransitAction.java │ │ │ ├── groovy │ │ │ │ └── GroovyContext.java │ │ │ ├── hbase │ │ │ │ ├── HbaseCommand.java │ │ │ │ └── HbaseConst.java │ │ │ ├── hdfs │ │ │ │ ├── DataDir.java │ │ │ │ ├── DataFile.java │ │ │ │ ├── DataFileManager.java │ │ │ │ ├── HDFSWriter.java │ │ │ │ └── SequenceDataFile.java │ │ │ ├── http │ │ │ │ ├── CarreraAsyncRequest.java │ │ │ │ ├── HttpParam.java │ │ │ │ └── PushService.java │ │ │ ├── redis │ │ │ │ ├── RedisCommand.java │ │ │ │ ├── RedisDelete.java │ │ │ │ ├── RedisHdel.java │ │ │ │ ├── RedisHmset.java │ │ │ │ ├── RedisHset.java │ │ │ │ ├── RedisMset.java │ │ │ │ └── RedisSet.java │ │ │ └── util │ │ │ │ ├── PullBuffer.java │ │ │ │ ├── UpstreamGroupJobBuffer.java │ │ │ │ ├── UpstreamJobBlockingQueue.java │ │ │ │ ├── UpstreamJobBuffer.java │ │ │ │ └── UpstreamJobExecutorPool.java │ │ │ ├── concurrent │ │ │ ├── CarreraExecutors.java │ │ │ └── CarreraScheduledExecutorService.java │ │ │ ├── config │ │ │ ├── ConsumeProxyConfiguration.java │ │ │ ├── ConsumerGroupConfig.java │ │ │ ├── LocalModeConfig.java │ │ │ └── ProducerProxyConfiguration.java │ │ │ ├── consumer │ │ │ ├── AbstractCarreraRocketMqConsumer.java │ │ │ ├── BaseCarreraConsumer.java │ │ │ ├── CProxyServiceImpl.java │ │ │ ├── CarreraConsumer.java │ │ │ ├── CarreraKafkaConsumer.java │ │ │ ├── CarreraNewRocketMqConsumer.java │ │ │ ├── CarreraRocketMqConsumer.java │ │ │ ├── CommonMessage.java │ │ │ ├── ConfigManager.java │ │ │ ├── ConsumeContext.java │ │ │ ├── ConsumerGroupManager.java │ │ │ ├── ConsumerManager.java │ │ │ ├── LowLevelCarreraConsumer.java │ │ │ ├── LowLevelKafkaConsumer.java │ │ │ ├── ResultCallBack.java │ │ │ ├── RmqCidMaker.java │ │ │ ├── SharedThreadPool.java │ │ │ ├── UpstreamJob.java │ │ │ ├── exception │ │ │ │ └── CarreraClientException.java │ │ │ ├── handler │ │ │ │ └── AsyncMessageHandler.java │ │ │ ├── limiter │ │ │ │ ├── CapacityLimiter.java │ │ │ │ ├── HttpRateLimiter.java │ │ │ │ ├── ILimiter.java │ │ │ │ ├── LimiterMgr.java │ │ │ │ └── RateLimiter.java │ │ │ ├── lowlevel │ │ │ │ ├── AbstractTpsLimitedFetcher.java │ │ │ │ ├── CarreraQueue.java │ │ │ │ ├── Fetcher.java │ │ │ │ ├── KafkaFetcher.java │ │ │ │ ├── LowLevelMessage.java │ │ │ │ └── RmqFetcher.java │ │ │ └── offset │ │ │ │ ├── CarreraOffsetManager.java │ │ │ │ ├── CommitLagLimiter.java │ │ │ │ ├── ConsumeOffsetTracker.java │ │ │ │ ├── KafkaProduceOffsetFetcher.java │ │ │ │ ├── OffsetTrackSnapshot.java │ │ │ │ ├── OffsetTracker.java │ │ │ │ └── RocketMQProduceOffsetFetcher.java │ │ │ ├── metric │ │ │ ├── GroupMetrics.java │ │ │ ├── MutilGroupMetrics.java │ │ │ └── SingleGroupMetrics.java │ │ │ ├── proxy │ │ │ ├── ConsumerProxyMain.java │ │ │ └── ProxyApp.java │ │ │ ├── server │ │ │ ├── AbstractLowlevelRequestChain.java │ │ │ ├── AckChain.java │ │ │ ├── ConsumeServer.java │ │ │ ├── ConsumerServiceImpl.java │ │ │ ├── DelayRequest.java │ │ │ ├── FetchChain.java │ │ │ └── PullStats.java │ │ │ └── utils │ │ │ ├── CommonUtils.java │ │ │ ├── ConfigUtils.java │ │ │ ├── JsonUtils.java │ │ │ ├── LogUtils.java │ │ │ ├── MetricUtils.java │ │ │ ├── MixAll.java │ │ │ ├── PropertyUtils.java │ │ │ ├── QidUtils.java │ │ │ ├── StringUtils.java │ │ │ └── TimeUtils.java │ └── org │ │ └── apache │ │ └── thrift │ │ └── server │ │ └── ThriftContext.java │ └── resources │ ├── carrera.yaml │ ├── log4j.properties │ └── log4j2.xml ├── carrera-docker ├── .gitignore ├── Dockerfile ├── README.md ├── README_CN.md ├── broker │ ├── LICENSE │ ├── NOTICE │ ├── bin │ │ ├── README.md │ │ ├── cachedog.sh │ │ ├── cleancache.sh │ │ ├── cleancache.v1.sh │ │ ├── mqadmin │ │ ├── mqadmin.cmd │ │ ├── mqadmin.xml │ │ ├── mqbroker │ │ ├── mqbroker.cmd │ │ ├── mqbroker.numanode0 │ │ ├── mqbroker.numanode1 │ │ ├── mqbroker.numanode2 │ │ ├── mqbroker.numanode3 │ │ ├── mqbroker.xml │ │ ├── mqfiltersrv │ │ ├── mqfiltersrv.cmd │ │ ├── mqfiltersrv.xml │ │ ├── mqnamesrv │ │ ├── mqnamesrv.cmd │ │ ├── mqnamesrv.xml │ │ ├── mqshutdown │ │ ├── mqshutdown.cmd │ │ ├── os.sh │ │ ├── play.cmd │ │ ├── play.sh │ │ ├── runbroker │ │ ├── runbroker.cmd │ │ ├── runbroker.sh │ │ ├── runserver.cmd │ │ ├── runserver.sh │ │ ├── setcache.sh │ │ ├── startfsrv.sh │ │ ├── tools.cmd │ │ └── tools.sh │ ├── conf │ │ ├── 2m-2s-async │ │ │ ├── broker-a-s.properties │ │ │ ├── broker-a.properties │ │ │ ├── broker-b-s.properties │ │ │ └── broker-b.properties │ │ ├── 2m-2s-sync │ │ │ ├── broker-a-s.properties │ │ │ ├── broker-a.properties │ │ │ ├── broker-b-s.properties │ │ │ └── broker-b.properties │ │ ├── 2m-noslave │ │ │ ├── broker-a.properties │ │ │ └── broker-b.properties │ │ ├── broker.properties │ │ ├── logback_broker.xml │ │ ├── logback_filtersrv.xml │ │ ├── logback_namesrv.xml │ │ └── logback_tools.xml │ ├── control.sh │ └── lib │ │ ├── commons-cli-1.2.jar │ │ ├── commons-lang3-3.4.jar │ │ ├── fastjson-1.2.29.jar │ │ ├── guava-19.0.jar │ │ ├── javassist-3.20.0-GA.jar │ │ ├── jna-4.2.2.jar │ │ ├── logback-classic-1.0.13.jar │ │ ├── logback-core-1.0.13.jar │ │ ├── netty-all-4.0.42.Final.jar │ │ ├── netty-tcnative-1.1.33.Fork22-osx-x86_64.jar │ │ ├── openmessaging-api-0.1.0-alpha.jar │ │ ├── rocketmq-broker-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-client-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-common-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-example-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-filter-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-filtersrv-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-namesrv-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-openmessaging-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-remoting-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-srvutil-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-store-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-tools-4.2.1-SNAPSHOT.jar │ │ └── slf4j-api-1.7.7.jar ├── build.sh ├── chronos │ ├── conf │ │ ├── chronos.yaml │ │ ├── log4j2.xml │ │ ├── test-chronos00.yaml │ │ └── test-chronos01.yaml │ └── control.sh ├── console │ └── control.sh ├── consumer │ ├── conf │ │ ├── carrera.yaml │ │ └── log4j2.xml │ └── control.sh ├── mysql │ ├── Dockerfile │ └── ddmq.sql ├── namesvr │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── bin │ │ ├── README.md │ │ ├── cachedog.sh │ │ ├── cleancache.sh │ │ ├── cleancache.v1.sh │ │ ├── mqadmin │ │ ├── mqadmin.cmd │ │ ├── mqadmin.xml │ │ ├── mqbroker │ │ ├── mqbroker.cmd │ │ ├── mqbroker.numanode0 │ │ ├── mqbroker.numanode1 │ │ ├── mqbroker.numanode2 │ │ ├── mqbroker.numanode3 │ │ ├── mqbroker.xml │ │ ├── mqfiltersrv │ │ ├── mqfiltersrv.cmd │ │ ├── mqfiltersrv.xml │ │ ├── mqnamesrv │ │ ├── mqnamesrv.cmd │ │ ├── mqnamesrv.xml │ │ ├── mqshutdown │ │ ├── mqshutdown.cmd │ │ ├── os.sh │ │ ├── play.cmd │ │ ├── play.sh │ │ ├── runbroker │ │ ├── runbroker.cmd │ │ ├── runbroker.sh │ │ ├── runserver.cmd │ │ ├── runserver.sh │ │ ├── setcache.sh │ │ ├── startfsrv.sh │ │ ├── tools.cmd │ │ └── tools.sh │ ├── conf │ │ ├── 2m-2s-async │ │ │ ├── broker-a-s.properties │ │ │ ├── broker-a.properties │ │ │ ├── broker-b-s.properties │ │ │ └── broker-b.properties │ │ ├── 2m-2s-sync │ │ │ ├── broker-a-s.properties │ │ │ ├── broker-a.properties │ │ │ ├── broker-b-s.properties │ │ │ └── broker-b.properties │ │ ├── 2m-noslave │ │ │ ├── broker-a.properties │ │ │ └── broker-b.properties │ │ ├── broker.properties │ │ ├── logback_broker.xml │ │ ├── logback_filtersrv.xml │ │ ├── logback_namesrv.xml │ │ └── logback_tools.xml │ ├── control.sh │ └── lib │ │ ├── commons-cli-1.2.jar │ │ ├── commons-lang3-3.4.jar │ │ ├── fastjson-1.2.29.jar │ │ ├── guava-19.0.jar │ │ ├── javassist-3.20.0-GA.jar │ │ ├── jna-4.2.2.jar │ │ ├── logback-classic-1.0.13.jar │ │ ├── logback-core-1.0.13.jar │ │ ├── netty-all-4.0.42.Final.jar │ │ ├── netty-tcnative-1.1.33.Fork22-osx-x86_64.jar │ │ ├── openmessaging-api-0.1.0-alpha.jar │ │ ├── rocketmq-broker-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-client-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-common-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-example-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-filter-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-filtersrv-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-namesrv-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-openmessaging-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-remoting-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-srvutil-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-store-4.2.1-SNAPSHOT.jar │ │ ├── rocketmq-tools-4.2.1-SNAPSHOT.jar │ │ └── slf4j-api-1.7.7.jar ├── play-ddmq.sh ├── producer │ ├── conf │ │ ├── carrera.yaml │ │ └── log4j2.xml │ └── control.sh └── start.sh ├── carrera-monitor ├── README.md ├── build.sh ├── control.sh ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── xiaojukeji │ │ └── carrera │ │ └── monitor │ │ ├── BaseConfigMonitor.java │ │ ├── app │ │ ├── CarreraMonitor.java │ │ └── MonitorApp.java │ │ ├── broker │ │ ├── BrokerMonitor.java │ │ └── Utils.java │ │ ├── config │ │ └── MonitorConfig.java │ │ ├── inspection │ │ ├── CarreraDataInspection.java │ │ ├── ClusterConfig.java │ │ └── InspectionMonitor.java │ │ ├── lag │ │ ├── ConsumerLagMonitor.java │ │ └── offset │ │ │ ├── ConsumeOffsetTracker.java │ │ │ ├── OffsetManager.java │ │ │ ├── ProduceOffsetTracker.java │ │ │ └── RocketMQProduceOffsetFetcher.java │ │ └── utils │ │ ├── ConfigurationLoader.java │ │ ├── Const.java │ │ └── ExecutorUtils.java │ └── resources │ ├── logback.xml │ └── monitor.yaml ├── carrera-producer ├── .gitignore ├── README.md ├── README_CN.md ├── build.sh ├── control.sh ├── idl │ └── producerProxy.thrift ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── xiaojukeji │ │ └── carrera │ │ └── pproxy │ │ ├── config │ │ ├── PProxyServiceImpl.java │ │ ├── RemoteConfigInfo.java │ │ └── TopicInMgmtConfig.java │ │ ├── constants │ │ ├── Constant.java │ │ └── TopicConfigValue.java │ │ ├── metric │ │ └── TopicMetrics.java │ │ ├── producer │ │ ├── BatchCarreraRequest.java │ │ ├── BatchMQProducer.java │ │ ├── CarreraMessage.java │ │ ├── CarreraRequest.java │ │ ├── CarreraRequestForRMQBatch.java │ │ ├── ClusterProducer.java │ │ ├── ConfigManager.java │ │ ├── KafkaClusterProducer.java │ │ ├── ProducerManager.java │ │ ├── ProducerPool.java │ │ ├── ProducerType.java │ │ ├── ProxySendResult.java │ │ ├── RmqClusterProducer.java │ │ ├── RmqSender.java │ │ ├── TimeOutHandlerMgr.java │ │ ├── TopicConfigManager.java │ │ └── delay │ │ │ ├── DelayRequest.java │ │ │ └── ProxySendDelayResult.java │ │ ├── proxy │ │ ├── ProducerProxyMain.java │ │ └── ProxyApp.java │ │ ├── ratelimit │ │ ├── IGroupRequestLimiter.java │ │ └── TpsLimiter.java │ │ ├── server │ │ ├── ProducerAsyncServerImpl.java │ │ ├── Server.java │ │ └── ThreadedSelectorServer.java │ │ └── utils │ │ ├── ConfigConvertUtils.java │ │ ├── ConfigUtils.java │ │ ├── LogUtils.java │ │ ├── MetricUtils.java │ │ ├── MsgCheckUtils.java │ │ ├── RandomUtils.java │ │ ├── RoundRobinPickerList.java │ │ ├── StatsUtils.java │ │ └── TimeUtils.java │ └── resources │ ├── carrera.yaml │ ├── log4j.properties │ └── log4j2.xml ├── carrera-sdk ├── README.md ├── README_CN.md ├── consumer │ ├── c │ │ ├── consumer_proxy_types.c │ │ ├── consumer_proxy_types.h │ │ ├── consumer_service.c │ │ └── consumer_service.h │ ├── cpp │ │ ├── Consumer │ │ │ ├── CMakeLists.txt │ │ │ ├── CarreraClientExample.cpp │ │ │ ├── CarreraConfig.h │ │ │ ├── CarreraConsumer.cpp │ │ │ ├── CarreraConsumer.h │ │ │ ├── CarreraDefine.h │ │ │ ├── ConsumerService.cpp │ │ │ ├── ConsumerService.h │ │ │ ├── ServiceDiscoveryService.cpp │ │ │ ├── ServiceDiscoveryService.h │ │ │ ├── ServiceDiscoveryService_server.skeleton.cpp │ │ │ ├── SimpleCarreraClient.cpp │ │ │ ├── SimpleCarreraClient.h │ │ │ ├── carreraServiceDiscovery_constants.cpp │ │ │ ├── carreraServiceDiscovery_constants.h │ │ │ ├── carreraServiceDiscovery_types.cpp │ │ │ ├── carreraServiceDiscovery_types.h │ │ │ ├── cmake-build-debug │ │ │ │ ├── CMakeCache.txt │ │ │ │ ├── CMakeFiles │ │ │ │ │ ├── 3.12.0 │ │ │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ │ │ ├── CMakeSystem.cmake │ │ │ │ │ │ ├── CompilerIdC │ │ │ │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ │ │ │ └── a.out │ │ │ │ │ │ └── CompilerIdCXX │ │ │ │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ │ │ │ └── a.out │ │ │ │ │ ├── 3.12.1 │ │ │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ │ │ ├── CMakeSystem.cmake │ │ │ │ │ │ ├── CompilerIdC │ │ │ │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ │ │ │ └── a.out │ │ │ │ │ │ └── CompilerIdCXX │ │ │ │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ │ │ │ └── a.out │ │ │ │ │ ├── 3.12.2 │ │ │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ │ │ ├── CMakeSystem.cmake │ │ │ │ │ │ ├── CompilerIdC │ │ │ │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ │ │ │ └── a.out │ │ │ │ │ │ └── CompilerIdCXX │ │ │ │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ │ │ │ └── a.out │ │ │ │ │ ├── CMakeDirectoryInformation.cmake │ │ │ │ │ ├── CMakeOutput.log │ │ │ │ │ ├── Consumer.dir │ │ │ │ │ │ ├── DependInfo.cmake │ │ │ │ │ │ ├── build.make │ │ │ │ │ │ ├── cmake_clean.cmake │ │ │ │ │ │ ├── depend.make │ │ │ │ │ │ ├── flags.make │ │ │ │ │ │ ├── link.txt │ │ │ │ │ │ └── progress.make │ │ │ │ │ ├── Makefile.cmake │ │ │ │ │ ├── Makefile2 │ │ │ │ │ ├── TargetDirectories.txt │ │ │ │ │ ├── clion-environment.txt │ │ │ │ │ ├── clion-log.txt │ │ │ │ │ ├── cmake.check_cache │ │ │ │ │ ├── feature_tests.bin │ │ │ │ │ ├── feature_tests.c │ │ │ │ │ ├── feature_tests.cxx │ │ │ │ │ └── progress.marks │ │ │ │ ├── Consumer.cbp │ │ │ │ ├── Makefile │ │ │ │ └── cmake_install.cmake │ │ │ ├── consumerProxy_constants.cpp │ │ │ ├── consumerProxy_constants.h │ │ │ ├── consumerProxy_types.cpp │ │ │ ├── consumerProxy_types.h │ │ │ ├── makefile │ │ │ ├── mq_logger.cpp │ │ │ ├── mq_logger.h │ │ │ └── thirdparty │ │ │ │ ├── carrera │ │ │ │ ├── CarreraClient.h │ │ │ │ ├── ConsumerService.h │ │ │ │ ├── SimpleCarreraClient.h │ │ │ │ ├── consumerProxy_constants.h │ │ │ │ ├── consumerProxy_types.h │ │ │ │ └── mq_logger.h │ │ │ │ ├── spdlog │ │ │ │ ├── async.h │ │ │ │ ├── async_logger.h │ │ │ │ ├── common.h │ │ │ │ ├── details │ │ │ │ │ ├── async_logger_impl.h │ │ │ │ │ ├── circular_q.h │ │ │ │ │ ├── console_globals.h │ │ │ │ │ ├── file_helper.h │ │ │ │ │ ├── fmt_helper.h │ │ │ │ │ ├── log_msg.h │ │ │ │ │ ├── logger_impl.h │ │ │ │ │ ├── mpmc_blocking_q.h │ │ │ │ │ ├── null_mutex.h │ │ │ │ │ ├── os.h │ │ │ │ │ ├── pattern_formatter.h │ │ │ │ │ ├── periodic_worker.h │ │ │ │ │ ├── registry.h │ │ │ │ │ └── thread_pool.h │ │ │ │ ├── fmt │ │ │ │ │ ├── bundled │ │ │ │ │ │ ├── LICENSE.rst │ │ │ │ │ │ ├── colors.h │ │ │ │ │ │ ├── core.h │ │ │ │ │ │ ├── format-inl.h │ │ │ │ │ │ ├── format.h │ │ │ │ │ │ ├── locale.h │ │ │ │ │ │ ├── ostream.h │ │ │ │ │ │ ├── posix.h │ │ │ │ │ │ ├── printf.h │ │ │ │ │ │ ├── ranges.h │ │ │ │ │ │ └── time.h │ │ │ │ │ ├── fmt.h │ │ │ │ │ └── ostr.h │ │ │ │ ├── formatter.h │ │ │ │ ├── logger.h │ │ │ │ ├── sinks │ │ │ │ │ ├── android_sink.h │ │ │ │ │ ├── ansicolor_sink.h │ │ │ │ │ ├── base_sink.h │ │ │ │ │ ├── basic_file_sink.h │ │ │ │ │ ├── daily_file_sink.h │ │ │ │ │ ├── dist_sink.h │ │ │ │ │ ├── msvc_sink.h │ │ │ │ │ ├── null_sink.h │ │ │ │ │ ├── ostream_sink.h │ │ │ │ │ ├── rotating_file_sink.h │ │ │ │ │ ├── sink.h │ │ │ │ │ ├── stdout_color_sinks.h │ │ │ │ │ ├── stdout_sinks.h │ │ │ │ │ ├── syslog_sink.h │ │ │ │ │ └── wincolor_sink.h │ │ │ │ ├── spdlog.h │ │ │ │ ├── tweakme.h │ │ │ │ └── version.h │ │ │ │ └── thrift │ │ │ │ ├── BUILD │ │ │ │ ├── TApplicationException.h │ │ │ │ ├── TDispatchProcessor.h │ │ │ │ ├── TLogging.h │ │ │ │ ├── TProcessor.h │ │ │ │ ├── TReflectionLocal.h │ │ │ │ ├── TToString.h │ │ │ │ ├── Thrift.h │ │ │ │ ├── async │ │ │ │ ├── TAsyncBufferProcessor.h │ │ │ │ ├── TAsyncChannel.h │ │ │ │ ├── TAsyncDispatchProcessor.h │ │ │ │ ├── TAsyncProcessor.h │ │ │ │ ├── TAsyncProtocolProcessor.h │ │ │ │ ├── TEvhttpClientChannel.h │ │ │ │ └── TEvhttpServer.h │ │ │ │ ├── c_glib │ │ │ │ ├── config.h │ │ │ │ ├── processor │ │ │ │ │ ├── thrift_dispatch_processor.h │ │ │ │ │ └── thrift_processor.h │ │ │ │ ├── protocol │ │ │ │ │ ├── thrift_binary_protocol.h │ │ │ │ │ ├── thrift_binary_protocol_factory.h │ │ │ │ │ ├── thrift_protocol.h │ │ │ │ │ └── thrift_protocol_factory.h │ │ │ │ ├── server │ │ │ │ │ ├── thrift_server.h │ │ │ │ │ └── thrift_simple_server.h │ │ │ │ ├── thrift.h │ │ │ │ ├── thrift.h.bak │ │ │ │ ├── thrift_application_exception.h │ │ │ │ ├── thrift_application_exception.h.bak │ │ │ │ ├── thrift_struct.h │ │ │ │ └── transport │ │ │ │ │ ├── thrift_buffered_transport.h │ │ │ │ │ ├── thrift_buffered_transport_factory.h │ │ │ │ │ ├── thrift_framed_transport.h │ │ │ │ │ ├── thrift_framed_transport_factory.h │ │ │ │ │ ├── thrift_memory_buffer.h │ │ │ │ │ ├── thrift_server_socket.h │ │ │ │ │ ├── thrift_server_socket.h.bak │ │ │ │ │ ├── thrift_server_transport.h │ │ │ │ │ ├── thrift_server_transport.h.bak │ │ │ │ │ ├── thrift_socket.h │ │ │ │ │ ├── thrift_transport.h │ │ │ │ │ ├── thrift_transport_factory.h │ │ │ │ │ └── thrift_transport_factory.h.bak │ │ │ │ ├── concurrency │ │ │ │ ├── BoostThreadFactory.h │ │ │ │ ├── Exception.h │ │ │ │ ├── FunctionRunner.h │ │ │ │ ├── Monitor.h │ │ │ │ ├── Mutex.h │ │ │ │ ├── PlatformThreadFactory.h │ │ │ │ ├── PosixThreadFactory.h │ │ │ │ ├── StdMonitor.cpp │ │ │ │ ├── StdMutex.cpp │ │ │ │ ├── StdThreadFactory.cpp │ │ │ │ ├── StdThreadFactory.h │ │ │ │ ├── Thread.h │ │ │ │ ├── ThreadManager.h │ │ │ │ ├── TimerManager.h │ │ │ │ └── Util.h │ │ │ │ ├── config.h │ │ │ │ ├── cxxfunctional.h │ │ │ │ ├── processor │ │ │ │ ├── PeekProcessor.h │ │ │ │ ├── StatsProcessor.h │ │ │ │ └── TMultiplexedProcessor.h │ │ │ │ ├── protocol │ │ │ │ ├── TBase64Utils.h │ │ │ │ ├── TBinaryProtocol.h │ │ │ │ ├── TBinaryProtocol.tcc │ │ │ │ ├── TCompactProtocol.h │ │ │ │ ├── TCompactProtocol.tcc │ │ │ │ ├── TDebugProtocol.h │ │ │ │ ├── TDenseProtocol.h │ │ │ │ ├── TJSONProtocol.h │ │ │ │ ├── TMultiplexedProtocol.h │ │ │ │ ├── TProtocol.h │ │ │ │ ├── TProtocolDecorator.h │ │ │ │ ├── TProtocolException.h │ │ │ │ ├── TProtocolTap.h │ │ │ │ └── TVirtualProtocol.h │ │ │ │ ├── qt │ │ │ │ ├── TQIODeviceTransport.h │ │ │ │ └── TQTcpServer.h │ │ │ │ ├── server │ │ │ │ ├── TNonblockingServer.h │ │ │ │ ├── TServer.h │ │ │ │ ├── TSimpleServer.h │ │ │ │ ├── TThreadPoolServer.h │ │ │ │ └── TThreadedServer.h │ │ │ │ ├── thrift-config.h │ │ │ │ └── transport │ │ │ │ ├── PlatformSocket.h │ │ │ │ ├── TBufferTransports.h │ │ │ │ ├── TFDTransport.h │ │ │ │ ├── TFileTransport.h │ │ │ │ ├── THttpClient.h │ │ │ │ ├── THttpServer.h │ │ │ │ ├── THttpTransport.h │ │ │ │ ├── TPipe.h │ │ │ │ ├── TPipeServer.h │ │ │ │ ├── TSSLServerSocket.h │ │ │ │ ├── TSSLSocket.h │ │ │ │ ├── TServerSocket.h │ │ │ │ ├── TServerTransport.h │ │ │ │ ├── TShortReadTransport.h │ │ │ │ ├── TSimpleFileTransport.h │ │ │ │ ├── TSocket.h │ │ │ │ ├── TSocketPool.h │ │ │ │ ├── TTransport.h │ │ │ │ ├── TTransportException.h │ │ │ │ ├── TTransportUtils.h │ │ │ │ ├── TVirtualTransport.h │ │ │ │ └── TZlibTransport.h │ │ └── LowlevelConsumer │ │ │ ├── CMakeLists.txt │ │ │ ├── README.md │ │ │ ├── cmake-build-debug │ │ │ ├── CMakeCache.txt │ │ │ ├── CMakeFiles │ │ │ │ ├── 3.12.0 │ │ │ │ │ ├── CMakeCCompiler.cmake │ │ │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ │ │ ├── CMakeSystem.cmake │ │ │ │ │ ├── CompilerIdC │ │ │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ │ │ └── a.out │ │ │ │ │ └── CompilerIdCXX │ │ │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ │ │ └── a.out │ │ │ │ ├── CMakeDirectoryInformation.cmake │ │ │ │ ├── CMakeOutput.log │ │ │ │ ├── LowlevelConsumer.dir │ │ │ │ │ ├── DependInfo.cmake │ │ │ │ │ ├── build.make │ │ │ │ │ ├── cmake_clean.cmake │ │ │ │ │ ├── depend.make │ │ │ │ │ ├── flags.make │ │ │ │ │ ├── link.txt │ │ │ │ │ └── progress.make │ │ │ │ ├── Makefile.cmake │ │ │ │ ├── Makefile2 │ │ │ │ ├── TargetDirectories.txt │ │ │ │ ├── clion-environment.txt │ │ │ │ ├── clion-log.txt │ │ │ │ ├── cmake.check_cache │ │ │ │ ├── feature_tests.bin │ │ │ │ ├── feature_tests.c │ │ │ │ ├── feature_tests.cxx │ │ │ │ └── progress.marks │ │ │ ├── LowlevelConsumer.cbp │ │ │ ├── Makefile │ │ │ └── cmake_install.cmake │ │ │ ├── default_log.conf │ │ │ └── src │ │ │ ├── Consumer.cpp │ │ │ ├── Consumer.h │ │ │ ├── ConsumerConfig.cpp │ │ │ ├── ConsumerConfig.h │ │ │ ├── ConsumerLogger.cpp │ │ │ ├── ConsumerLogger.h │ │ │ ├── ConsumerPool.cpp │ │ │ ├── ConsumerPool.h │ │ │ ├── ConsumerService.cpp │ │ │ ├── ConsumerService.h │ │ │ ├── ConsumerWrapper.cpp │ │ │ ├── Makefile │ │ │ ├── Makefile.dep │ │ │ ├── consumer.log │ │ │ ├── consumerProxy_constants.cpp │ │ │ ├── consumerProxy_constants.h │ │ │ ├── consumerProxy_types.cpp │ │ │ ├── consumerProxy_types.h │ │ │ ├── consumerwrapper.h │ │ │ ├── test_consumer.c │ │ │ └── test_consumer_pool.cpp │ ├── go │ │ └── src │ │ │ ├── carrera │ │ │ ├── common │ │ │ │ ├── const.go │ │ │ │ ├── dlog │ │ │ │ │ └── dlog.go │ │ │ │ └── qlog │ │ │ │ │ └── qlog.go │ │ │ ├── consumer │ │ │ │ ├── CarreraConsumer │ │ │ │ │ ├── constants.go │ │ │ │ │ ├── consumer_service-remote │ │ │ │ │ │ └── consumer_service-remote.go │ │ │ │ │ ├── consumerservice.go │ │ │ │ │ └── ttypes.go │ │ │ │ ├── carrera_consumer.go │ │ │ │ ├── carrera_consumer_test.go │ │ │ │ └── client.go │ │ │ ├── example.go │ │ │ └── example_with_properties.go │ │ │ └── go.intra.xiaojukeji.com │ │ │ └── golang │ │ │ └── thrift-lib │ │ │ └── 0.9.2 │ │ │ ├── application_exception.go │ │ │ ├── application_exception_test.go │ │ │ ├── binary_protocol.go │ │ │ ├── binary_protocol_test.go │ │ │ ├── buffered_transport.go │ │ │ ├── buffered_transport_test.go │ │ │ ├── compact_protocol.go │ │ │ ├── compact_protocol_test.go │ │ │ ├── debug_protocol.go │ │ │ ├── deserializer.go │ │ │ ├── exception.go │ │ │ ├── field.go │ │ │ ├── framed_transport.go │ │ │ ├── framed_transport_test.go │ │ │ ├── http_client.go │ │ │ ├── http_client_test.go │ │ │ ├── iostream_transport.go │ │ │ ├── iostream_transport_test.go │ │ │ ├── json_protocol.go │ │ │ ├── json_protocol_test.go │ │ │ ├── lowlevel_benchmarks_test.go │ │ │ ├── memory_buffer.go │ │ │ ├── memory_buffer_test.go │ │ │ ├── messagetype.go │ │ │ ├── multiplexed_protocol.go │ │ │ ├── numeric.go │ │ │ ├── pointerize.go │ │ │ ├── processor.go │ │ │ ├── processor_factory.go │ │ │ ├── protocol.go │ │ │ ├── protocol_exception.go │ │ │ ├── protocol_factory.go │ │ │ ├── protocol_test.go │ │ │ ├── rich_transport.go │ │ │ ├── rich_transport_test.go │ │ │ ├── serializer.go │ │ │ ├── serializer_test.go │ │ │ ├── serializer_types.go │ │ │ ├── server.go │ │ │ ├── server_socket.go │ │ │ ├── server_test.go │ │ │ ├── server_transport.go │ │ │ ├── simple_json_protocol.go │ │ │ ├── simple_json_protocol_test.go │ │ │ ├── simple_server.go │ │ │ ├── socket.go │ │ │ ├── ssl_server_socket.go │ │ │ ├── ssl_socket.go │ │ │ ├── transport.go │ │ │ ├── transport_exception.go │ │ │ ├── transport_exception_test.go │ │ │ ├── transport_factory.go │ │ │ ├── transport_test.go │ │ │ └── type.go │ └── java │ │ ├── .gitignore │ │ ├── carrera-consumer-sdk-example │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── xiaojukeji │ │ │ │ └── carrera │ │ │ │ └── consumer │ │ │ │ └── examples │ │ │ │ ├── CarreraConsumerExample.java │ │ │ │ ├── CarreraConsumerWithPropertiesExample.java │ │ │ │ ├── ConsumerPerformance.java │ │ │ │ ├── LowLevelConsumerPerformance.java │ │ │ │ └── SimpleCarreraConsumerExample.java │ │ │ └── resources │ │ │ └── log4j2.xml │ │ └── carrera-consumer-sdk │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── xiaojukeji │ │ │ │ └── carrera │ │ │ │ └── consumer │ │ │ │ └── thrift │ │ │ │ ├── AckResult.java │ │ │ │ ├── ConsumeResult.java │ │ │ │ ├── ConsumeStats.java │ │ │ │ ├── ConsumeStatsRequest.java │ │ │ │ ├── ConsumerService.java │ │ │ │ ├── Context.java │ │ │ │ ├── FetchRequest.java │ │ │ │ ├── FetchResponse.java │ │ │ │ ├── Message.java │ │ │ │ ├── PullException.java │ │ │ │ ├── PullRequest.java │ │ │ │ ├── PullResponse.java │ │ │ │ ├── QidResponse.java │ │ │ │ ├── client │ │ │ │ ├── BaseCarreraConsumer.java │ │ │ │ ├── BaseCarreraConsumerPool.java │ │ │ │ ├── BaseMessageProcessor.java │ │ │ │ ├── BatchMessageProcessor.java │ │ │ │ ├── CarreraConfig.java │ │ │ │ ├── CarreraConsumer.java │ │ │ │ ├── LowLevelCarreraConfig.java │ │ │ │ ├── LowLevelCarreraConsumer.java │ │ │ │ ├── LowLevelPoolCarreraConsumer.java │ │ │ │ ├── MessageProcessor.java │ │ │ │ ├── SimpleCarreraConsumer.java │ │ │ │ ├── node │ │ │ │ │ ├── LocalNodeManager.java │ │ │ │ │ ├── Node.java │ │ │ │ │ ├── NodeManager.java │ │ │ │ │ └── NodeUpdateInterface.java │ │ │ │ └── util │ │ │ │ │ ├── MessageUtils.java │ │ │ │ │ └── VersionUtils.java │ │ │ │ └── consumerProxyConstants.java │ │ └── resources │ │ │ └── carrera_consumer_sdk_version.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── xiaojukeji │ │ └── carrera │ │ └── consumer │ │ └── thrift │ │ └── client │ │ ├── CarreraConfigTest.java │ │ ├── CarreraConsumerTest.java │ │ ├── LowLevelCarreraConsumerTest.java │ │ └── util │ │ └── VersionUtilsTest.java └── producer │ ├── cpp │ └── Producer │ │ ├── BridgeQHolder.cpp │ │ ├── BridgeQHolder.h │ │ ├── CarreraClientExample.c │ │ ├── CarreraClientExample.cpp │ │ ├── CarreraClientExampleOld.cpp │ │ ├── CarreraClientTest.cpp │ │ ├── CarreraConfig.h │ │ ├── CarreraConnection.cpp │ │ ├── CarreraConnection.h │ │ ├── CarreraDefine.h │ │ ├── CarreraProducer.cpp │ │ ├── CarreraProducer.h │ │ ├── CarreraProducerCWrapper.cpp │ │ ├── CarreraProducerCWrapper.h │ │ ├── ConnectionPool.h │ │ ├── DelayClientExample.cpp │ │ ├── DelayConfig.h │ │ ├── DelayProducer.cpp │ │ ├── DelayProducer.h │ │ ├── HttpClient.cpp │ │ ├── HttpClient.h │ │ ├── HttpMQTask.h │ │ ├── ProducerService.cpp │ │ ├── ProducerService.h │ │ ├── ProducerService_server.skeleton.cpp │ │ ├── ServiceDiscoveryService.cpp │ │ ├── ServiceDiscoveryService.h │ │ ├── ServiceDiscoveryService_server.skeleton.cpp │ │ ├── carreraServiceDiscovery_constants.cpp │ │ ├── carreraServiceDiscovery_constants.h │ │ ├── carreraServiceDiscovery_types.cpp │ │ ├── carreraServiceDiscovery_types.h │ │ ├── makefile │ │ ├── producerProxy_constants.cpp │ │ ├── producerProxy_constants.h │ │ ├── producerProxy_types.cpp │ │ ├── producerProxy_types.h │ │ └── thirdparty │ │ ├── carrera │ │ ├── BridgeQHolder.h │ │ ├── CarreraConfig.h │ │ ├── CarreraConnection.h │ │ ├── CarreraDefine.h │ │ ├── CarreraProducer.h │ │ ├── CarreraProducerCWrapper.h │ │ ├── ConnectionPool.h │ │ ├── DelayConfig.h │ │ ├── DelayProducer.h │ │ ├── HttpClient.h │ │ ├── HttpMQTask.h │ │ ├── ProducerService.h │ │ ├── ServiceDiscoveryService.h │ │ ├── carreraServiceDiscovery_constants.h │ │ ├── carreraServiceDiscovery_types.h │ │ ├── lib64_release │ │ │ └── libcarrera.a │ │ ├── producerProxy_constants.h │ │ └── producerProxy_types.h │ │ ├── curl │ │ ├── curl.h │ │ ├── curlbuild.h │ │ ├── curlrules.h │ │ ├── curlver.h │ │ ├── easy.h │ │ ├── lib64_release │ │ │ ├── libcurl.a │ │ │ ├── libcurl.la │ │ │ ├── libcurl.so │ │ │ ├── libcurl.so.4 │ │ │ ├── libcurl.so.4.3.0 │ │ │ └── pkgconfig │ │ │ │ └── libcurl.pc │ │ ├── mprintf.h │ │ ├── multi.h │ │ ├── stdcheaders.h │ │ └── typecheck-gcc.h │ │ ├── jsoncpp │ │ ├── json │ │ │ ├── assertions.h │ │ │ ├── autolink.h │ │ │ ├── config.h │ │ │ ├── features.h │ │ │ ├── forwards.h │ │ │ ├── json.h │ │ │ ├── reader.h │ │ │ ├── value.h │ │ │ ├── version.h │ │ │ └── writer.h │ │ ├── json_sample.txt │ │ ├── makefile │ │ └── test_json.cpp │ │ ├── spdlog │ │ ├── async.h │ │ ├── async_logger.h │ │ ├── common.h │ │ ├── details │ │ │ ├── async_logger_impl.h │ │ │ ├── circular_q.h │ │ │ ├── console_globals.h │ │ │ ├── file_helper.h │ │ │ ├── fmt_helper.h │ │ │ ├── log_msg.h │ │ │ ├── logger_impl.h │ │ │ ├── mpmc_blocking_q.h │ │ │ ├── null_mutex.h │ │ │ ├── os.h │ │ │ ├── pattern_formatter.h │ │ │ ├── periodic_worker.h │ │ │ ├── registry.h │ │ │ └── thread_pool.h │ │ ├── fmt │ │ │ ├── bundled │ │ │ │ ├── LICENSE.rst │ │ │ │ ├── colors.h │ │ │ │ ├── core.h │ │ │ │ ├── format-inl.h │ │ │ │ ├── format.h │ │ │ │ ├── locale.h │ │ │ │ ├── ostream.h │ │ │ │ ├── posix.h │ │ │ │ ├── printf.h │ │ │ │ ├── ranges.h │ │ │ │ └── time.h │ │ │ ├── fmt.h │ │ │ └── ostr.h │ │ ├── formatter.h │ │ ├── logger.h │ │ ├── sinks │ │ │ ├── android_sink.h │ │ │ ├── ansicolor_sink.h │ │ │ ├── base_sink.h │ │ │ ├── basic_file_sink.h │ │ │ ├── daily_file_sink.h │ │ │ ├── dist_sink.h │ │ │ ├── msvc_sink.h │ │ │ ├── null_sink.h │ │ │ ├── ostream_sink.h │ │ │ ├── rotating_file_sink.h │ │ │ ├── sink.h │ │ │ ├── stdout_color_sinks.h │ │ │ ├── stdout_sinks.h │ │ │ ├── syslog_sink.h │ │ │ └── wincolor_sink.h │ │ ├── spdlog.h │ │ ├── tweakme.h │ │ └── version.h │ │ └── thrift │ │ ├── BUILD │ │ ├── TApplicationException.h │ │ ├── TDispatchProcessor.h │ │ ├── TLogging.h │ │ ├── TProcessor.h │ │ ├── TReflectionLocal.h │ │ ├── TToString.h │ │ ├── Thrift.h │ │ ├── async │ │ ├── TAsyncBufferProcessor.h │ │ ├── TAsyncChannel.h │ │ ├── TAsyncDispatchProcessor.h │ │ ├── TAsyncProcessor.h │ │ ├── TAsyncProtocolProcessor.h │ │ ├── TEvhttpClientChannel.h │ │ └── TEvhttpServer.h │ │ ├── c_glib │ │ ├── config.h │ │ ├── processor │ │ │ ├── thrift_dispatch_processor.h │ │ │ └── thrift_processor.h │ │ ├── protocol │ │ │ ├── thrift_binary_protocol.h │ │ │ ├── thrift_binary_protocol_factory.h │ │ │ ├── thrift_protocol.h │ │ │ └── thrift_protocol_factory.h │ │ ├── server │ │ │ ├── thrift_server.h │ │ │ └── thrift_simple_server.h │ │ ├── thrift.h │ │ ├── thrift.h.bak │ │ ├── thrift_application_exception.h │ │ ├── thrift_application_exception.h.bak │ │ ├── thrift_struct.h │ │ └── transport │ │ │ ├── thrift_buffered_transport.h │ │ │ ├── thrift_buffered_transport_factory.h │ │ │ ├── thrift_framed_transport.h │ │ │ ├── thrift_framed_transport_factory.h │ │ │ ├── thrift_memory_buffer.h │ │ │ ├── thrift_server_socket.h │ │ │ ├── thrift_server_socket.h.bak │ │ │ ├── thrift_server_transport.h │ │ │ ├── thrift_server_transport.h.bak │ │ │ ├── thrift_socket.h │ │ │ ├── thrift_transport.h │ │ │ ├── thrift_transport_factory.h │ │ │ └── thrift_transport_factory.h.bak │ │ ├── concurrency │ │ ├── BoostThreadFactory.h │ │ ├── Exception.h │ │ ├── FunctionRunner.h │ │ ├── Monitor.h │ │ ├── Mutex.h │ │ ├── PlatformThreadFactory.h │ │ ├── PosixThreadFactory.h │ │ ├── StdMonitor.cpp │ │ ├── StdMutex.cpp │ │ ├── StdThreadFactory.cpp │ │ ├── StdThreadFactory.h │ │ ├── Thread.h │ │ ├── ThreadManager.h │ │ ├── TimerManager.h │ │ └── Util.h │ │ ├── config.h │ │ ├── cxxfunctional.h │ │ ├── processor │ │ ├── PeekProcessor.h │ │ ├── StatsProcessor.h │ │ └── TMultiplexedProcessor.h │ │ ├── protocol │ │ ├── TBase64Utils.h │ │ ├── TBinaryProtocol.h │ │ ├── TBinaryProtocol.tcc │ │ ├── TCompactProtocol.h │ │ ├── TCompactProtocol.tcc │ │ ├── TDebugProtocol.h │ │ ├── TDenseProtocol.h │ │ ├── TJSONProtocol.h │ │ ├── TMultiplexedProtocol.h │ │ ├── TProtocol.h │ │ ├── TProtocolDecorator.h │ │ ├── TProtocolException.h │ │ ├── TProtocolTap.h │ │ └── TVirtualProtocol.h │ │ ├── qt │ │ ├── TQIODeviceTransport.h │ │ └── TQTcpServer.h │ │ ├── server │ │ ├── TNonblockingServer.h │ │ ├── TServer.h │ │ ├── TSimpleServer.h │ │ ├── TThreadPoolServer.h │ │ └── TThreadedServer.h │ │ ├── t.go │ │ ├── thrift-config.h │ │ └── transport │ │ ├── PlatformSocket.h │ │ ├── TBufferTransports.h │ │ ├── TFDTransport.h │ │ ├── TFileTransport.h │ │ ├── THttpClient.h │ │ ├── THttpServer.h │ │ ├── THttpTransport.h │ │ ├── TPipe.h │ │ ├── TPipeServer.h │ │ ├── TSSLServerSocket.h │ │ ├── TSSLSocket.h │ │ ├── TServerSocket.h │ │ ├── TServerTransport.h │ │ ├── TShortReadTransport.h │ │ ├── TSimpleFileTransport.h │ │ ├── TSocket.h │ │ ├── TSocketPool.h │ │ ├── TTransport.h │ │ ├── TTransportException.h │ │ ├── TTransportUtils.h │ │ ├── TVirtualTransport.h │ │ └── TZlibTransport.h │ ├── go │ └── src │ │ ├── .deploy │ │ └── service.json │ │ ├── bq_demo.go │ │ ├── carrera │ │ ├── CarreraProducer │ │ │ ├── constants.go │ │ │ ├── producer_service-remote │ │ │ │ └── producer_service-remote.go │ │ │ ├── producerservice.go │ │ │ └── ttypes.go │ │ ├── addDelayMessageBuilder.go │ │ ├── addTxMonitorMessageBuilder.go │ │ ├── cancelDelayMessageBuilder.go │ │ ├── cancelTxMonitorMessageBuilder.go │ │ ├── carrera_dpool.go │ │ ├── common │ │ │ ├── const.go │ │ │ ├── dlog │ │ │ │ └── dlog.go │ │ │ ├── errinfo │ │ │ │ └── error_info.go │ │ │ ├── qlog │ │ │ │ └── qlog.go │ │ │ └── util │ │ │ │ ├── datetime_util.go │ │ │ │ └── randKey_util.go │ │ ├── config.go │ │ ├── delay │ │ │ ├── delay_config.go │ │ │ ├── delay_error.go │ │ │ ├── delay_producer.go │ │ │ └── delay_producer_test.go │ │ ├── dpool_conn_factory.go │ │ ├── dpool_test.go │ │ ├── messageBuilder.go │ │ ├── pool │ │ │ ├── dpool.go │ │ │ ├── pool_config.go │ │ │ ├── pool_shard.go │ │ │ ├── pooled_conn_factory.go │ │ │ └── pooled_connection.go │ │ ├── pooled_producer.go │ │ ├── pooled_producer_test.go │ │ ├── producer.go │ │ └── txBusinessMessageBuilder.go │ │ ├── example.go │ │ ├── example_for_concurrent.go │ │ ├── example_with_properties.go │ │ ├── example_with_txmsg.go │ │ └── go.intra.xiaojukeji.com │ │ └── golang │ │ ├── go.uuid │ │ └── uuid.go │ │ ├── logrus │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── alt_exit.go │ │ ├── alt_exit_test.go │ │ ├── doc.go │ │ ├── entry.go │ │ ├── entry_test.go │ │ ├── exported.go │ │ ├── formatter.go │ │ ├── formatter_bench_test.go │ │ ├── hook_test.go │ │ ├── hooks.go │ │ ├── hooks │ │ │ ├── syslog │ │ │ │ ├── README.md │ │ │ │ ├── syslog.go │ │ │ │ └── syslog_test.go │ │ │ └── test │ │ │ │ ├── test.go │ │ │ │ └── test_test.go │ │ ├── json_formatter.go │ │ ├── json_formatter_test.go │ │ ├── logger.go │ │ ├── logger_bench_test.go │ │ ├── logrus.go │ │ ├── logrus_test.go │ │ ├── terminal_appengine.go │ │ ├── terminal_bsd.go │ │ ├── terminal_linux.go │ │ ├── terminal_notwindows.go │ │ ├── terminal_solaris.go │ │ ├── terminal_windows.go │ │ ├── text_formatter.go │ │ ├── text_formatter_test.go │ │ ├── vendor │ │ │ └── vendor.json │ │ └── writer.go │ │ ├── lumberjack │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── chown.go │ │ ├── chown_linux.go │ │ ├── example_test.go │ │ ├── linux_test.go │ │ ├── lumberjack.go │ │ ├── lumberjack_test.go │ │ ├── rotate_test.go │ │ └── testing_test.go │ │ └── thrift-lib │ │ └── 0.9.2 │ │ ├── application_exception.go │ │ ├── application_exception_test.go │ │ ├── binary_protocol.go │ │ ├── binary_protocol_test.go │ │ ├── buffered_transport.go │ │ ├── buffered_transport_test.go │ │ ├── compact_protocol.go │ │ ├── compact_protocol_test.go │ │ ├── debug_protocol.go │ │ ├── deserializer.go │ │ ├── exception.go │ │ ├── field.go │ │ ├── framed_transport.go │ │ ├── framed_transport_test.go │ │ ├── http_client.go │ │ ├── http_client_test.go │ │ ├── iostream_transport.go │ │ ├── iostream_transport_test.go │ │ ├── json_protocol.go │ │ ├── json_protocol_test.go │ │ ├── lowlevel_benchmarks_test.go │ │ ├── memory_buffer.go │ │ ├── memory_buffer_test.go │ │ ├── messagetype.go │ │ ├── multiplexed_protocol.go │ │ ├── numeric.go │ │ ├── pointerize.go │ │ ├── processor.go │ │ ├── processor_factory.go │ │ ├── protocol.go │ │ ├── protocol_exception.go │ │ ├── protocol_factory.go │ │ ├── protocol_test.go │ │ ├── rich_transport.go │ │ ├── rich_transport_test.go │ │ ├── serializer.go │ │ ├── serializer_test.go │ │ ├── serializer_types.go │ │ ├── server.go │ │ ├── server_socket.go │ │ ├── server_test.go │ │ ├── server_transport.go │ │ ├── simple_json_protocol.go │ │ ├── simple_json_protocol_test.go │ │ ├── simple_server.go │ │ ├── socket.go │ │ ├── ssl_server_socket.go │ │ ├── ssl_socket.go │ │ ├── transport.go │ │ ├── transport_exception.go │ │ ├── transport_exception_test.go │ │ ├── transport_factory.go │ │ ├── transport_test.go │ │ └── type.go │ ├── java │ ├── carrera-producer-sdk-example │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── xiaojukeji │ │ │ │ └── carrera │ │ │ │ └── producer │ │ │ │ └── examples │ │ │ │ ├── CarreraProducerExample.java │ │ │ │ ├── CarreraProducerWithPropertiesExample.java │ │ │ │ └── CarreraTxMsgExample.java │ │ │ └── resources │ │ │ └── log4j2.xml │ └── carrera-producer-sdk │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── xiaojukeji │ │ │ │ └── carrera │ │ │ │ ├── config │ │ │ │ └── CarreraConfig.java │ │ │ │ ├── exception │ │ │ │ └── CarreraException.java │ │ │ │ ├── nodemgr │ │ │ │ ├── LocalNodeManager.java │ │ │ │ ├── Node.java │ │ │ │ ├── NodeInfo.java │ │ │ │ ├── NodeManager.java │ │ │ │ └── connection │ │ │ │ │ ├── CarreraConnection.java │ │ │ │ │ └── CarreraConnectionFactory.java │ │ │ │ ├── producer │ │ │ │ ├── AddDelayMessageBuilder.java │ │ │ │ ├── CancelDelayMessageBuilder.java │ │ │ │ ├── CarreraProducer.java │ │ │ │ ├── CarreraProducerBase.java │ │ │ │ ├── CarreraReturnCode.java │ │ │ │ ├── LocalCarreraProducer.java │ │ │ │ ├── MessageBuilder.java │ │ │ │ ├── ProducerInterface.java │ │ │ │ └── tx │ │ │ │ │ ├── AddTxMonitorMessageBuilder.java │ │ │ │ │ ├── CancelTxMonitorMessageBuilder.java │ │ │ │ │ └── TxBusinessMessageBuilder.java │ │ │ │ ├── recover │ │ │ │ └── CarreraRecover.java │ │ │ │ ├── thrift │ │ │ │ ├── DelayMessage.java │ │ │ │ ├── DelayMeta.java │ │ │ │ ├── DelayResult.java │ │ │ │ ├── Message.java │ │ │ │ ├── ProducerService.java │ │ │ │ ├── RestMessage.java │ │ │ │ ├── Result.java │ │ │ │ └── producerProxyConstants.java │ │ │ │ └── utils │ │ │ │ ├── ConstUtils.java │ │ │ │ ├── FastJsonUtils.java │ │ │ │ ├── RandomKeyUtils.java │ │ │ │ ├── TimeUtils.java │ │ │ │ └── VersionUtils.java │ │ └── resources │ │ │ └── carrera_producer_sdk_version.properties │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── xiaojukeji │ │ │ └── carrera │ │ │ ├── nodemgr │ │ │ └── NodeManagerTest.java │ │ │ └── producer │ │ │ └── CarreraProducerTest.java │ │ └── resources │ │ └── log4j2.xml │ ├── php │ ├── README.md │ ├── config │ │ ├── development │ │ │ └── config_carrera_cluster.php │ │ └── production │ │ │ └── config_carrera_cluster.php │ ├── controllers │ │ └── test │ │ │ └── testCarrera.php │ └── libraries │ │ └── carrera │ │ ├── Carrera.php │ │ ├── Thrift │ │ ├── ProducerService.php │ │ └── Types.php │ │ └── thriftconf.php │ └── python │ ├── .gitignore │ ├── carrera │ ├── CarreraProducer.py │ ├── __init__.py │ └── producerProxy │ │ ├── ProducerService-remote │ │ ├── ProducerService.py │ │ ├── __init__.py │ │ ├── constants.py │ │ └── ttypes.py │ ├── demo.py │ └── thrift │ ├── TMultiplexedProcessor.py │ ├── TSCons.py │ ├── TSerialization.py │ ├── TTornado.py │ ├── Thrift.py │ ├── __init__.py │ ├── protocol │ ├── TBase.py │ ├── TBinaryProtocol.py │ ├── TCompactProtocol.py │ ├── TJSONProtocol.py │ ├── TMultiplexedProtocol.py │ ├── TProtocol.py │ ├── TProtocolDecorator.py │ ├── __init__.py │ └── fastbinary.c │ ├── server │ ├── THttpServer.py │ ├── TNonblockingServer.py │ ├── TProcessPoolServer.py │ ├── TServer.py │ └── __init__.py │ └── transport │ ├── THttpClient.py │ ├── TSSLSocket.py │ ├── TSocket.py │ ├── TTransport.py │ ├── TTwisted.py │ ├── TZlibTransport.py │ └── __init__.py ├── image ├── arch.png ├── chronosArch.png ├── consumeProgress.png ├── createGroup.png ├── createSub.png ├── createTopic.png ├── dingGroup.jpg ├── groovy.png ├── httpConsume.png ├── localDDMQ.png ├── logo.png ├── resetOffset.png ├── roleChange.png ├── sampling.png ├── startSub.png ├── transit.png ├── transitMsg.png └── wechatGroup.png └── rocketmq ├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── BUILDING ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── broker ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── rocketmq │ │ │ └── broker │ │ │ ├── BrokerController.java │ │ │ ├── BrokerPathConfigHelper.java │ │ │ ├── BrokerStartup.java │ │ │ ├── client │ │ │ ├── ClientChannelInfo.java │ │ │ ├── ClientHousekeepingService.java │ │ │ ├── ConsumerGroupEvent.java │ │ │ ├── ConsumerGroupInfo.java │ │ │ ├── ConsumerIdsChangeListener.java │ │ │ ├── ConsumerManager.java │ │ │ ├── DefaultConsumerIdsChangeListener.java │ │ │ ├── ProducerManager.java │ │ │ ├── net │ │ │ │ └── Broker2Client.java │ │ │ └── rebalance │ │ │ │ └── RebalanceLockManager.java │ │ │ ├── config │ │ │ └── ConfigUpdate.java │ │ │ ├── filter │ │ │ ├── CommitLogDispatcherCalcBitMap.java │ │ │ ├── ConsumerFilterData.java │ │ │ ├── ConsumerFilterManager.java │ │ │ ├── ExpressionForRetryMessageFilter.java │ │ │ ├── ExpressionMessageFilter.java │ │ │ └── MessageEvaluationContext.java │ │ │ ├── filtersrv │ │ │ ├── FilterServerManager.java │ │ │ └── FilterServerUtil.java │ │ │ ├── latency │ │ │ ├── BrokerFastFailure.java │ │ │ ├── BrokerFixedThreadPoolExecutor.java │ │ │ └── FutureTaskExt.java │ │ │ ├── longpolling │ │ │ ├── ManyPullRequest.java │ │ │ ├── NotifyMessageArrivingListener.java │ │ │ ├── PullRequest.java │ │ │ └── PullRequestHoldService.java │ │ │ ├── mqtrace │ │ │ ├── ConsumeMessageContext.java │ │ │ ├── ConsumeMessageHook.java │ │ │ ├── SendMessageContext.java │ │ │ └── SendMessageHook.java │ │ │ ├── offset │ │ │ └── ConsumerOffsetManager.java │ │ │ ├── out │ │ │ └── BrokerOuterAPI.java │ │ │ ├── pagecache │ │ │ ├── ManyMessageTransfer.java │ │ │ ├── OneMessageTransfer.java │ │ │ └── QueryMessageTransfer.java │ │ │ ├── plugin │ │ │ ├── AbstractPluginMessageStore.java │ │ │ ├── MessageStoreFactory.java │ │ │ └── MessageStorePluginContext.java │ │ │ ├── processor │ │ │ ├── AbstractSendMessageProcessor.java │ │ │ ├── AdminBrokerProcessor.java │ │ │ ├── ClientManageProcessor.java │ │ │ ├── ConsumerManageProcessor.java │ │ │ ├── EndTransactionProcessor.java │ │ │ ├── ForwardRequestProcessor.java │ │ │ ├── PullMessageProcessor.java │ │ │ ├── QueryMessageProcessor.java │ │ │ └── SendMessageProcessor.java │ │ │ ├── role │ │ │ └── RoleChangeState.java │ │ │ ├── slave │ │ │ └── SlaveSynchronize.java │ │ │ ├── subscription │ │ │ └── SubscriptionGroupManager.java │ │ │ ├── topic │ │ │ └── TopicConfigManager.java │ │ │ └── transaction │ │ │ ├── TransactionRecord.java │ │ │ ├── TransactionStore.java │ │ │ └── jdbc │ │ │ ├── JDBCTransactionStore.java │ │ │ └── JDBCTransactionStoreConfig.java │ └── resources │ │ └── transaction.sql │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── broker │ │ ├── BrokerControllerTest.java │ │ ├── BrokerStartupTest.java │ │ ├── client │ │ └── ProducerManagerTest.java │ │ ├── filter │ │ ├── CommitLogDispatcherCalcBitMapTest.java │ │ ├── ConsumerFilterManagerTest.java │ │ └── MessageStoreWithFilterTest.java │ │ ├── latency │ │ └── BrokerFastFailureTest.java │ │ └── processor │ │ ├── ClientManageProcessorTest.java │ │ ├── PullMessageProcessorTest.java │ │ └── SendMessageProcessorTest.java │ └── resources │ └── logback-test.xml ├── build-broker ├── build.sh └── control.sh ├── build-nameserver ├── build.sh └── control.sh ├── client ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── rocketmq │ │ │ └── client │ │ │ ├── ClientConfig.java │ │ │ ├── MQAdmin.java │ │ │ ├── MQHelper.java │ │ │ ├── QueryResult.java │ │ │ ├── Validators.java │ │ │ ├── admin │ │ │ └── MQAdminExtInner.java │ │ │ ├── common │ │ │ ├── ClientErrorCode.java │ │ │ └── ThreadLocalIndex.java │ │ │ ├── consumer │ │ │ ├── AllocateMessageQueueStrategy.java │ │ │ ├── DefaultMQPullConsumer.java │ │ │ ├── DefaultMQPushConsumer.java │ │ │ ├── MQConsumer.java │ │ │ ├── MQPullConsumer.java │ │ │ ├── MQPullConsumerScheduleService.java │ │ │ ├── MQPushConsumer.java │ │ │ ├── MessageQueueListener.java │ │ │ ├── MessageSelector.java │ │ │ ├── PullCallback.java │ │ │ ├── PullResult.java │ │ │ ├── PullStatus.java │ │ │ ├── PullTaskCallback.java │ │ │ ├── PullTaskContext.java │ │ │ ├── listener │ │ │ │ ├── ConsumeConcurrentlyContext.java │ │ │ │ ├── ConsumeConcurrentlyStatus.java │ │ │ │ ├── ConsumeOrderlyContext.java │ │ │ │ ├── ConsumeOrderlyStatus.java │ │ │ │ ├── ConsumeReturnType.java │ │ │ │ ├── MessageListener.java │ │ │ │ ├── MessageListenerConcurrently.java │ │ │ │ └── MessageListenerOrderly.java │ │ │ ├── rebalance │ │ │ │ ├── AllocateMessageQueueAveragely.java │ │ │ │ ├── AllocateMessageQueueAveragelyByCircle.java │ │ │ │ ├── AllocateMessageQueueByConfig.java │ │ │ │ ├── AllocateMessageQueueByMachineRoom.java │ │ │ │ └── AllocateMessageQueueConsistentHash.java │ │ │ └── store │ │ │ │ ├── LocalFileOffsetStore.java │ │ │ │ ├── OffsetSerializeWrapper.java │ │ │ │ ├── OffsetStore.java │ │ │ │ ├── ReadOffsetType.java │ │ │ │ └── RemoteBrokerOffsetStore.java │ │ │ ├── exception │ │ │ ├── MQBrokerException.java │ │ │ └── MQClientException.java │ │ │ ├── hook │ │ │ ├── CheckForbiddenContext.java │ │ │ ├── CheckForbiddenHook.java │ │ │ ├── ConsumeMessageContext.java │ │ │ ├── ConsumeMessageHook.java │ │ │ ├── FilterMessageContext.java │ │ │ ├── FilterMessageHook.java │ │ │ ├── SendMessageContext.java │ │ │ └── SendMessageHook.java │ │ │ ├── impl │ │ │ ├── CidFilter.java │ │ │ ├── ClientRemotingProcessor.java │ │ │ ├── CommunicationMode.java │ │ │ ├── FindBrokerResult.java │ │ │ ├── MQAdminImpl.java │ │ │ ├── MQClientAPIImpl.java │ │ │ ├── MQClientManager.java │ │ │ ├── consumer │ │ │ │ ├── ConsumeMessageConcurrentlyService.java │ │ │ │ ├── ConsumeMessageOrderlyService.java │ │ │ │ ├── ConsumeMessageService.java │ │ │ │ ├── DefaultMQPullConsumerImpl.java │ │ │ │ ├── DefaultMQPushConsumerImpl.java │ │ │ │ ├── MQConsumerInner.java │ │ │ │ ├── MessageQueueLock.java │ │ │ │ ├── ProcessQueue.java │ │ │ │ ├── PullAPIWrapper.java │ │ │ │ ├── PullMessageService.java │ │ │ │ ├── PullRequest.java │ │ │ │ ├── PullResultExt.java │ │ │ │ ├── RebalanceImpl.java │ │ │ │ ├── RebalancePullImpl.java │ │ │ │ ├── RebalancePushImpl.java │ │ │ │ ├── RebalanceService.java │ │ │ │ └── SharedRebalanceService.java │ │ │ ├── factory │ │ │ │ └── MQClientInstance.java │ │ │ └── producer │ │ │ │ ├── DefaultMQProducerImpl.java │ │ │ │ ├── MQProducerInner.java │ │ │ │ └── TopicPublishInfo.java │ │ │ ├── latency │ │ │ ├── LatencyFaultTolerance.java │ │ │ ├── LatencyFaultToleranceImpl.java │ │ │ └── MQFaultStrategy.java │ │ │ ├── log │ │ │ └── ClientLogger.java │ │ │ ├── producer │ │ │ ├── DefaultMQProducer.java │ │ │ ├── LocalTransactionExecuter.java │ │ │ ├── LocalTransactionState.java │ │ │ ├── MQProducer.java │ │ │ ├── MessageQueueSelector.java │ │ │ ├── SendCallback.java │ │ │ ├── SendResult.java │ │ │ ├── SendStatus.java │ │ │ ├── TransactionCheckListener.java │ │ │ ├── TransactionMQProducer.java │ │ │ ├── TransactionSendResult.java │ │ │ └── selector │ │ │ │ ├── SelectMessageQueueByHash.java │ │ │ │ ├── SelectMessageQueueByMachineRoom.java │ │ │ │ └── SelectMessageQueueByRandom.java │ │ │ └── stat │ │ │ └── ConsumerStatsManager.java │ └── resources │ │ ├── log4j2_rocketmq_client.xml │ │ ├── log4j_rocketmq_client.xml │ │ └── logback_rocketmq_client.xml │ └── test │ └── java │ └── org │ └── apache │ └── rocketmq │ └── client │ ├── ValidatorsTest.java │ ├── common │ └── ThreadLocalIndexTest.java │ ├── consumer │ ├── DefaultMQPullConsumerTest.java │ ├── DefaultMQPushConsumerTest.java │ ├── rebalance │ │ └── AllocateMessageQueueConsitentHashTest.java │ └── store │ │ ├── LocalFileOffsetStoreTest.java │ │ └── RemoteBrokerOffsetStoreTest.java │ ├── impl │ ├── MQClientAPIImplTest.java │ ├── consumer │ │ ├── DefaultMQPushConsumerImplTest.java │ │ ├── ProcessQueueTest.java │ │ └── RebalancePushImplTest.java │ └── factory │ │ └── MQClientInstanceTest.java │ ├── latency │ └── LatencyFaultToleranceImplTest.java │ ├── log │ └── ClientLoggerTest.java │ └── producer │ ├── DefaultMQProducerTest.java │ └── selector │ └── SelectMessageQueueByHashTest.java ├── common ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── common │ │ ├── BrokerConfig.java │ │ ├── BrokerConfigSingleton.java │ │ ├── ConfigManager.java │ │ ├── Configuration.java │ │ ├── CountDownLatch2.java │ │ ├── DataVersion.java │ │ ├── MQVersion.java │ │ ├── MixAll.java │ │ ├── Pair.java │ │ ├── ServiceState.java │ │ ├── ServiceThread.java │ │ ├── SystemClock.java │ │ ├── ThreadFactoryImpl.java │ │ ├── TopicConfig.java │ │ ├── TopicFilterType.java │ │ ├── UtilAll.java │ │ ├── admin │ │ ├── ConsumeStats.java │ │ ├── OffsetWrapper.java │ │ ├── RollbackStats.java │ │ ├── TopicOffset.java │ │ └── TopicStatsTable.java │ │ ├── annotation │ │ └── ImportantField.java │ │ ├── consistenthash │ │ ├── ConsistentHashRouter.java │ │ ├── HashFunction.java │ │ ├── Node.java │ │ └── VirtualNode.java │ │ ├── constant │ │ ├── ConfigName.java │ │ ├── DBMsgConstants.java │ │ ├── LoggerName.java │ │ └── PermName.java │ │ ├── consumer │ │ └── ConsumeFromWhere.java │ │ ├── filter │ │ ├── ExpressionType.java │ │ ├── FilterAPI.java │ │ ├── FilterContext.java │ │ ├── MessageFilter.java │ │ └── impl │ │ │ ├── Op.java │ │ │ ├── Operand.java │ │ │ ├── Operator.java │ │ │ ├── PolishExpr.java │ │ │ └── Type.java │ │ ├── help │ │ └── FAQUrl.java │ │ ├── hook │ │ └── FilterCheckHook.java │ │ ├── message │ │ ├── Message.java │ │ ├── MessageAccessor.java │ │ ├── MessageBatch.java │ │ ├── MessageClientExt.java │ │ ├── MessageClientIDSetter.java │ │ ├── MessageConst.java │ │ ├── MessageDecoder.java │ │ ├── MessageExt.java │ │ ├── MessageExtBatch.java │ │ ├── MessageId.java │ │ ├── MessageQueue.java │ │ ├── MessageQueueForC.java │ │ └── MessageType.java │ │ ├── namesrv │ │ ├── NamesrvConfig.java │ │ ├── NamesrvUtil.java │ │ ├── RegisterBrokerResult.java │ │ └── TopAddressing.java │ │ ├── protocol │ │ ├── MQProtosHelper.java │ │ ├── RequestCode.java │ │ ├── ResponseCode.java │ │ ├── body │ │ │ ├── AllMaxOffset.java │ │ │ ├── BrokerStatsData.java │ │ │ ├── BrokerStatsItem.java │ │ │ ├── CMResult.java │ │ │ ├── CheckClientRequestBody.java │ │ │ ├── ClusterInfo.java │ │ │ ├── Connection.java │ │ │ ├── ConsumeByWho.java │ │ │ ├── ConsumeMessageDirectlyResult.java │ │ │ ├── ConsumeQueueData.java │ │ │ ├── ConsumeStatsList.java │ │ │ ├── ConsumeStatus.java │ │ │ ├── ConsumerConnection.java │ │ │ ├── ConsumerOffsetSerializeWrapper.java │ │ │ ├── ConsumerRunningInfo.java │ │ │ ├── GetConsumerStatusBody.java │ │ │ ├── GroupList.java │ │ │ ├── KVTable.java │ │ │ ├── LockBatchRequestBody.java │ │ │ ├── LockBatchResponseBody.java │ │ │ ├── ProcessQueueInfo.java │ │ │ ├── ProducerConnection.java │ │ │ ├── QueryConsumeQueueResponseBody.java │ │ │ ├── QueryConsumeTimeSpanBody.java │ │ │ ├── QueryCorrectionOffsetBody.java │ │ │ ├── QueueTimeSpan.java │ │ │ ├── RegisterBrokerBody.java │ │ │ ├── ResetOffsetBody.java │ │ │ ├── ResetOffsetBodyForC.java │ │ │ ├── SubscriptionGroupWrapper.java │ │ │ ├── TopicConfigSerializeWrapper.java │ │ │ ├── TopicList.java │ │ │ └── UnlockBatchRequestBody.java │ │ ├── header │ │ │ ├── CheckTransactionStateRequestHeader.java │ │ │ ├── CheckTransactionStateResponseHeader.java │ │ │ ├── CloneGroupOffsetRequestHeader.java │ │ │ ├── ConsumeMessageDirectlyResultRequestHeader.java │ │ │ ├── ConsumerSendMsgBackRequestHeader.java │ │ │ ├── CreateTopicRequestHeader.java │ │ │ ├── DeleteSubscriptionGroupRequestHeader.java │ │ │ ├── DeleteTopicRequestHeader.java │ │ │ ├── EndTransactionRequestHeader.java │ │ │ ├── EndTransactionResponseHeader.java │ │ │ ├── GetAllTopicConfigResponseHeader.java │ │ │ ├── GetBrokerConfigResponseHeader.java │ │ │ ├── GetBrokerMaxPhyOffsetResponseHeader.java │ │ │ ├── GetConsumeStatsInBrokerHeader.java │ │ │ ├── GetConsumeStatsRequestHeader.java │ │ │ ├── GetConsumerConnectionListRequestHeader.java │ │ │ ├── GetConsumerListByGroupRequestHeader.java │ │ │ ├── GetConsumerListByGroupResponseBody.java │ │ │ ├── GetConsumerListByGroupResponseHeader.java │ │ │ ├── GetConsumerRunningInfoRequestHeader.java │ │ │ ├── GetConsumerStatusRequestHeader.java │ │ │ ├── GetEarliestMsgStoretimeRequestHeader.java │ │ │ ├── GetEarliestMsgStoretimeResponseHeader.java │ │ │ ├── GetMaxOffsetRequestHeader.java │ │ │ ├── GetMaxOffsetResponseHeader.java │ │ │ ├── GetMinOffsetRequestHeader.java │ │ │ ├── GetMinOffsetResponseHeader.java │ │ │ ├── GetProducerConnectionListRequestHeader.java │ │ │ ├── GetTopicStatsInfoRequestHeader.java │ │ │ ├── GetTopicsByClusterRequestHeader.java │ │ │ ├── NotifyConsumerIdsChangedRequestHeader.java │ │ │ ├── PullMessageRequestHeader.java │ │ │ ├── PullMessageResponseHeader.java │ │ │ ├── QueryConsumeQueueRequestHeader.java │ │ │ ├── QueryConsumeTimeSpanRequestHeader.java │ │ │ ├── QueryConsumerOffsetRequestHeader.java │ │ │ ├── QueryConsumerOffsetResponseHeader.java │ │ │ ├── QueryCorrectionOffsetHeader.java │ │ │ ├── QueryMessageRequestHeader.java │ │ │ ├── QueryMessageResponseHeader.java │ │ │ ├── QueryTopicConsumeByWhoRequestHeader.java │ │ │ ├── ResetOffsetRequestHeader.java │ │ │ ├── SearchOffsetRequestHeader.java │ │ │ ├── SearchOffsetResponseHeader.java │ │ │ ├── SendMessageRequestHeader.java │ │ │ ├── SendMessageRequestHeaderV2.java │ │ │ ├── SendMessageResponseHeader.java │ │ │ ├── UnregisterClientRequestHeader.java │ │ │ ├── UnregisterClientResponseHeader.java │ │ │ ├── UpdateConsumerOffsetRequestHeader.java │ │ │ ├── UpdateConsumerOffsetResponseHeader.java │ │ │ ├── ViewBrokerStatsDataRequestHeader.java │ │ │ ├── ViewMessageRequestHeader.java │ │ │ ├── ViewMessageResponseHeader.java │ │ │ ├── filtersrv │ │ │ │ ├── RegisterFilterServerRequestHeader.java │ │ │ │ ├── RegisterFilterServerResponseHeader.java │ │ │ │ └── RegisterMessageFilterClassRequestHeader.java │ │ │ └── namesrv │ │ │ │ ├── DeleteKVConfigRequestHeader.java │ │ │ │ ├── DeleteTopicInNamesrvRequestHeader.java │ │ │ │ ├── EnableBrokerRoleSwitchRequestHeader.java │ │ │ │ ├── GetKVConfigRequestHeader.java │ │ │ │ ├── GetKVConfigResponseHeader.java │ │ │ │ ├── GetKVListByNamespaceRequestHeader.java │ │ │ │ ├── GetRouteInfoRequestHeader.java │ │ │ │ ├── PutKVConfigRequestHeader.java │ │ │ │ ├── RegisterBrokerRequestHeader.java │ │ │ │ ├── RegisterBrokerResponseHeader.java │ │ │ │ ├── RegisterOrderTopicRequestHeader.java │ │ │ │ ├── UnRegisterBrokerRequestHeader.java │ │ │ │ ├── WipeWritePermOfBrokerRequestHeader.java │ │ │ │ └── WipeWritePermOfBrokerResponseHeader.java │ │ ├── heartbeat │ │ │ ├── ConsumeType.java │ │ │ ├── ConsumerData.java │ │ │ ├── HeartbeatData.java │ │ │ ├── MessageModel.java │ │ │ ├── ProducerData.java │ │ │ └── SubscriptionData.java │ │ ├── route │ │ │ ├── BrokerData.java │ │ │ ├── QueueData.java │ │ │ └── TopicRouteData.java │ │ └── topic │ │ │ └── OffsetMovedEvent.java │ │ ├── queue │ │ ├── ConcurrentTreeMap.java │ │ └── RoundQueue.java │ │ ├── running │ │ └── RunningStats.java │ │ ├── stats │ │ ├── MomentStatsItem.java │ │ ├── MomentStatsItemSet.java │ │ ├── StatsItem.java │ │ ├── StatsItemSet.java │ │ ├── StatsSnapshot.java │ │ └── TimeStats.java │ │ ├── subscription │ │ └── SubscriptionGroupConfig.java │ │ ├── sysflag │ │ ├── MessageSysFlag.java │ │ ├── PullSysFlag.java │ │ ├── SubscriptionSysFlag.java │ │ └── TopicSysFlag.java │ │ └── utils │ │ ├── ChannelUtil.java │ │ ├── HttpTinyClient.java │ │ ├── IOTinyUtils.java │ │ └── ThreadUtils.java │ └── test │ └── java │ └── org │ └── apache │ └── rocketmq │ └── common │ ├── BrokerConfigTest.java │ ├── DataVersionTest.java │ ├── MQVersionTest.java │ ├── MessageBatchTest.java │ ├── MessageEncodeDecodeTest.java │ ├── MixAllTest.java │ ├── RemotingUtilTest.java │ ├── TopicConfigTest.java │ ├── UtilAllTest.java │ ├── filter │ └── FilterAPITest.java │ ├── message │ ├── MessageDecoderTest.java │ └── MessageTest.java │ └── protocol │ └── ConsumeStatusTest.java ├── dev └── merge_rocketmq_pr.py ├── distribution ├── LICENSE-BIN ├── NOTICE-BIN ├── benchmark │ ├── consumer.sh │ ├── producer.sh │ ├── runclass.sh │ └── tproducer.sh ├── bin │ ├── README.md │ ├── cachedog.sh │ ├── cleancache.sh │ ├── cleancache.v1.sh │ ├── mqadmin │ ├── mqadmin.cmd │ ├── mqadmin.xml │ ├── mqbroker │ ├── mqbroker.cmd │ ├── mqbroker.numanode0 │ ├── mqbroker.numanode1 │ ├── mqbroker.numanode2 │ ├── mqbroker.numanode3 │ ├── mqbroker.xml │ ├── mqfiltersrv │ ├── mqfiltersrv.cmd │ ├── mqfiltersrv.xml │ ├── mqnamesrv │ ├── mqnamesrv.cmd │ ├── mqnamesrv.xml │ ├── mqshutdown │ ├── mqshutdown.cmd │ ├── os.sh │ ├── play.cmd │ ├── play.sh │ ├── runbroker │ ├── runbroker.cmd │ ├── runbroker.sh │ ├── runserver.cmd │ ├── runserver.sh │ ├── setcache.sh │ ├── startfsrv.sh │ ├── tools.cmd │ └── tools.sh ├── conf │ ├── 2m-2s-async │ │ ├── broker-a-s.properties │ │ ├── broker-a.properties │ │ ├── broker-b-s.properties │ │ └── broker-b.properties │ ├── 2m-2s-sync │ │ ├── broker-a-s.properties │ │ ├── broker-a.properties │ │ ├── broker-b-s.properties │ │ └── broker-b.properties │ ├── 2m-noslave │ │ ├── broker-a.properties │ │ └── broker-b.properties │ ├── broker.properties │ ├── logback_broker.xml │ ├── logback_filtersrv.xml │ ├── logback_namesrv.xml │ └── logback_tools.xml ├── pom.xml ├── release-client.xml └── release.xml ├── example ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── example │ │ ├── batch │ │ ├── SimpleBatchProducer.java │ │ └── SplitBatchProducer.java │ │ ├── benchmark │ │ ├── Consumer.java │ │ ├── Producer.java │ │ └── TransactionProducer.java │ │ ├── broadcast │ │ └── PushConsumer.java │ │ ├── filter │ │ ├── Consumer.java │ │ ├── Producer.java │ │ ├── SqlConsumer.java │ │ └── SqlProducer.java │ │ ├── openmessaging │ │ ├── SimpleProducer.java │ │ ├── SimplePullConsumer.java │ │ └── SimplePushConsumer.java │ │ ├── operation │ │ ├── Consumer.java │ │ └── Producer.java │ │ ├── ordermessage │ │ ├── Consumer.java │ │ └── Producer.java │ │ ├── quickstart │ │ ├── Consumer.java │ │ └── Producer.java │ │ ├── simple │ │ ├── AsyncProducer.java │ │ ├── CachedQueue.java │ │ ├── Producer.java │ │ ├── PullConsumer.java │ │ ├── PullConsumerTest.java │ │ ├── PullScheduleService.java │ │ ├── PushConsumer.java │ │ ├── RandomAsyncCommit.java │ │ └── TestProducer.java │ │ └── transaction │ │ ├── TransactionCheckListenerImpl.java │ │ ├── TransactionExecuterImpl.java │ │ └── TransactionProducer.java │ └── resources │ └── MessageFilterImpl.java ├── filter ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── filter │ │ ├── FilterFactory.java │ │ ├── FilterSpi.java │ │ ├── SqlFilter.java │ │ ├── constant │ │ └── UnaryType.java │ │ ├── expression │ │ ├── BinaryExpression.java │ │ ├── BooleanExpression.java │ │ ├── ComparisonExpression.java │ │ ├── ConstantExpression.java │ │ ├── EmptyEvaluationContext.java │ │ ├── EvaluationContext.java │ │ ├── Expression.java │ │ ├── LogicExpression.java │ │ ├── MQFilterException.java │ │ ├── NowExpression.java │ │ ├── PropertyExpression.java │ │ ├── UnaryExpression.java │ │ └── UnaryInExpression.java │ │ ├── parser │ │ ├── ParseException.java │ │ ├── SelectorParser.java │ │ ├── SelectorParser.jj │ │ ├── SelectorParserConstants.java │ │ ├── SelectorParserTokenManager.java │ │ ├── SimpleCharStream.java │ │ ├── Token.java │ │ └── TokenMgrError.java │ │ └── util │ │ ├── BitsArray.java │ │ ├── BloomFilter.java │ │ └── BloomFilterData.java │ └── test │ └── java │ └── org │ └── apache │ └── rocketmq │ └── filter │ ├── BitsArrayTest.java │ ├── BloomFilterTest.java │ ├── ExpressionTest.java │ ├── FilterSpiTest.java │ └── ParserTest.java ├── filtersrv ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── apache │ └── rocketmq │ └── filtersrv │ ├── FilterServerOuterAPI.java │ ├── FiltersrvConfig.java │ ├── FiltersrvController.java │ ├── FiltersrvStartup.java │ ├── filter │ ├── DynaCode.java │ ├── FilterClassFetchMethod.java │ ├── FilterClassInfo.java │ ├── FilterClassLoader.java │ ├── FilterClassManager.java │ └── HttpFilterClassFetchMethod.java │ ├── processor │ └── DefaultRequestProcessor.java │ └── stats │ └── FilterServerStatsManager.java ├── logappender ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── logappender │ │ ├── common │ │ └── ProducerInstance.java │ │ ├── log4j │ │ └── RocketmqLog4jAppender.java │ │ ├── log4j2 │ │ └── RocketmqLog4j2Appender.java │ │ └── logback │ │ └── RocketmqLogbackAppender.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── logappender │ │ ├── AbstractTestCase.java │ │ ├── Log4jPropertiesTest.java │ │ ├── Log4jTest.java │ │ ├── Log4jXmlTest.java │ │ ├── LogbackTest.java │ │ └── log4j2Test.java │ └── resources │ ├── log4j-example.properties │ ├── log4j-example.xml │ ├── log4j2-example.xml │ └── logback-example.xml ├── namesrv ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── namesrv │ │ ├── NamesrvController.java │ │ ├── NamesrvStartup.java │ │ ├── ha │ │ ├── Detector.java │ │ ├── HAManager.java │ │ ├── HealthStatus.java │ │ ├── RoleManager.java │ │ └── StateKeeper.java │ │ ├── kvconfig │ │ ├── KVConfigManager.java │ │ └── KVConfigSerializeWrapper.java │ │ ├── processor │ │ ├── ClusterTestRequestProcessor.java │ │ └── DefaultRequestProcessor.java │ │ └── routeinfo │ │ ├── BrokerHousekeepingService.java │ │ └── RouteInfoManager.java │ └── test │ └── java │ └── org │ └── apache │ └── rocketmq │ └── namesrv │ ├── NameServerInstanceTest.java │ ├── ha │ └── HAManagerTest.java │ ├── kvconfig │ ├── KVConfigManagerTest.java │ └── KVConfigSerializeWrapperTest.java │ ├── processor │ ├── ClusterTestRequestProcessorTest.java │ └── DefaultRequestProcessorTest.java │ └── routeinfo │ ├── BrokerHousekeepingServiceTest.java │ └── RouteInfoManagerTest.java ├── openmessaging ├── pom.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── openmessaging │ │ └── rocketmq │ │ ├── MessagingAccessPointImpl.java │ │ ├── config │ │ └── ClientConfig.java │ │ ├── consumer │ │ ├── LocalMessageCache.java │ │ ├── PullConsumerImpl.java │ │ └── PushConsumerImpl.java │ │ ├── domain │ │ ├── BytesMessageImpl.java │ │ ├── ConsumeRequest.java │ │ ├── NonStandardKeys.java │ │ └── SendResultImpl.java │ │ ├── producer │ │ ├── AbstractOMSProducer.java │ │ ├── ProducerImpl.java │ │ └── SequenceProducerImpl.java │ │ ├── promise │ │ ├── DefaultPromise.java │ │ └── FutureState.java │ │ └── utils │ │ ├── BeanUtils.java │ │ └── OMSUtil.java │ └── test │ └── java │ └── io │ └── openmessaging │ └── rocketmq │ ├── consumer │ ├── LocalMessageCacheTest.java │ ├── PullConsumerImplTest.java │ └── PushConsumerImplTest.java │ ├── producer │ ├── ProducerImplTest.java │ └── SequenceProducerImplTest.java │ ├── promise │ └── DefaultPromiseTest.java │ └── utils │ └── BeanUtilsTest.java ├── pom.xml ├── remoting ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── remoting │ │ ├── ChannelEventListener.java │ │ ├── CommandCustomHeader.java │ │ ├── InvokeCallback.java │ │ ├── RPCHook.java │ │ ├── RemotingClient.java │ │ ├── RemotingServer.java │ │ ├── RemotingService.java │ │ ├── annotation │ │ ├── CFNotNull.java │ │ └── CFNullable.java │ │ ├── common │ │ ├── Pair.java │ │ ├── RemotingHelper.java │ │ ├── RemotingUtil.java │ │ ├── SemaphoreReleaseOnlyOnce.java │ │ ├── ServiceThread.java │ │ └── TlsMode.java │ │ ├── exception │ │ ├── RemotingCommandException.java │ │ ├── RemotingConnectException.java │ │ ├── RemotingException.java │ │ ├── RemotingSendRequestException.java │ │ ├── RemotingTimeoutException.java │ │ └── RemotingTooMuchRequestException.java │ │ ├── netty │ │ ├── FileRegionEncoder.java │ │ ├── NettyClientConfig.java │ │ ├── NettyDecoder.java │ │ ├── NettyEncoder.java │ │ ├── NettyEvent.java │ │ ├── NettyEventType.java │ │ ├── NettyRemotingAbstract.java │ │ ├── NettyRemotingClient.java │ │ ├── NettyRemotingServer.java │ │ ├── NettyRequestProcessor.java │ │ ├── NettyServerConfig.java │ │ ├── NettySystemConfig.java │ │ ├── RequestTask.java │ │ ├── ResponseFuture.java │ │ ├── TlsHelper.java │ │ └── TlsSystemConfig.java │ │ └── protocol │ │ ├── LanguageCode.java │ │ ├── RemotingCommand.java │ │ ├── RemotingCommandType.java │ │ ├── RemotingSerializable.java │ │ ├── RemotingSysResponseCode.java │ │ ├── RocketMQSerializable.java │ │ └── SerializeType.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── remoting │ │ ├── RemotingServerTest.java │ │ ├── TlsTest.java │ │ ├── netty │ │ ├── FileRegionEncoderTest.java │ │ ├── NettyRemotingAbstractTest.java │ │ └── NettyRemotingClientTest.java │ │ └── protocol │ │ ├── RemotingCommandTest.java │ │ ├── RemotingSerializableTest.java │ │ └── RocketMQSerializableTest.java │ └── resources │ └── certs │ ├── badClient.key │ ├── badClient.pem │ ├── badServer.key │ ├── badServer.pem │ ├── ca.pem │ ├── client.key │ ├── client.pem │ ├── privkey.pem │ ├── server.key │ └── server.pem ├── srvutil ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── apache │ └── rocketmq │ └── srvutil │ ├── ServerUtil.java │ └── ShutdownHookThread.java ├── store ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── store │ │ ├── AllocateMappedFileService.java │ │ ├── AppendMessageCallback.java │ │ ├── AppendMessageResult.java │ │ ├── AppendMessageStatus.java │ │ ├── CommitLog.java │ │ ├── CommitLogDispatcher.java │ │ ├── ConsumeQueue.java │ │ ├── ConsumeQueueExt.java │ │ ├── DefaultMessageFilter.java │ │ ├── DefaultMessageStore.java │ │ ├── DispatchRequest.java │ │ ├── GetMessageResult.java │ │ ├── GetMessageStatus.java │ │ ├── MappedFile.java │ │ ├── MappedFileQueue.java │ │ ├── MessageArrivingListener.java │ │ ├── MessageExtBrokerInner.java │ │ ├── MessageFilter.java │ │ ├── MessageStore.java │ │ ├── PutMessageLock.java │ │ ├── PutMessageReentrantLock.java │ │ ├── PutMessageResult.java │ │ ├── PutMessageSpinLock.java │ │ ├── PutMessageStatus.java │ │ ├── QueryMessageResult.java │ │ ├── ReferenceResource.java │ │ ├── RunningFlags.java │ │ ├── SelectMappedBufferResult.java │ │ ├── StoreCheckpoint.java │ │ ├── StoreStatsService.java │ │ ├── StoreUtil.java │ │ ├── TransientStorePool.java │ │ ├── config │ │ ├── BrokerRole.java │ │ ├── FlushDiskType.java │ │ ├── MessageStoreConfig.java │ │ └── StorePathConfigHelper.java │ │ ├── ha │ │ ├── HAConnection.java │ │ ├── HAService.java │ │ └── WaitNotifyObject.java │ │ ├── index │ │ ├── IndexFile.java │ │ ├── IndexHeader.java │ │ ├── IndexService.java │ │ └── QueryOffsetResult.java │ │ ├── schedule │ │ ├── DelayOffsetSerializeWrapper.java │ │ └── ScheduleMessageService.java │ │ ├── stats │ │ ├── BrokerStats.java │ │ └── BrokerStatsManager.java │ │ └── util │ │ └── LibC.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── store │ │ ├── AppendCallbackTest.java │ │ ├── ConsumeQueueExtTest.java │ │ ├── ConsumeQueueTest.java │ │ ├── DefaultMessageStoreShuwDownTest.java │ │ ├── DefaultMessageStoreTest.java │ │ ├── MappedFileQueueTest.java │ │ ├── MappedFileTest.java │ │ ├── StoreCheckpointTest.java │ │ └── index │ │ └── IndexFileTest.java │ └── resources │ └── logback.xml ├── style ├── copyright │ ├── Apache.xml │ └── profiles_settings.xml ├── rmq_checkstyle.xml └── rmq_codeStyle.xml ├── test ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── test │ │ ├── client │ │ ├── mq │ │ │ └── MQAsyncProducer.java │ │ └── rmq │ │ │ ├── RMQAsyncSendProducer.java │ │ │ ├── RMQBroadCastConsumer.java │ │ │ ├── RMQNormalConsumer.java │ │ │ ├── RMQNormalProducer.java │ │ │ └── RMQSqlConsumer.java │ │ ├── clientinterface │ │ ├── AbstractMQConsumer.java │ │ ├── AbstractMQProducer.java │ │ ├── MQCollector.java │ │ ├── MQConsumer.java │ │ └── MQProducer.java │ │ ├── factory │ │ ├── ConsumerFactory.java │ │ ├── MQMessageFactory.java │ │ ├── MessageFactory.java │ │ ├── ProducerFactory.java │ │ ├── SendCallBackFactory.java │ │ └── TagMessage.java │ │ ├── listener │ │ ├── AbstractListener.java │ │ └── rmq │ │ │ ├── concurrent │ │ │ ├── RMQDelayListner.java │ │ │ └── RMQNormalListener.java │ │ │ └── order │ │ │ └── RMQOrderListener.java │ │ ├── message │ │ └── MessageQueueMsg.java │ │ ├── sendresult │ │ └── SendResult.java │ │ └── util │ │ ├── Condition.java │ │ ├── DuplicateMessageInfo.java │ │ ├── FileUtil.java │ │ ├── MQAdmin.java │ │ ├── MQRandomUtils.java │ │ ├── MQWait.java │ │ ├── RandomUtil.java │ │ ├── RandomUtils.java │ │ ├── TestUtil.java │ │ ├── TestUtils.java │ │ ├── VerifyUtils.java │ │ ├── data │ │ └── collect │ │ │ ├── DataCollector.java │ │ │ ├── DataCollectorManager.java │ │ │ ├── DataFilter.java │ │ │ └── impl │ │ │ ├── ListDataCollectorImpl.java │ │ │ └── MapDataCollectorImpl.java │ │ └── parallel │ │ ├── ParallelTask.java │ │ ├── ParallelTaskExecutor.java │ │ └── Task4Test.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── rocketmq │ │ └── test │ │ ├── base │ │ ├── BaseConf.java │ │ └── IntegrationTestBase.java │ │ ├── client │ │ ├── consumer │ │ │ ├── balance │ │ │ │ ├── NormalMsgDynamicBalanceIT.java │ │ │ │ └── NormalMsgStaticBalanceIT.java │ │ │ ├── broadcast │ │ │ │ ├── BaseBroadCastIT.java │ │ │ │ ├── normal │ │ │ │ │ ├── BroadCastNormalMsgNotRecvIT.java │ │ │ │ │ ├── BroadCastNormalMsgRecvCrashIT.java │ │ │ │ │ ├── BroadCastNormalMsgRecvFailIT.java │ │ │ │ │ ├── BroadCastNormalMsgRecvStartLaterIT.java │ │ │ │ │ ├── BroadCastNormalMsgTwoDiffGroupRecvIT.java │ │ │ │ │ └── NormalMsgTwoSameGroupConsumerIT.java │ │ │ │ ├── order │ │ │ │ │ └── OrderMsgBroadCastIT.java │ │ │ │ └── tag │ │ │ │ │ ├── BroadCastTwoConsumerFilterIT.java │ │ │ │ │ ├── BroadCastTwoConsumerSubDiffTagIT.java │ │ │ │ │ └── BroadCastTwoConsumerSubTagIT.java │ │ │ ├── cluster │ │ │ │ ├── DynamicAddAndCrashIT.java │ │ │ │ ├── DynamicAddConsumerIT.java │ │ │ │ └── DynamicCrashConsumerIT.java │ │ │ ├── filter │ │ │ │ └── SqlFilterIT.java │ │ │ ├── tag │ │ │ │ ├── MulTagSubIT.java │ │ │ │ ├── TagMessageWith1ConsumerIT.java │ │ │ │ ├── TagMessageWithMulConsumerIT.java │ │ │ │ └── TagMessageWithSameGroupConsumerIT.java │ │ │ └── topic │ │ │ │ ├── MulConsumerMulTopicIT.java │ │ │ │ └── OneConsumerMulTopicIT.java │ │ └── producer │ │ │ ├── async │ │ │ ├── AsyncSendExceptionIT.java │ │ │ ├── AsyncSendWithMessageQueueIT.java │ │ │ ├── AsyncSendWithMessageQueueSelectorIT.java │ │ │ └── AsyncSendWithOnlySendCallBackIT.java │ │ │ ├── batch │ │ │ └── BatchSendIT.java │ │ │ ├── exception │ │ │ ├── msg │ │ │ │ ├── ChinaPropIT.java │ │ │ │ ├── MessageExceptionIT.java │ │ │ │ └── MessageUserPropIT.java │ │ │ └── producer │ │ │ │ └── ProducerGroupAndInstanceNameValidityIT.java │ │ │ ├── oneway │ │ │ ├── OneWaySendExceptionIT.java │ │ │ ├── OneWaySendIT.java │ │ │ ├── OneWaySendWithMQIT.java │ │ │ └── OneWaySendWithSelectorIT.java │ │ │ ├── order │ │ │ ├── OrderMsgDynamicRebalanceIT.java │ │ │ ├── OrderMsgIT.java │ │ │ ├── OrderMsgRebalanceIT.java │ │ │ └── OrderMsgWithTagIT.java │ │ │ └── querymsg │ │ │ ├── QueryMsgByIdExceptionIT.java │ │ │ ├── QueryMsgByIdIT.java │ │ │ └── QueryMsgByKeyIT.java │ │ ├── delay │ │ ├── DelayConf.java │ │ └── NormalMsgDelayIT.java │ │ ├── smoke │ │ └── NormalMessageSendAndRecvIT.java │ │ └── tls │ │ ├── TLS_IT.java │ │ ├── TLS_Mix2_IT.java │ │ └── TLS_Mix_IT.java │ └── resources │ ├── log4j.xml │ └── logback-test.xml └── tools ├── pom.xml └── src ├── main └── java │ └── org │ └── apache │ └── rocketmq │ └── tools │ ├── admin │ ├── DefaultMQAdminExt.java │ ├── DefaultMQAdminExtImpl.java │ ├── MQAdminExt.java │ └── api │ │ ├── MessageTrack.java │ │ └── TrackType.java │ ├── command │ ├── CommandUtil.java │ ├── MQAdminStartup.java │ ├── SubCommand.java │ ├── SubCommandException.java │ ├── broker │ │ ├── BrokerConsumeStatsSubCommad.java │ │ ├── BrokerStatusSubCommand.java │ │ ├── CleanExpiredCQSubCommand.java │ │ ├── CleanUnusedTopicCommand.java │ │ ├── GetBrokerConfigCommand.java │ │ ├── SendMsgStatusCommand.java │ │ └── UpdateBrokerConfigSubCommand.java │ ├── cluster │ │ ├── CLusterSendMsgRTCommand.java │ │ └── ClusterListSubCommand.java │ ├── connection │ │ ├── ConsumerConnectionSubCommand.java │ │ └── ProducerConnectionSubCommand.java │ ├── consumer │ │ ├── ConsumerProgressSubCommand.java │ │ ├── ConsumerStatusSubCommand.java │ │ ├── ConsumerSubCommand.java │ │ ├── DeleteSubscriptionGroupCommand.java │ │ ├── StartMonitoringSubCommand.java │ │ └── UpdateSubGroupSubCommand.java │ ├── message │ │ ├── CheckMsgSendRTCommand.java │ │ ├── DecodeMessageIdCommond.java │ │ ├── PrintMessageByQueueCommand.java │ │ ├── PrintMessageSubCommand.java │ │ ├── QueryMsgByIdSubCommand.java │ │ ├── QueryMsgByKeySubCommand.java │ │ ├── QueryMsgByOffsetSubCommand.java │ │ └── QueryMsgByUniqueKeySubCommand.java │ ├── namesrv │ │ ├── DeleteKvConfigCommand.java │ │ ├── EnableBrokerRoleSwitchCommand.java │ │ ├── GetNamesrvConfigCommand.java │ │ ├── UpdateKvConfigCommand.java │ │ ├── UpdateNamesrvConfigCommand.java │ │ └── WipeWritePermSubCommand.java │ ├── offset │ │ ├── CloneGroupOffsetCommand.java │ │ ├── GetConsumerStatusCommand.java │ │ ├── ResetOffsetByTimeCommand.java │ │ └── ResetOffsetByTimeOldCommand.java │ ├── queue │ │ └── QueryConsumeQueueCommand.java │ ├── stats │ │ └── StatsAllSubCommand.java │ └── topic │ │ ├── AllocateMQSubCommand.java │ │ ├── DeleteTopicSubCommand.java │ │ ├── RebalanceResult.java │ │ ├── TopicClusterSubCommand.java │ │ ├── TopicListSubCommand.java │ │ ├── TopicRouteSubCommand.java │ │ ├── TopicStatusSubCommand.java │ │ ├── UpdateOrderConfCommand.java │ │ ├── UpdateTopicPermSubCommand.java │ │ └── UpdateTopicSubCommand.java │ └── monitor │ ├── DefaultMonitorListener.java │ ├── DeleteMsgsEvent.java │ ├── FailedMsgs.java │ ├── MonitorConfig.java │ ├── MonitorListener.java │ ├── MonitorService.java │ └── UndoneMsgs.java └── test └── java └── org └── apache └── rocketmq └── tools ├── admin ├── DefaultMQAdminExtImplTest.java └── DefaultMQAdminExtTest.java ├── command ├── CommandUtilTest.java ├── broker │ ├── BrokerConsumeStatsSubCommadTest.java │ ├── BrokerStatusSubCommandTest.java │ ├── CleanExpiredCQSubCommandTest.java │ ├── CleanUnusedTopicCommandTest.java │ ├── GetBrokerConfigCommandTest.java │ ├── SendMsgStatusCommandTest.java │ └── UpdateBrokerConfigSubCommandTest.java ├── connection │ ├── ConsumerConnectionSubCommandTest.java │ └── ProducerConnectionSubCommandTest.java ├── consumer │ ├── ConsumerProgressSubCommandTest.java │ └── ConsumerStatusSubCommandTest.java ├── namesrv │ ├── GetNamesrvConfigCommandTest.java │ └── WipeWritePermSubCommandTest.java ├── offset │ ├── GetConsumerStatusCommandTest.java │ ├── ResetOffsetByTimeCommandTest.java │ └── ResetOffsetByTimeOldCommandTest.java └── topic │ ├── AllocateMQSubCommandTest.java │ ├── DeleteTopicSubCommandTest.java │ ├── TopicClusterSubCommandTest.java │ ├── TopicRouteSubCommandTest.java │ ├── TopicStatusSubCommandTest.java │ ├── UpdateOrderConfCommandTest.java │ ├── UpdateTopicPermSubCommandTest.java │ └── UpdateTopicSubCommandTest.java └── monitor ├── DefaultMonitorListenerTest.java └── MonitorServiceTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | *.tar.gz 2 | *.iml 3 | **/target 4 | **/output 5 | **/logs 6 | *.idea 7 | *.jar 8 | *.DS_Store 9 | -------------------------------------------------------------------------------- /carrera-chronos/README.md: -------------------------------------------------------------------------------- 1 | **English** | [中文](./README_CN.md) 2 | ## DDMQ Chronos ## 3 | 4 | Chronos is the delay message module of DDMQ. Chronos provides massive delay message storage and uses RocksDB as underlying storage. 5 | 6 | ### Features ### 7 | 8 | * Rich message type: delay message, delay-loop message and transactional message. 9 | * high availability & high reliability. 10 | * Easy-to-use: use the same SDK and console as realtime message. 11 | * Huge Volume: use disk as storage. 12 | 13 | ### Architecture ### 14 | 15 |
16 | 17 |
18 | 19 | 20 | ### Deploy ### 21 | * create inner topic and inner group in Console 22 | * modify chronos.yaml 23 | * run ```build.sh``` to build package 24 | * start chronos with ```control.sh start``` -------------------------------------------------------------------------------- /carrera-chronos/README_CN.md: -------------------------------------------------------------------------------- 1 | [English](./README.md) | **中文** 2 | ## DDMQ Chronos ## 3 | 4 | Chronos 是 DDMQ 的延迟消息模块,提供了可靠的海量延迟消息存储。Chronos 使用 RocksDB 作为延迟消息的存储引擎。 5 | 6 | ### 特性 ### 7 | 8 | * 消息类型丰富:延迟消息、循环延迟消息、事务消息(解决子系统之间或跨库事务问题) 9 | * 高可用 & 高可靠:主备自动切换及多副本 10 | * 接入简单:深度整合到 DDMQ,和实时使用同一套生产消费 SDK、同一套用户控制台 11 | * 容量大:底层是硬盘存储 12 | 13 | ### 架构 ### 14 | 15 |
16 | 17 |
18 | 19 | 20 | 开发者使用 DDMQ 的生产 SDK 将延迟消息生产到 PProxy 中,然后 PProxy 会将延迟消息写入到提前配置好的 inner topic 中。之后 Chronos 会消费 inner topic 的消息并存储到内置的 RocksDB 存储引擎中。Chronos 内置的时间轮服务会将到期的消息再次发送给 DDMQ 供业务方消费。 21 | 22 | ### 部署 ### 23 | * 控制台上申请 inner topic 和 group 24 | * 修改 chronos.yaml 的配置 25 | * 执行 ```build.sh``` 脚本打包 26 | * 执行 ```control.sh start``` 启动 -------------------------------------------------------------------------------- /carrera-chronos/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASEDIR=$(dirname "$0") 4 | cd ${BASEDIR} 5 | WKDIR=`pwd` 6 | cd ${BASEDIR} 7 | 8 | mvn -U clean assembly:assembly -Dmaven.test.skip=true 9 | ret=$? 10 | if [ $ret -ne 0 ];then 11 | echo "===== maven build failure =====" 12 | exit $ret 13 | else 14 | echo -n "===== maven build successfully! =====" 15 | fi 16 | 17 | OUTPATH=${WKDIR}/output 18 | mkdir -p ${OUTPATH} 19 | mkdir -p ${OUTPATH}/conf 20 | cp control.sh ${OUTPATH}/ 21 | cp src/main/resources/*.yaml ${OUTPATH}/conf/ 22 | cp src/main/resources/log4j2.xml ${OUTPATH}/conf/ 23 | cp target/chronos-*-SNAPSHOT-jar-with-dependencies.jar ${OUTPATH}/ 24 | -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/enums/BackupState.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.enums; 2 | 3 | 4 | public enum BackupState { 5 | SUCCESS("success"), FAIL("fail for exception when backup"), BEING_BACKUP("can not backup for last backup not finish"), ERROR("error"); 6 | 7 | private String desc; 8 | 9 | BackupState(String desc) { 10 | this.desc = desc; 11 | } 12 | 13 | public String getDesc() { 14 | return desc; 15 | } 16 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/enums/CFHandlerNames.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.enums; 2 | 3 | 4 | public enum CFHandlerNames { 5 | DEFAULT("default"), META("meta"); 6 | 7 | private String name; 8 | 9 | CFHandlerNames(String name) { 10 | this.name = name; 11 | } 12 | 13 | public String getName() { 14 | return name; 15 | } 16 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/enums/RestoreState.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.enums; 2 | 3 | 4 | public enum RestoreState { 5 | SUCCESS("success"), FAIL("fail for exception when restore"), BEING_RESTORE("can not restore for last restore not finish"), ERROR("error"); 6 | 7 | private String desc; 8 | 9 | RestoreState(String desc) { 10 | this.desc = desc; 11 | } 12 | 13 | public String getDesc() { 14 | return desc; 15 | } 16 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/enums/ServerState.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.enums; 2 | 3 | 4 | public enum ServerState { 5 | LOOKING, MASTERING, BACKUPING; 6 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/http/ServerInitializer.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.http; 2 | 3 | import io.netty.channel.ChannelInitializer; 4 | import io.netty.channel.ChannelPipeline; 5 | import io.netty.channel.socket.SocketChannel; 6 | import io.netty.handler.codec.http.HttpObjectAggregator; 7 | import io.netty.handler.codec.http.HttpServerCodec; 8 | 9 | 10 | public class ServerInitializer extends ChannelInitializer { 11 | @Override 12 | protected void initChannel(SocketChannel ch) throws Exception { 13 | ChannelPipeline p = ch.pipeline(); 14 | p.addLast(new HttpServerCodec()); /*HTTP 服务的解码器*/ 15 | p.addLast(new HttpObjectAggregator(65536)); /*HTTP 消息的合并处理*/ 16 | p.addLast(new NettyHttpServerHandler()); 17 | } 18 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/metrics/MetricMsgAction.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.metrics; 2 | 3 | 4 | public enum MetricMsgAction { 5 | UNKNOWN("unknown"), 6 | ADD("add"), 7 | ADD_INNER("add_inner"), 8 | CANCEL("cancel"), 9 | CANCEL_INNER("cancel_inner"); 10 | 11 | private String value; 12 | 13 | MetricMsgAction(String value) { 14 | this.value = value; 15 | } 16 | 17 | public String getValue() { 18 | return value; 19 | } 20 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/metrics/MetricMsgToOrFrom.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.metrics; 2 | 3 | 4 | public enum MetricMsgToOrFrom { 5 | UNKNOWN("unknown"), 6 | DB("db"), 7 | SEND("send"); 8 | 9 | private String value; 10 | 11 | MetricMsgToOrFrom(String value) { 12 | this.value = value; 13 | } 14 | 15 | public String getValue() { 16 | return value; 17 | } 18 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/metrics/MetricMsgType.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.metrics; 2 | 3 | 4 | public enum MetricMsgType { 5 | UNKNOWN("unknown"), 6 | DELAY("delay"), 7 | LOOP_DELAY("loop_delay"), 8 | LOOP_EXPONENT_DELAY("loop_exponent_delay"); 9 | 10 | private String value; 11 | 12 | MetricMsgType(String value) { 13 | this.value = value; 14 | } 15 | 16 | public String getValue() { 17 | return value; 18 | } 19 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/metrics/MetricPullMsgResult.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.metrics; 2 | 3 | 4 | public enum MetricPullMsgResult { 5 | VALID("valid"), INVALID("invalid"); 6 | 7 | private String value; 8 | 9 | MetricPullMsgResult(String value) { 10 | this.value = value; 11 | } 12 | 13 | public String getValue() { 14 | return value; 15 | } 16 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/metrics/MetricPushMsgResult.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.metrics; 2 | 3 | 4 | public enum MetricPushMsgResult { 5 | OK("ok"), FAIL("fail"), BACKUP("backup"); 6 | 7 | private String value; 8 | 9 | MetricPushMsgResult(String value) { 10 | this.value = value; 11 | } 12 | 13 | public String getValue() { 14 | return value; 15 | } 16 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/metrics/MetricWriteMsgResult.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.metrics; 2 | 3 | 4 | public enum MetricWriteMsgResult { 5 | OK("ok"), FAIL("fail"); 6 | 7 | private String value; 8 | 9 | MetricWriteMsgResult(String value) { 10 | this.value = value; 11 | } 12 | 13 | public String getValue() { 14 | return value; 15 | } 16 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/utils/ByteUtils.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.utils; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | 7 | 8 | public class ByteUtils { 9 | 10 | public static List divideArray(byte[] source, int chunkSize) { 11 | List result = new ArrayList(); 12 | int start = 0; 13 | while (start < source.length) { 14 | int end = Math.min(source.length, start + chunkSize); 15 | result.add(Arrays.copyOfRange(source, start, end)); 16 | start += chunkSize; 17 | } 18 | 19 | return result; 20 | } 21 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/utils/CloseUtils.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.utils; 2 | 3 | import java.io.Closeable; 4 | import java.io.IOException; 5 | 6 | 7 | public final class CloseUtils { 8 | 9 | private CloseUtils() { 10 | throw new UnsupportedOperationException("u can't instantiate me..."); 11 | } 12 | 13 | /** 14 | * 关闭 IO 15 | * 16 | * @param closeables closeables 17 | */ 18 | public static void closeIO(final Closeable... closeables) { 19 | if (closeables == null) return; 20 | for (Closeable closeable : closeables) { 21 | if (closeable != null) { 22 | try { 23 | closeable.close(); 24 | } catch (IOException e) { 25 | e.printStackTrace(); 26 | } 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /carrera-chronos/src/main/java/com/xiaojukeji/chronos/utils/LogUtils.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.chronos.utils; 2 | 3 | import org.slf4j.Logger; 4 | 5 | import static org.slf4j.LoggerFactory.getLogger; 6 | 7 | 8 | public class LogUtils { 9 | public static final Logger SWITCH_LOGGER = getLogger("SwitchLogger"); 10 | public static final Logger METRIC_LOGGER = getLogger("MetricLogger"); 11 | public static final Logger BACKUP_RESTORE_LOGGER = getLogger("BackupRestoreLogger"); 12 | } -------------------------------------------------------------------------------- /carrera-chronos/src/test/java/com/xiaoju/chronos/TestPullService.java: -------------------------------------------------------------------------------- 1 | package com.xiaoju.chronos; 2 | 3 | import com.xiaojukeji.chronos.config.ConfigManager; 4 | import com.xiaojukeji.chronos.db.RDB; 5 | import org.junit.AfterClass; 6 | import org.junit.BeforeClass; 7 | 8 | 9 | public class TestPullService { 10 | private static String dbPath = "/Users/didi/rocks_db"; 11 | private static String configPath = "/Users/didi/work/carrera-chronos/src/main/resources/chronos.yaml"; 12 | 13 | @BeforeClass 14 | public static void init() { 15 | ConfigManager.initConfig(configPath); 16 | RDB.init(dbPath); 17 | } 18 | 19 | @AfterClass 20 | public static void destructor() { 21 | RDB.close(); 22 | } 23 | } -------------------------------------------------------------------------------- /carrera-chronos/src/test/java/com/xiaoju/chronos/other/TestOther.java: -------------------------------------------------------------------------------- 1 | package com.xiaoju.chronos.other; 2 | 3 | import com.xiaojukeji.chronos.utils.JsonUtils; 4 | import org.junit.Test; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | 10 | public class TestOther { 11 | 12 | @Test 13 | public void testJson() { 14 | Map map = new HashMap<>(); 15 | map.put("a_1", 1000L); 16 | map.put("b_1", 2000L); 17 | 18 | System.out.println(JsonUtils.toJsonString(map)); 19 | } 20 | } -------------------------------------------------------------------------------- /carrera-common/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/didi/DDMQ/2f30b61a5741d55a5b515f3d8d19a8a35be8c9e2/carrera-common/README.md -------------------------------------------------------------------------------- /carrera-common/src/main/java/com/xiaojukeji/carrera/biz/ProxyService.java: -------------------------------------------------------------------------------- 1 | package com.xiaojukeji.carrera.biz; 2 | 3 | import com.xiaojukeji.carrera.dynamic.ParameterDynamicZookeeper; 4 | 5 | import java.util.Set; 6 | 7 | 8 | public interface ProxyService { 9 | 10 | void getAndWatchIndex(Set 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | --------------------------------------------------------------------------------