diff --git a/hippo4j-adapter/hippo4j-adapter-rocketmq/pom.xml b/hippo4j-adapter/hippo4j-adapter-rocketmq/pom.xml new file mode 100644 index 00000000..2e354913 --- /dev/null +++ b/hippo4j-adapter/hippo4j-adapter-rocketmq/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + + cn.hippo4j + hippo4j-adapter + ${revision} + + hippo4j-adapter-rocketmq + + + + cn.hippo4j + hippo4j-adapter-base + + + + org.apache.rocketmq + rocketmq-spring-boot-starter + ${rocketmq.version} + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${project.artifactId} + ${project.version} + ${maven.build.timestamp} + chen.ma + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + + + jar + + + + + + + diff --git a/hippo4j-adapter/hippo4j-adapter-rocketmq/src/main/java/cn/hippo4j/adapter/rocketmq/RocketMQThreadPoolAdapter.java b/hippo4j-adapter/hippo4j-adapter-rocketmq/src/main/java/cn/hippo4j/adapter/rocketmq/RocketMQThreadPoolAdapter.java new file mode 100644 index 00000000..3cea35c9 --- /dev/null +++ b/hippo4j-adapter/hippo4j-adapter-rocketmq/src/main/java/cn/hippo4j/adapter/rocketmq/RocketMQThreadPoolAdapter.java @@ -0,0 +1,35 @@ +package cn.hippo4j.adapter.rocketmq; + +import cn.hippo4j.adapter.base.ThreadPoolAdapter; +import cn.hippo4j.adapter.base.ThreadPoolAdapterParameter; +import cn.hippo4j.adapter.base.ThreadPoolAdapterState; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.context.event.ApplicationStartedEvent; +import org.springframework.context.ApplicationListener; + +/** + * RocketMQ thread-pool adapter. + */ +@Slf4j +public class RocketMQThreadPoolAdapter implements ThreadPoolAdapter, ApplicationListener { + + @Override + public String mark() { + return "RocketMQ"; + } + + @Override + public ThreadPoolAdapterState getThreadPoolState(String identify) { + return null; + } + + @Override + public boolean updateThreadPool(ThreadPoolAdapterParameter threadPoolAdapterParameter) { + return false; + } + + @Override + public void onApplicationEvent(ApplicationStartedEvent event) { + + } +} diff --git a/hippo4j-adapter/pom.xml b/hippo4j-adapter/pom.xml index 293c49ee..ddabe668 100644 --- a/hippo4j-adapter/pom.xml +++ b/hippo4j-adapter/pom.xml @@ -16,6 +16,7 @@ hippo4j-adapter-base + hippo4j-adapter-rocketmq hippo4j-adapter-spring-cloud-stream-rocketmq diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-all/pom.xml b/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-all/pom.xml index df075e78..2846cc2f 100644 --- a/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-all/pom.xml +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-all/pom.xml @@ -15,5 +15,11 @@ hippo4j-spring-boot-starter-adapter-spring-cloud-stream-rocketmq ${revision} + + + cn.hippo4j + hippo4j-spring-boot-starter-adapter-rocketmq + ${revision} + diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-rocketmq/pom.xml b/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-rocketmq/pom.xml new file mode 100644 index 00000000..693efa0d --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-rocketmq/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + cn.hippo4j + hippo4j-spring-boot-starter-adapter + ${revision} + + hippo4j-spring-boot-starter-adapter-rocketmq + + + + cn.hippo4j + hippo4j-adapter-rocketmq + + + diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-rocketmq/src/main/java/cn/hippo4j/springboot/starter/adapter/rocketmq/RocketMQAutoConfiguration.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-rocketmq/src/main/java/cn/hippo4j/springboot/starter/adapter/rocketmq/RocketMQAutoConfiguration.java new file mode 100644 index 00000000..59377e88 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-rocketmq/src/main/java/cn/hippo4j/springboot/starter/adapter/rocketmq/RocketMQAutoConfiguration.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cn.hippo4j.springboot.starter.adapter.rocketmq; + +import cn.hippo4j.adapter.rocketmq.RocketMQThreadPoolAdapter; +import cn.hippo4j.common.config.ApplicationContextHolder; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * RocketMQ auto configuration. + */ +@Configuration +public class RocketMQAutoConfiguration { + + @Bean + @ConditionalOnMissingBean + public ApplicationContextHolder simpleApplicationContextHolder() { + return new ApplicationContextHolder(); + } + + @Bean + @SuppressWarnings("all") + @ConditionalOnProperty(name = "rocketmq.name-server") + public RocketMQThreadPoolAdapter rocketMQThreadPoolAdapter(ApplicationContextHolder applicationContextHolder) { + return new RocketMQThreadPoolAdapter(); + } +} diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-rocketmq/src/main/resources/META-INF/spring.factories b/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-rocketmq/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000..f49f0f70 --- /dev/null +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter-adapter/hippo4j-spring-boot-starter-adapter-rocketmq/src/main/resources/META-INF/spring.factories @@ -0,0 +1 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.hippo4j.springboot.starter.adapter.rocketmq.RocketMQAutoConfiguration diff --git a/pom.xml b/pom.xml index 26c06695..19a5c842 100644 --- a/pom.xml +++ b/pom.xml @@ -47,6 +47,7 @@ 3.4.2 2.3.2.RELEASE 1.9.1 + 2.2.2 2.2.6.RELEASE false @@ -145,6 +146,12 @@ ${revision} + + cn.hippo4j + hippo4j-adapter-rocketmq + ${revision} + + com.baomidou mybatis-plus-boot-starter