Skip to content

Commit

Permalink
Rename Kafka connector name
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanwenjun committed Jul 27, 2021
1 parent 1400e59 commit 14262af
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion eventmesh-connector-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ task copyConnectorPlugin(dependsOn: ['jar']) {
}
copy {
into '../dist/plugin/connector'
from "../eventmesh-connector-plugin/dist/apps/eventmesh-connector-rocketmq-${version}.jar"
from '../eventmesh-connector-plugin/dist/apps'
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
/**
* The adaptor to adapt Kafka consumer to OMS producer.
*/
public class OMSConsumerAdaptor implements MeshMQPushConsumer {
public class KafkaMeshConsumerAdaptor implements MeshMQPushConsumer {

private final Logger logger = LoggerFactory.getLogger(OMSConsumerAdaptor.class);
private final Logger logger = LoggerFactory.getLogger(KafkaMeshConsumerAdaptor.class);

private KafkaMQConsumerImpl kafkaConsumer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
/**
* The adaptor to adapt Kafka producer to OMS producer.
*/
public class OMSProducerAdaptor implements MeshMQProducer {
public class KafkaMeshProducerAdaptor implements MeshMQProducer {

private final Logger logger = LoggerFactory.getLogger(OMSProducerAdaptor.class);
private final Logger logger = LoggerFactory.getLogger(KafkaMeshProducerAdaptor.class);

private KafkaMQProducerImpl kafkaMQProducer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

kafka=org.apache.eventmesh.connector.kafka.consumer.OMSConsumerAdaptor
kafka=org.apache.eventmesh.connector.kafka.consumer.KafkaMeshConsumerAdaptor
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

kafka=org.apache.eventmesh.connector.kafka.producer.OMSProducerAdaptor
kafka=org.apache.eventmesh.connector.kafka.producer.KafkaMeshProducerAdaptor
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.apache.eventmesh.connector.kafka.common.Constants;
import org.apache.eventmesh.connector.kafka.config.ConfigurationWrapper;
import org.apache.eventmesh.connector.kafka.producer.KafkaMQProducerImplExample;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.charset.StandardCharsets;
import java.util.Properties;
Expand All @@ -29,6 +31,8 @@ public class KafkaMQConsumerImplExample {

private static KafkaMQConsumerImpl kafkaMQConsumer;

private static final Logger logger = LoggerFactory.getLogger(KafkaMQConsumerImplExample.class);

static {
kafkaMQConsumer = new KafkaMQConsumerImpl(new Properties());
String filePath = KafkaMQProducerImplExample.class.getClassLoader().getResource(Constants.KAFKA_CONF_FILE).getPath();
Expand All @@ -40,7 +44,7 @@ public class KafkaMQConsumerImplExample {

public static void main(String[] args) {
kafkaMQConsumer.subscribe("eventmesh-test-topic",
(message, context) -> System.out.println(new String(message.getBody(), StandardCharsets.UTF_8)));
(message, context) -> logger.info(new String(message.getBody(), StandardCharsets.UTF_8)));
kafkaMQConsumer.start();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

public class OMSProducerAdaptorTest {

private OMSProducerAdaptor omsProducerAdaptor;
private KafkaMeshProducerAdaptor kafkaMeshProducerAdaptor;

@Before
public void before() {
omsProducerAdaptor = new OMSProducerAdaptor();
kafkaMeshProducerAdaptor = new KafkaMeshProducerAdaptor();
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion eventmesh-runtime/conf/eventmesh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ eventMesh.server.registry.fetchRegistryAddrIntervalInMills=20000
#eventMesh.server.defibus.client.comsumeTimeoutInMin=5

#connector plugin
eventMesh.connector.plugin.type=rocketmq
eventMesh.connector.plugin.type=kafka

0 comments on commit 14262af

Please sign in to comment.