Skip to content

Commit

Permalink
fix up pulsar-flink and flink-consumer-source (apache#3212)
Browse files Browse the repository at this point in the history
### Motivation

fix up flink-consumer-source example run error

### Modifications

modify pom.xml, sl4j and log4j2

### Result

1. log conflict, sl4j and log4j2
2. flink-consumer-source example use pulsar-flink model class and api, cann't execution
3. pulsar-flink not use jar but flink-consumer-source use, like flink-scala
  • Loading branch information
ambition119 authored and sijie committed Dec 19, 2018
1 parent 83cf25c commit 8da04cb
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ docker.debug-info
**/website/i18n/*
**/website/translated_docs*

# Avro
examples/flink-consumer-source/src/main/java/org/apache/flink/batch/connectors/pulsar/avro/generated
pulsar-flink/src/test/java/org/apache/flink/batch/connectors/pulsar/avro/generated
33 changes: 25 additions & 8 deletions examples/flink-consumer-source/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.pulsar.examples</groupId>
Expand All @@ -31,22 +31,39 @@
<artifactId>flink-consumer-source</artifactId>
<name>Pulsar Examples :: Flink Consumer Source</name>

<properties>
<log4j2.version>2.10.0</log4j2.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<artifactId>flink-scala_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>

<dependency>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-flink</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-client-original</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
37 changes: 37 additions & 0 deletions examples/flink-consumer-source/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<Configuration status="INFO">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t:%C@%L] %-5level %logger{36} - %msg%n" />
</Console>
</Appenders>
<Loggers>
<Root level="warn">
<AppenderRef ref="Console" />
</Root>
<Logger name="org.eclipse.jetty" level="info"/>
<Logger name="org.apache.pulsar" level="info"/>
<Logger name="org.apache.bookkeeper" level="info"/>
<Logger name="org.apache.kafka" level="info"/>
</Loggers>
</Configuration>
23 changes: 2 additions & 21 deletions pulsar-flink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
-->
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -34,12 +34,10 @@
<name>Pulsar Flink Connectors</name>

<dependencies>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
Expand All @@ -51,12 +49,6 @@
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-scala_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-avro</artifactId>
Expand Down Expand Up @@ -84,14 +76,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-tests_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
Expand All @@ -113,9 +97,6 @@
<version>3.20.0-GA</version>
<scope>test</scope>
</dependency>



</dependencies>

<build>
Expand Down

0 comments on commit 8da04cb

Please sign in to comment.