Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/sync.yml
  • Loading branch information
guoshiqiufeng committed Feb 5, 2024
2 parents 7532cb0 + 545b8ff commit e3a1c45
Show file tree
Hide file tree
Showing 18 changed files with 95 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.gradle
build/
!.mvn/wrapper/maven-wrapper.jar
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONUtil;
import io.github.guoshiqiufeng.loki.support.core.ProducerRecord;
import io.github.guoshiqiufeng.loki.support.core.ProducerResult;
import io.github.guoshiqiufeng.loki.support.core.producer.ProducerRecord;
import io.github.guoshiqiufeng.loki.support.core.producer.ProducerResult;
import io.github.guoshiqiufeng.loki.support.kafka.KafkaClient;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONUtil;
import io.github.guoshiqiufeng.loki.support.core.LokiClient;
import io.github.guoshiqiufeng.loki.support.core.ProducerRecord;
import io.github.guoshiqiufeng.loki.support.core.ProducerResult;
import io.github.guoshiqiufeng.loki.support.core.producer.ProducerRecord;
import io.github.guoshiqiufeng.loki.support.core.producer.ProducerResult;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONUtil;
import io.github.guoshiqiufeng.loki.support.core.ProducerRecord;
import io.github.guoshiqiufeng.loki.support.core.ProducerResult;
import io.github.guoshiqiufeng.loki.support.core.producer.ProducerRecord;
import io.github.guoshiqiufeng.loki.support.core.producer.ProducerResult;
import io.github.guoshiqiufeng.loki.support.rocketmq.remoting.RocketRemotingClient;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public interface TestMapper extends BaseMapper<TestEntity> {
@SendMessage(topic = "loki", tag = "custom", async = true, message = "#entity.message", messageKey = "#entity.id")
CompletableFuture<String> customAsyncSend(TestEntity entity);

@SendMessage(topic = "lokiDelay", tag = "custom", message = "#entity.message", deliveryTimestamp = 23 * 1000,messageKey = "#entity.id")
@SendMessage(topic = "lokiDelay", tag = "custom", message = "#entity.message", deliveryTimestamp = 23 * 1000, messageKey = "#entity.id")
void deliverySend(TestEntity entity);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONUtil;
import io.github.guoshiqiufeng.loki.support.core.ProducerRecord;
import io.github.guoshiqiufeng.loki.support.core.ProducerResult;
import io.github.guoshiqiufeng.loki.support.core.producer.ProducerRecord;
import io.github.guoshiqiufeng.loki.support.core.producer.ProducerResult;
import io.github.guoshiqiufeng.loki.support.rocketmq.RocketClient;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
package io.github.guoshiqiufeng.lokitest.controller;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import io.github.guoshiqiufeng.loki.support.rocketmq.RocketClient;
import io.github.guoshiqiufeng.lokitest.entity.TestEntity;
import io.github.guoshiqiufeng.lokitest.mapper.TestMapper;
import jakarta.annotation.Resource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface TestMapper extends BaseMapper<TestEntity> {
@SendMessage(topic = "loki", tag = "custom", async = true, message = "#entity.message", messageKey = "#entity.id")
CompletableFuture<String> customAsyncSend(TestEntity entity);

@SendMessage(topic = "lokiDelay", tag = "custom", message = "#entity.message", deliveryTimestamp = 20 * 1000,messageKey = "#entity.id")
@SendMessage(topic = "lokiDelay", tag = "custom", message = "#entity.message", deliveryTimestamp = 20 * 1000, messageKey = "#entity.id")
void deliverySend(TestEntity entity);

}
2 changes: 1 addition & 1 deletion loki-simple-test/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!../.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON;
import io.github.guoshiqiufeng.loki.support.core.LokiClient;
import io.github.guoshiqiufeng.loki.support.core.ProducerRecord;
import io.github.guoshiqiufeng.loki.support.core.ProducerResult;
import io.github.guoshiqiufeng.loki.support.kafka.KafkaClient;
import io.github.guoshiqiufeng.loki.support.core.producer.ProducerRecord;
import io.github.guoshiqiufeng.loki.support.core.producer.ProducerResult;
import io.github.guoshiqiufeng.loki.support.redis.RedisClient;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;
import java.util.concurrent.ExecutionException;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package io.github.guoshiqiufeng.lokitest.interceptor;

import io.github.guoshiqiufeng.loki.support.core.pipeline.PipelineContext;
import io.github.guoshiqiufeng.loki.support.core.pipeline.PipelineProcess;
import io.github.guoshiqiufeng.loki.support.core.pipeline.model.ConsumerRecordModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
* @author yanghq
* @version 1.0
* @since 2024/1/31 14:38
*/
@Slf4j
@Component
public class ListenerInterceptor implements PipelineProcess<ConsumerRecordModel> {

/**
* 是否支持
*
* @param context 内容
* @return 是否支持 true 支持 false 不支持
*/
@Override
public boolean support(PipelineContext<ConsumerRecordModel> context) {
return "loki".equals(context.getModel().getTopic());
}

/**
* 处理
*
* @param context 内容
*/
@Override
public void process(PipelineContext<ConsumerRecordModel> context) {
log.debug("ListenerInterceptor context:{}", context);
// context.setProcessModel(null);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package io.github.guoshiqiufeng.lokitest.interceptor;

import io.github.guoshiqiufeng.loki.support.core.pipeline.PipelineContext;
import io.github.guoshiqiufeng.loki.support.core.pipeline.PipelineProcess;
import io.github.guoshiqiufeng.loki.support.core.pipeline.model.ProducerRecordModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
* @author yanghq
* @version 1.0
* @since 2024/1/31 14:38
*/
@Slf4j
@Component
public class SendInterceptor implements PipelineProcess<ProducerRecordModel> {

/**
* 是否支持
*
* @param context 内容
* @return 是否支持 true 支持 false 不支持
*/
@Override
public boolean support(PipelineContext<ProducerRecordModel> context) {
return "loki".equals(context.getModel().getTopic());
}

/**
* 处理
*
* @param context 内容
*/
@Override
public void process(PipelineContext<ProducerRecordModel> context) {
log.debug("SendInterceptor context:{}", context);
// context.setProcessModel(null);
}
}
2 changes: 1 addition & 1 deletion loki-simple-test/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ loki:
mq-config:
mq-type: redis
address: 127.0.0.1:6379
auth: true
auth: false
password: 123456
# mq-type: ROCKET_MQ
# address: 127.0.0.1:8081
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<properties>
<java.version>17</java.version>
<loki.version>0.8.1</loki.version>
<loki.version>0.9.0</loki.version>
</properties>

<dependencyManagement>
Expand Down

0 comments on commit e3a1c45

Please sign in to comment.