change hmily-tars maven structure. fix a bug about tars beanpostprocessor (#210)

* add tars springboot demo

* add tars springboot ide config file

* add hmily-tars module

* add hmily tars demo

* support spring and springboot

* mod tars demo

* mod tars structure.add ConsistentHashLoadBalance.

* change hmily-tars maven structure. fix a bug about tars beanpostprocessor

Co-authored-by: duojiao <yudong.tang@perfma.com>
This commit is contained in:
tydhot 2020-10-04 11:49:09 +08:00 committed by GitHub
parent c1d66b487b
commit aeeee26183
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 6 deletions

View File

@ -26,7 +26,7 @@
<dependency>
<groupId>com.tencent.tars</groupId>
<artifactId>tars-spring-boot-starter</artifactId>
<artifactId>tars-spring</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>

View File

@ -10,8 +10,8 @@ import com.qq.tars.spring.annotation.TarsClient;
import org.dromara.hmily.tars.loadbalance.HmilyLoadBalance;
import org.dromara.hmily.tars.loadbalance.HmilyRoundRobinLoadBalance;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.ReflectionUtils;
@ -22,7 +22,7 @@ import java.lang.reflect.Field;
*
* @author tydhot
*/
public class TarsHmilyCommunicatorBeanPostProcessor implements MergedBeanDefinitionPostProcessor {
public class TarsHmilyCommunicatorBeanPostProcessor implements BeanPostProcessor, Ordered {
private final Communicator communicator;
@ -86,7 +86,7 @@ public class TarsHmilyCommunicatorBeanPostProcessor implements MergedBeanDefinit
}
@Override
public void postProcessMergedBeanDefinition(final RootBeanDefinition rootBeanDefinition, final Class<?> aClass, final String s) {
public int getOrder() {
return 0;
}
}

View File

@ -24,10 +24,44 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.tencent.tars</groupId>
<artifactId>tars-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>hmily-tars</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>com.tencent.tars</groupId>
<artifactId>tars-spring</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>