Skip to content

Commit

Permalink
add a kafka-extension sample
Browse files Browse the repository at this point in the history
  • Loading branch information
elakito committed Aug 23, 2016
1 parent 0f29eb0 commit 065b90a
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
12 changes: 12 additions & 0 deletions extensions-samples/kafka/jersey-pubsub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This sample assumes Apache Kafka
For more information on Kafka, refer to http://kafka.apache.org/documentation.html
If Kafka is running at its default host and port localhost:9092, you will need to adjust
parameter bootstrap.servers in a configuration file specified by the init paramter
org.atmosphere.kafka.propertiesFile.

Run this sample twice with this command lines :
- 1st instance : mvn jetty:run-war -Djetty.port=8080
- 2nd instance : mvn jetty:run-war -Djetty.port=9090

You can use your browser to connect to either http://localhost:8080 or http://localhost:9090 and
observe the messages posted to the same topic are broadcasted to its subscribers.
53 changes: 53 additions & 0 deletions extensions-samples/kafka/jersey-pubsub/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<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/maven-v4_0_0.xsd">
<parent>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-samples-project</artifactId>
<version>2.5.0-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>atmosphere-kafka-demo</artifactId>
<packaging>war</packaging>
<name>atmosphere-kafka-demo</name>
<properties>
<extensions-version>2.5.0-SNAPSHOT</extensions-version>
</properties>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<overlays>
<overlay>
<groupId>org.atmosphere.samples</groupId>
<artifactId>atmosphere-jersey-pubsub</artifactId>
</overlay>
</overlays>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-kafka</artifactId>
<version>${extensions-version}</version>
</dependency>
<dependency>
<groupId>org.atmosphere.samples</groupId>
<artifactId>atmosphere-jersey-pubsub</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_3.0_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

</project>

0 comments on commit 065b90a

Please sign in to comment.