This is an automated email from the ASF dual-hosted git repository. shenlin pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/rocketmq-eventbridge.git
commit c37ad1b4b77fd69435a67236710765159e3903f9 Author: wangkai <wang...@zhongan.com> AuthorDate: Fri Nov 3 18:21:40 2023 +0800 [e2eTest] add e2eTest model --- .github/workflows/maven-package.yml | 6 +++++- .../storage/rocketmq/impl/DefaultSendCallback.java | 4 ---- .../rocketmq/impl/RocketMQEventDataRepository.java | 3 --- azure-pipelines.yml | 21 --------------------- .../rocketmq/eventbridge/demo/DefaultDemo.java | 2 +- 5 files changed, 6 insertions(+), 30 deletions(-) diff --git a/.github/workflows/maven-package.yml b/.github/workflows/maven-package.yml index a633c1f..c73ebc5 100644 --- a/.github/workflows/maven-package.yml +++ b/.github/workflows/maven-package.yml @@ -1,7 +1,11 @@ # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path name: Redis runner example -on: push +on: + pull_request: + types: [ opened, reopened, synchronize ] + release: + types: [ created ] jobs: # Label of the runner job diff --git a/adapter/storage/src/main/java/org/apache/rocketmq/eventbridge/adapter/storage/rocketmq/impl/DefaultSendCallback.java b/adapter/storage/src/main/java/org/apache/rocketmq/eventbridge/adapter/storage/rocketmq/impl/DefaultSendCallback.java index d1df650..35bc7ef 100644 --- a/adapter/storage/src/main/java/org/apache/rocketmq/eventbridge/adapter/storage/rocketmq/impl/DefaultSendCallback.java +++ b/adapter/storage/src/main/java/org/apache/rocketmq/eventbridge/adapter/storage/rocketmq/impl/DefaultSendCallback.java @@ -17,14 +17,12 @@ package org.apache.rocketmq.eventbridge.adapter.storage.rocketmq.impl; -import lombok.extern.slf4j.Slf4j; import org.apache.rocketmq.client.producer.SendCallback; import org.apache.rocketmq.client.producer.SendResult; import org.apache.rocketmq.eventbridge.domain.model.data.PutEventCallback; import org.apache.rocketmq.eventbridge.domain.model.data.PutEventsResponseEntry; import org.apache.rocketmq.eventbridge.exception.code.DefaultErrorCode; -@Slf4j public class DefaultSendCallback implements SendCallback { PutEventCallback putEventCallback; @@ -37,7 +35,6 @@ public class DefaultSendCallback implements SendCallback { @Override public void onSuccess(SendResult sendResult) { - log.info("send msg to topic :{} success result.", sendResult); entry.setEventId(sendResult.getMsgId()); entry.setErrorCode(DefaultErrorCode.Success.getCode()); putEventCallback.endProcess(entry); @@ -45,7 +42,6 @@ public class DefaultSendCallback implements SendCallback { @Override public void onException(Throwable throwable) { - log.error("send msg to topic : fail result.", throwable); entry.setErrorCode(DefaultErrorCode.InternalError.getCode()); entry.setErrorMessage(throwable.getMessage()); putEventCallback.endProcess(entry); diff --git a/adapter/storage/src/main/java/org/apache/rocketmq/eventbridge/adapter/storage/rocketmq/impl/RocketMQEventDataRepository.java b/adapter/storage/src/main/java/org/apache/rocketmq/eventbridge/adapter/storage/rocketmq/impl/RocketMQEventDataRepository.java index bf24411..5b1d796 100644 --- a/adapter/storage/src/main/java/org/apache/rocketmq/eventbridge/adapter/storage/rocketmq/impl/RocketMQEventDataRepository.java +++ b/adapter/storage/src/main/java/org/apache/rocketmq/eventbridge/adapter/storage/rocketmq/impl/RocketMQEventDataRepository.java @@ -75,11 +75,8 @@ public class RocketMQEventDataRepository implements EventDataRepository { String topicName = this.getTopicName(accountId, eventBusName); Message msg = eventDataOnRocketMQConnectAPI.converter(accountId, topicName, eventBridgeEvent); try { - log.info("send msg to topic :{} before.", topicName); producer.send(msg, new DefaultSendCallback(putEventCallback), 1000L); - log.info("send msg to topic :{} end.", topicName); } catch (Throwable e) { - log.info("send msg to topic :{} failed. and exception is {}", topicName, e.toString()); throw new EventBridgeException(EventBridgeErrorCode.InternalError, e); } return true; diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index b93cf06..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: none - -jobs: - - job: RunTest - workspace: - clean: all - pool: - vmImage: 'ubuntu-latest' - steps: - - task: Docker@2 - displayName: Login to ACR - inputs: - command: login - containerRegistry: my-acr - - script: | - docker run my-registry.azurecr.io/somerepo/rnd-hello:latest diff --git a/test/demo/src/main/java/org/apache/rocketmq/eventbridge/demo/DefaultDemo.java b/test/demo/src/main/java/org/apache/rocketmq/eventbridge/demo/DefaultDemo.java index f807f12..ce71c7a 100644 --- a/test/demo/src/main/java/org/apache/rocketmq/eventbridge/demo/DefaultDemo.java +++ b/test/demo/src/main/java/org/apache/rocketmq/eventbridge/demo/DefaultDemo.java @@ -94,7 +94,7 @@ public class DefaultDemo { if (eventTargets == null || eventTargets.isEmpty()) { List<EventTarget> eventTargetList = Lists.newArrayList(); Map<String, Object> config = Maps.newHashMap(); - config.put("fileName", System.getProperty("user.home")+"/demo"); + config.put("fileName", System.getProperty("user.home") + "/demo"); config.put("line", "{\"form\":\"JSONPATH\",\"value\":\"$.data\"}"); EventTarget eventTarget = EventTarget.builder().name(DEFAULT_EVENT_TARGET_NAME).className(DEFAULT_EVENT_TARGET_CLASS).config(config).build(); eventTargetList.add(eventTarget);