This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 31dae05  Provide unshaded pulsar-kafka-client (#1566)
31dae05 is described below

commit 31dae050a79d38e44d6e81c817ad6aba1cd762f9
Author: Sijie Guo <guosi...@gmail.com>
AuthorDate: Fri Apr 13 15:02:10 2018 -0700

    Provide unshaded pulsar-kafka-client (#1566)
    
    * Provide unshaded pulsar-kafka-client
    
    * update doc
    
    * comment on classes
---
 pulsar-client-kafka-compat/pom.xml                 |   1 +
 .../pom.xml                                        |  46 +------
 .../pulsar-client-kafka/pom.xml                    | 150 +--------------------
 site/docs/latest/adaptors/KafkaWrapper.md          |  17 +++
 4 files changed, 27 insertions(+), 187 deletions(-)

diff --git a/pulsar-client-kafka-compat/pom.xml 
b/pulsar-client-kafka-compat/pom.xml
index e43d942..c7e517c 100644
--- a/pulsar-client-kafka-compat/pom.xml
+++ b/pulsar-client-kafka-compat/pom.xml
@@ -38,6 +38,7 @@
 
   <modules>
     <module>pulsar-client-kafka</module>
+    <module>pulsar-client-kafka-shaded</module>
     <module>pulsar-client-kafka-tests</module>
   </modules>
 </project>
diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml 
b/pulsar-client-kafka-compat/pulsar-client-kafka-shaded/pom.xml
similarity index 88%
copy from pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml
copy to pulsar-client-kafka-compat/pulsar-client-kafka-shaded/pom.xml
index 5c3ee5d..b1c1961 100644
--- a/pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml
+++ b/pulsar-client-kafka-compat/pulsar-client-kafka-shaded/pom.xml
@@ -37,50 +37,15 @@
   <description>Drop-in replacement for Kafka client library that publishes and 
consumes
   messages on Pulsar topics</description>
 
-  <dependencies>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>pulsar-client-original</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.kafka</groupId>
-      <artifactId>kafka-clients</artifactId>
-      <version>${kafka-client.version}</version>
-      <exclusions>
-        <exclusion>
-          <groupId>net.jpountz.lz4</groupId>
-          <artifactId>lz4</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.xerial.snappy</groupId>
-          <artifactId>snappy-java</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>pulsar-broker</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>pulsar-broker</artifactId>
-      <version>${project.version}</version>
-      <scope>test</scope>
-      <type>test-jar</type>
-    </dependency>
+  <properties>
+    <kafka.version>0.10.2.1</kafka.version>
+  </properties>
 
+  <dependencies>
     <dependency>
       <groupId>${project.groupId}</groupId>
-      <artifactId>managed-ledger</artifactId>
+      <artifactId>pulsar-client-kafka-original</artifactId>
       <version>${project.version}</version>
-      <scope>test</scope>
-      <type>test-jar</type>
     </dependency>
   </dependencies>
 
@@ -101,6 +66,7 @@
               <artifactSet>
                 <includes>
                   <include>org.apache.kafka:kafka-clients</include>
+                  
<include>org.apache.pulsar:pulsar-client-kafka-original</include>
                   <include>org.apache.pulsar:pulsar-client-original</include>
                   <include>org.apache.commons:commons-lang3</include>
                   <include>commons-codec:commons-codec</include>
diff --git a/pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml 
b/pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml
index 5c3ee5d..4426959 100644
--- a/pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml
+++ b/pulsar-client-kafka-compat/pulsar-client-kafka/pom.xml
@@ -31,11 +31,10 @@
     <relativePath>..</relativePath>
   </parent>
 
-  <artifactId>pulsar-client-kafka</artifactId>
-  <name>Pulsar Kafka compatibility :: API</name>
+  <artifactId>pulsar-client-kafka-original</artifactId>
+  <name>Pulsar Kafka compatibility :: API (original)</name>
 
-  <description>Drop-in replacement for Kafka client library that publishes and 
consumes
-  messages on Pulsar topics</description>
+  <description>Kafka client library that publishes and consumes messages on 
Pulsar topics</description>
 
   <dependencies>
     <dependency>
@@ -84,147 +83,4 @@
     </dependency>
   </dependencies>
 
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-shade-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-            <configuration>
-              <createDependencyReducedPom>true</createDependencyReducedPom>
-              
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
-              <artifactSet>
-                <includes>
-                  <include>org.apache.kafka:kafka-clients</include>
-                  <include>org.apache.pulsar:pulsar-client-original</include>
-                  <include>org.apache.commons:commons-lang3</include>
-                  <include>commons-codec:commons-codec</include>
-                  <include>commons-collections:commons-collections</include>
-                  <include>org.asynchttpclient:*</include>
-                  <include>io.netty:netty-codec-http</include>
-                  <include>io.netty:netty-transport-native-epoll</include>
-                  <include>org.reactivestreams:reactive-streams</include>
-                  <include>com.typesafe.netty:netty-reactive-streams</include>
-                  <include>org.javassist:javassist</include>
-                  <include>com.google.protobuf:protobuf-java</include>
-                  <include>com.google.guava:guava</include>
-                  <include>com.google.code.gson:gson</include>
-                  <include>com.fasterxml.jackson.core</include>
-                  <include>io.netty:netty</include>
-                  <include>io.netty:netty-all</include>
-                  <include>org.apache.pulsar:pulsar-common</include>
-                  <include>org.apache.bookkeeper:circe-checksum</include>
-                  <include>net.jpountz.lz4:lz4</include>
-                  <include>com.yahoo.datasketches:sketches-core</include>
-                  <include>org.apache.httpcomponents:httpclient</include>
-                  <include>commons-logging:commons-logging</include>
-                  <include>org.apache.httpcomponents:httpcore</include>
-                </includes>
-              </artifactSet>
-               <filters>
-                <filter>
-                   <artifact>commons-logging:commons-logging</artifact>
-                   <includes>
-                       <include>**</include>
-                   </includes>
-                </filter>
-              </filters>
-              <relocations>
-                <relocation>
-                  
<pattern>org.apache.kafka.clients.producer.KafkaProducer</pattern>
-                  
<shadedPattern>org.apache.kafka.clients.producer.OriginalKafkaProducer</shadedPattern>
-                </relocation>
-                <relocation>
-                  
<pattern>org.apache.kafka.clients.producer.PulsarKafkaProducer</pattern>
-                  
<shadedPattern>org.apache.kafka.clients.producer.KafkaProducer</shadedPattern>
-                </relocation>
-                <relocation>
-                  
<pattern>org.apache.kafka.clients.consumer.KafkaConsumer</pattern>
-                  
<shadedPattern>org.apache.kafka.clients.consumer.OriginalKafkaConsumer</shadedPattern>
-                </relocation>
-                <relocation>
-                  
<pattern>org.apache.kafka.clients.consumer.PulsarKafkaConsumer</pattern>
-                  
<shadedPattern>org.apache.kafka.clients.consumer.KafkaConsumer</shadedPattern>
-                </relocation>
-
-                <!-- General relocation rules for Pulsar client dependencies 
-->
-
-                <relocation>
-                  <pattern>org.asynchttpclient</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.asynchttpclient</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.commons</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.commons</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>com.google</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.google</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>com.fasterxml.jackson</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.fasterxml.jackson</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>io.netty</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.io.netty</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.pulsar.common</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.common</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.pulsar.policies</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.policies</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.pulsar.checksum</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.pulsar.checksum</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>com.scurrilous.circe</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.scurrilous.circe</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>net.jpountz</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.net.jpountz</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>com.yahoo.datasketches</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.yahoo.datasketches</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>com.yahoo.sketches</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.com.yahoo.sketches</shadedPattern>
-                </relocation>
-                <relocation>
-                  <pattern>org.apache.http</pattern>
-                  
<shadedPattern>org.apache.pulsar.shade.org.apache.http</shadedPattern>
-                </relocation>
-              </relocations>
-              <filters>
-                <filter>
-                  <artifact>net.jpountz.lz4:lz4</artifact>
-                  <includes>
-                    <include>**</include>
-                  </includes>
-                </filter>
-                <filter>
-                  <artifact>org.apache.pulsar:pulsar-client-original</artifact>
-                  <includes>
-                    <include>**</include>
-                  </includes>
-                </filter>
-              </filters>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
 </project>
diff --git a/site/docs/latest/adaptors/KafkaWrapper.md 
b/site/docs/latest/adaptors/KafkaWrapper.md
index 444cb0f..cfbeddb 100644
--- a/site/docs/latest/adaptors/KafkaWrapper.md
+++ b/site/docs/latest/adaptors/KafkaWrapper.md
@@ -60,6 +60,23 @@ thing that needs to be adjusted is the configuration, to 
make sure to point the
 producers and consumers to Pulsar service rather than Kafka and to use a 
particular
 Pulsar topic.
 
+## Using the Pulsar Kafka compatibility wrapper together with existing kafka 
client.
+
+When migrating from Kafka to Pulsar, the application might have to use the 
original kafka client
+and the pulsar kafka wrapper together during migration. Then you should 
consider using the
+unshaded pulsar kafka client wrapper.
+
+```xml
+<dependency>
+  <groupId>org.apache.pulsar</groupId>
+  <artifactId>pulsar-client-kafka-original</artifactId>
+  <version>{{ site.current_version }}</version>
+</dependency>
+```
+
+When using this dependency, you need to construct producer using 
`org.apache.kafka.clients.producer.PulsarKafkaProducer`
+instead of `org.apache.kafka.clients.producer.KafkaProducer` and 
`org.apache.kafka.clients.producer.PulsarKafkaConsumer` for consumers.
+
 ## Producer example
 
 ```java

-- 
To stop receiving notification emails like this one, please contact
mme...@apache.org.

Reply via email to