Skip to content

Commit

Permalink
[resolves wildfly-extras#732] Add support for camel-kafka
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Diesler committed Jul 7, 2015
1 parent 2604a2d commit 33c050e
Show file tree
Hide file tree
Showing 21 changed files with 175 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* #%L
* Wildfly Camel :: Testsuite
* %%
* Copyright (C) 2013 - 2014 RedHat
* %%
* Licensed 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.
* #L%
*/

package org.wildfly.camel.test.kafka;

import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
import org.apache.camel.impl.DefaultCamelContext;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(Arquillian.class)
public class KafkaIntegrationTest {

@Deployment
public static JavaArchive deployment() {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "kafka-integration-tests");
return archive;
}

@Test
public void testKafkaEndpoint() throws Exception {
CamelContext ctx = new DefaultCamelContext();
Endpoint endpoint = ctx.getEndpoint("kafka:localhost:9092?topic=test&zookeeperHost=localhost&zookeeperPort=2181&groupId=group1");
Assert.assertNotNull(endpoint);
Assert.assertEquals(endpoint.getClass().getName(), "org.apache.camel.component.kafka.KafkaEndpoint");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ public static WebArchive createdeployment() {

@Test
public void testComponentLoads() throws Exception {

CamelContext ctx = new DefaultCamelContext();
Endpoint endpoint = ctx.getEndpoint("lucene:searchIndex:query?maxHits=20");
Assert.assertNotNull(endpoint);
Assert.assertEquals(endpoint.getClass().getName(), "org.apache.camel.component.lucene.LuceneEndpoint");
ctx.stop();
}

}
1 change: 1 addition & 0 deletions modules/etc/baseline/exported-paths.txt
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ org/apache/camel/component/jms/reply
org/apache/camel/component/jmx
org/apache/camel/component/jmx/jaxb
org/apache/camel/component/jpa
org/apache/camel/component/kafka
org/apache/camel/component/lucene
org/apache/camel/component/mail
org/apache/camel/component/mina2
Expand Down
17 changes: 13 additions & 4 deletions modules/etc/baseline/module-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
/org/apache/camel/component/jms/main/camel-jms-2.15.1.redhat-621012.jar
/org/apache/camel/component/jmx/main/camel-jmx-2.15.1.redhat-621012.jar
/org/apache/camel/component/jpa/main/camel-jpa-2.15.1.redhat-621012.jar
/org/apache/camel/component/kafka/main/camel-kafka-2.15.1.redhat-621012.jar
/org/apache/camel/component/lucene/main/camel-lucene-2.15.1.redhat-621012.jar
/org/apache/camel/component/mail/main/camel-mail-2.15.1.redhat-621012.jar
/org/apache/camel/component/mina2/main/camel-mina2-2.15.1.redhat-621012.jar
Expand Down Expand Up @@ -151,6 +152,13 @@
/org/apache/deltaspike/cdictrl/api/main/deltaspike-cdictrl-api-1.2.1.jar
/org/apache/deltaspike/core/api/main/deltaspike-core-api-1.2.1.jar
/org/apache/deltaspike/core/impl/main/deltaspike-core-impl-1.2.1.jar
/org/apache/kafka/clients/main/kafka-clients-0.8.2.0.jar
/org/apache/kafka/clients/main/lz4-1.2.0.jar
/org/apache/kafka/clients/main/snappy-java-1.1.1.6.jar
/org/apache/kafka/main/jopt-simple-3.2.jar
/org/apache/kafka/main/kafka_2.10-0.8.2.0.jar
/org/apache/kafka/main/metrics-core-2.2.0.jar
/org/apache/kafka/main/zkclient-0.3.jar
/org/apache/lucene/4.10/lucene-analyzers-common-4.10.3.jar
/org/apache/lucene/4.10/lucene-core-4.10.3.jar
/org/apache/lucene/4.10/lucene-queries-4.10.3.jar
Expand All @@ -170,6 +178,7 @@
/org/apache/ws/security/2.0/wss4j-ws-security-stax-2.0.3.jar
/org/apache/xbean/spring/main/xbean-spring-3.18.jar
/org/apache/xmlbeans/main/xmlbeans-2.6.0.jar
/org/apache/zookeeper/main/zookeeper-3.4.6.jar
/org/beanshell/main/bsh-2.0b5.jar
/org/bouncycastle/main/bcpg-jdk15on-1.52.jar
/org/bouncycastle/main/bcprov-jdk15on-1.52.jar
Expand All @@ -194,10 +203,10 @@
/org/opensaml/xmltooling/1.4.1/xmltooling-1.4.1.jar
/org/restlet/main/org.restlet-2.2.3.jar
/org/restlet/main/org.restlet.ext.httpclient-2.2.3.jar
/org/scala-lang/scala-compiler/main/scala-compiler-2.10.0.jar
/org/scala-lang/scala-library/main/scala-library-2.10.4.jar
/org/scala-lang/scala-reflect/main/scala-reflect-2.10.0.jar
/org/scala-lang/scalap/main/scalap-2.10.0.jar
/org/scala/lang/main/scala-compiler-2.10.0.jar
/org/scala/lang/main/scala-library-2.10.4.jar
/org/scala/lang/main/scala-reflect-2.10.0.jar
/org/scala/lang/main/scalap-2.10.0.jar
/org/springframework/aop/main/aopalliance-1.0.jar
/org/springframework/aop/main/spring-aop-4.1.6.RELEASE.jar
/org/springframework/beans/main/spring-beans-4.1.6.RELEASE.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<module name="com.fasterxml.jackson.core.jackson-databind" />
<module name="com.google.guava" />
<module name="com.thoughtworks.paranamer" />
<module name="org.scala-lang.scala-library" />
<module name="org.scala-lang.scala-reflect" />
<module name="org.scala.lang" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.camel.component.kafka">
<resources>
<resource-root path="camel-kafka-2.15.1.redhat-621012.jar" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="org.slf4j" />
<module name="javax.xml.bind.api" />
<module name="org.apache.camel.core" />
<module name="org.apache.kafka" />
<module name="org.scala.lang" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<module name="org.apache.camel.core" />
<module name="org.apache.commons.lang" />
<module name="org.json4s" />
<module name="org.scala-lang.scala-library" />
<module name="org.scala.lang" />
<module name="org.slf4j" />
</dependencies>
<exports>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.kafka.clients">
<resources>
<resource-root path="kafka-clients-0.8.2.0.jar" />
<resource-root path="lz4-1.2.0.jar" />
<resource-root path="snappy-java-1.1.1.6.jar" />
</resources>
<dependencies>
<module name="org.osgi.core" />
<module name="org.slf4j" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.kafka">
<resources>
<resource-root path="jopt-simple-3.2.jar" />
<resource-root path="kafka_2.10-0.8.2.0.jar" />
<resource-root path="metrics-core-2.2.0.jar" />
<resource-root path="zkclient-0.3.jar" />
</resources>
<dependencies>
<module name="org.scala.lang" />
<module name="org.apache.kafka.clients" />
<module name="org.apache.log4j" />
<module name="org.apache.zookeeper" />
<module name="org.slf4j" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.zookeeper">
<resources>
<resource-root path="zookeeper-3.4.6.jar" />
</resources>
<dependencies>
<module name="org.jboss.netty" />
<module name="org.slf4j" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<module name="com.thoughtworks.paranamer" />
<module name="org.joda.joda-convert" />
<module name="org.joda.time" slot="2.0" />
<module name="org.scala-lang.scala-library" />
<module name="org.scala-lang.scalap" />
<module name="org.scala.lang" />
</dependencies>
</module>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.scala.lang">
<resources>
<resource-root path="scala-compiler-2.10.0.jar" />
<resource-root path="scala-library-2.10.4.jar" />
<resource-root path="scala-reflect-2.10.0.jar" />
<resource-root path="scalap-2.10.0.jar" />
</resources>
<dependencies />
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<module name="org.apache.camel.component.jms" export="true" services="export" />
<module name="org.apache.camel.component.jmx" export="true" services="export" />
<module name="org.apache.camel.component.jpa" export="true" services="export" />
<module name="org.apache.camel.component.kafka" export="true" services="export" />
<module name="org.apache.camel.component.lucene" export="true" services="export" />
<module name="org.apache.camel.component.mail" export="true" services="export" />
<module name="org.apache.camel.component.mina2" export="true" services="export" />
Expand Down
11 changes: 11 additions & 0 deletions modules/etc/smartics/camel-modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,17 @@
</dependencies>
</module>

<module name="org.apache.camel.component.kafka">
<include artifact="org.apache.camel:camel-kafka" />
<apply-to-dependencies skip="true">
<include module="org.apache.camel.apt" />
</apply-to-dependencies>
<dependencies>
<module name="javax.api"/>
<module name="org.slf4j"/>
</dependencies>
</module>

<module name="org.apache.camel.component.lucene">
<include artifact="org.apache.camel:camel-lucene" />
<apply-to-dependencies skip="true">
Expand Down
28 changes: 28 additions & 0 deletions modules/etc/smartics/other-modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,22 @@
</dependencies>
</module>

<module name="org.apache.kafka">
<include artifact="org.apache.kafka:kafka_2.10" />
<include artifact="com.yammer.metrics:metrics-core" />
<include artifact="net.sf.jopt-simple:jopt-simple" />
<include artifact="com.101tec:zkclient" />
<dependencies>
<module name="org.scala.lang" />
</dependencies>
</module>

<module name="org.apache.kafka.clients">
<include artifact="org.apache.kafka:kafka-clients" />
<include artifact="org.xerial.snappy:snappy-java" />
<include artifact="net.jpountz.lz4:lz4" />
</module>

<module name="org.apache.lucene" slot="4.10">
<include artifact="org.apache.lucene:lucene-(.*)" />
<include artifact=":jakarta-regexp" />
Expand Down Expand Up @@ -192,6 +208,14 @@
</dependencies>
</module>

<module name="org.apache.zookeeper">
<include artifact="org.apache.zookeeper:zookeeper" />
<apply-to-dependencies skip="true">
<include module="jline" />
<include module="org.apache.log4j" />
</apply-to-dependencies>
</module>

<module name="org.beanshell">
<include artifact="org.beanshell:bsh" />
<dependencies>
Expand Down Expand Up @@ -242,4 +266,8 @@
</dependencies>
</module>

<module name="org.scala.lang">
<include artifact="org.scala-lang:(.*)" />
</module>

</modules>
4 changes: 0 additions & 4 deletions modules/etc/smartics/skipped-modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@
<include artifact="org.apache.servicemix.bundles:(.*)" />
</module>

<module name="org.apache.zookeeper" skip="true">
<include artifact="org.apache.zookeeper:zookeeper" />
</module>

<module name="org.eclipse.jetty.orbit" skip="true">
<include artifact="org.eclipse.jetty.orbit:javax.servlet" />
</module>
Expand Down
5 changes: 5 additions & 0 deletions modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@
<artifactId>camel-jpa</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-kafka</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-lucene</artifactId>
Expand Down

0 comments on commit 33c050e

Please sign in to comment.