pull/1765/head
shedfreewu 2 months ago
parent 021a7f6ea2
commit 297f974b95

@ -242,7 +242,7 @@
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-kafka-lane-plugin</artifactId>
<artifactId>spring-cloud-starter-tencent-message-queue-plugin</artifactId>
<version>${revision}</version>
</dependency>

@ -26,7 +26,7 @@
<module>spring-cloud-starter-tencent-multi-discovery-plugin</module>
<module>spring-cloud-starter-tencent-traffic-mirroring-plugin</module>
<module>spring-cloud-starter-tencent-fault-injection-plugin</module>
<module>spring-cloud-starter-tencent-kafka-lane-plugin</module>
<module>spring-cloud-starter-tencent-message-queue-plugin</module>
</modules>
</project>

@ -1,2 +0,0 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.tencent.cloud.plugin.kafka.KafkaLaneAspectConfiguration

@ -10,26 +10,11 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-starter-tencent-kafka-lane-plugin</artifactId>
<artifactId>spring-cloud-starter-tencent-message-queue-plugin</artifactId>
<name>Spring Cloud Starter Tencent Kafka Lane plugin</name>
<dependencies>
<dependency>
<groupId>com.tencent.polaris</groupId>
<artifactId>polaris-all</artifactId>
</dependency>
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-commons</artifactId>
</dependency>
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-polaris-context</artifactId>
</dependency>
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-discovery</artifactId>
@ -60,7 +45,6 @@
<optional>true</optional>
</dependency>
</dependencies>
</project>

@ -15,7 +15,7 @@
* specific language governing permissions and limitations under the License.
*/
package com.tencent.cloud.plugin.kafka;
package com.tencent.cloud.plugin.lane.kafka;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
@ -28,7 +28,7 @@ import java.util.Set;
import com.tencent.cloud.common.metadata.MetadataContext;
import com.tencent.cloud.common.metadata.MetadataContextHolder;
import com.tencent.cloud.common.tsf.TsfContextUtils;
import com.tencent.cloud.plugin.kafka.tsf.TsfActiveLane;
import com.tencent.cloud.plugin.lane.tsf.TsfActiveLane;
import com.tencent.cloud.polaris.context.PolarisSDKContextManager;
import com.tencent.polaris.api.pojo.ServiceKey;
import com.tencent.polaris.api.utils.StringUtils;

@ -15,15 +15,16 @@
* specific language governing permissions and limitations under the License.
*/
package com.tencent.cloud.plugin.kafka;
package com.tencent.cloud.plugin.lane.kafka;
import com.tencent.cloud.common.tsf.ConditionalOnOnlyTsfConsulEnabled;
import com.tencent.cloud.plugin.kafka.tsf.TsfActiveLane;
import com.tencent.cloud.plugin.lane.tsf.TsfActiveLane;
import com.tencent.cloud.polaris.context.PolarisSDKContextManager;
import com.tencent.cloud.polaris.discovery.PolarisDiscoveryHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -41,6 +42,7 @@ public class KafkaLaneAspectConfiguration {
@Bean
@ConditionalOnClass(name = {"org.springframework.kafka.core.KafkaTemplate"})
@ConditionalOnMissingBean
@ConditionalOnOnlyTsfConsulEnabled
public TsfActiveLane tsfActiveLane(PolarisSDKContextManager polarisSDKContextManager, PolarisDiscoveryHandler discoveryClient) {
return new TsfActiveLane(polarisSDKContextManager, discoveryClient);

@ -15,7 +15,7 @@
* specific language governing permissions and limitations under the License.
*/
package com.tencent.cloud.plugin.kafka;
package com.tencent.cloud.plugin.lane.kafka;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations under the License.
*/
package com.tencent.cloud.plugin.kafka.tsf;
package com.tencent.cloud.plugin.lane.tsf;
import java.util.HashMap;
import java.util.HashSet;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations under the License.
*/
package com.tencent.cloud.plugin.kafka.tsf;
package com.tencent.cloud.plugin.lane.tsf;
import com.tencent.polaris.api.plugin.registry.AbstractResourceEventListener;
import com.tencent.polaris.api.pojo.RegistryCacheValue;

@ -0,0 +1,2 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.tencent.cloud.plugin.lane.kafka.KafkaLaneAspectConfiguration

@ -15,13 +15,13 @@
* specific language governing permissions and limitations under the License.
*/
package com.tencent.cloud.plugin.kafka;
package com.tencent.cloud.plugin.lane.kafka;
import java.lang.reflect.Field;
import java.util.concurrent.atomic.AtomicBoolean;
import com.tencent.cloud.common.tsf.TsfContextUtils;
import com.tencent.cloud.plugin.kafka.tsf.TsfActiveLane;
import com.tencent.cloud.plugin.lane.tsf.TsfActiveLane;
import com.tencent.cloud.polaris.context.PolarisSDKContextManager;
import com.tencent.cloud.polaris.discovery.PolarisDiscoveryHandler;
import org.junit.jupiter.api.AfterEach;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations under the License.
*/
package com.tencent.cloud.plugin.kafka;
package com.tencent.cloud.plugin.lane.kafka;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
@ -25,7 +25,7 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import com.tencent.cloud.common.tsf.TsfContextUtils;
import com.tencent.cloud.plugin.kafka.tsf.TsfActiveLane;
import com.tencent.cloud.plugin.lane.tsf.TsfActiveLane;
import com.tencent.cloud.polaris.context.PolarisSDKContextManager;
import com.tencent.polaris.plugins.router.lane.LaneUtils;
import org.apache.kafka.clients.consumer.ConsumerRecord;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations under the License.
*/
package com.tencent.cloud.plugin.kafka;
package com.tencent.cloud.plugin.lane.kafka;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
@ -26,7 +26,7 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import com.tencent.cloud.common.tsf.TsfContextUtils;
import com.tencent.cloud.plugin.kafka.tsf.TsfActiveLane;
import com.tencent.cloud.plugin.lane.tsf.TsfActiveLane;
import com.tencent.cloud.polaris.context.PolarisSDKContextManager;
import com.tencent.polaris.plugins.router.lane.LaneUtils;
import org.apache.kafka.clients.consumer.ConsumerRecord;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations under the License.
*/
package com.tencent.cloud.plugin.kafka.tsf;
package com.tencent.cloud.plugin.lane.tsf;
import java.util.Arrays;
import java.util.Collections;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations under the License.
*/
package com.tencent.cloud.plugin.kafka.tsf;
package com.tencent.cloud.plugin.lane.tsf;
import com.tencent.polaris.api.pojo.RegistryCacheValue;
import com.tencent.polaris.api.pojo.ServiceEventKey;
Loading…
Cancel
Save