Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Tickets examples added
Browse files Browse the repository at this point in the history
  • Loading branch information
compae committed Aug 14, 2017
1 parent 43c1f3b commit c315c1a
Show file tree
Hide file tree
Showing 32 changed files with 77,129 additions and 78 deletions.
23 changes: 14 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<maven-assembly-plugin>2.5</maven-assembly-plugin>
<scalastyle-maven-plugin>0.8.0</scalastyle-maven-plugin>
<kafka.version>0.10.0.1</kafka.version>
<zookeeper.version>3.5.1-alpha</zookeeper.version>
<zookeeper.version>3.5.2-alpha</zookeeper.version>
<typesafe.config.version>1.3.0</typesafe.config.version>
<akka.version>2.4.17</akka.version>
<akka.http.experimental.version>2.4.11</akka.http.experimental.version>
Expand All @@ -44,6 +44,7 @@
<scala-maven.tests.plugin.version>2.19.1</scala-maven.tests.plugin.version>
<scala-maven.plugin.version>3.2.2</scala-maven.plugin.version>
<dropwizard.metrics.version>3.2.2</dropwizard.metrics.version>
<csv.parser.version>0.1.19</csv.parser.version>
</properties>

<developers>
Expand Down Expand Up @@ -116,35 +117,33 @@
<dependency>
<groupId>com.nrinaudo</groupId>
<artifactId>kantan.csv_${scala.binary.version}</artifactId>
<version>0.1.19</version>
<version>${csv.parser.version}</version>
</dependency>
<dependency>
<groupId>com.nrinaudo</groupId>
<artifactId>kantan.csv-java8_${scala.binary.version}</artifactId>
<version>0.1.19</version>
<version>${csv.parser.version}</version>
</dependency>
<dependency>
<groupId>com.nrinaudo</groupId>
<artifactId>kantan.csv-scalaz_${scala.binary.version}</artifactId>
<version>0.1.19</version>
<version>${csv.parser.version}</version>
</dependency>
<dependency>
<groupId>com.nrinaudo</groupId>
<artifactId>kantan.csv-cats_${scala.binary.version}</artifactId>
<version>0.1.19</version>
<version>${csv.parser.version}</version>
</dependency>
<dependency>
<groupId>com.nrinaudo</groupId>
<artifactId>kantan.csv-generic_${scala.binary.version}</artifactId>
<version>0.1.19</version>
<version>${csv.parser.version}</version>
</dependency>
<dependency>
<groupId>com.nrinaudo</groupId>
<artifactId>kantan.csv-joda-time_${scala.binary.version}</artifactId>
<version>0.1.19</version>
<version>${csv.parser.version}</version>
</dependency>


<dependency>
<groupId>org.json4s</groupId>
<artifactId>json4s-native_${scala.binary.version}</artifactId>
Expand All @@ -164,6 +163,12 @@
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
Expand Down
49 changes: 0 additions & 49 deletions scripts/demo-flights
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
create kafka-config

k1

kafka {
bootstrap.servers="localhost:9092"
key.serializer = "org.apache.kafka.common.serialization.StringSerializer"
Expand All @@ -11,8 +9,6 @@ kafka {

create twirl-template

t1

@import com.stratio.khermes.helpers.faker.Faker
@(faker: Faker)
@defining(faker.Flights.flight) { case (randomFlight) => {
Expand All @@ -38,8 +34,6 @@ t1

create generator-config

g1

khermes {
templates-path = "/tmp/khermes/templates"
topic = "khermes"
Expand All @@ -52,46 +46,3 @@ khermes {
}

}


************* ERROR EN CLUSTER ************


@import scala.util.Random
@import com.stratio.khermes.helpers.faker.Faker
@import com.stratio.khermes.helpers.faker.generators.Positive

@(faker: Faker)
@defining(faker.Flights.flight) { case (randomFlight) =>
{
"Year": "@(randomFlight.Year)",
"Month": "@(randomFlight.Month)",
"DayofMonth": "@(randomFlight.DayofMonth)",
"DayOfWeek": "@(randomFlight.DayOfWeek)",
"DepTime": "@(randomFlight.DepTime)",
"CRSDepTime": "@(randomFlight.CRSDepTime)",
"ArrTime": "@(randomFlight.ArrTime)",
"CRSArrTime": "@(randomFlight.CRSArrTime)",
"UniqueCarrier": "@(randomFlight.UniqueCarrier)",
"FlightNum": "@(randomFlight.FlightNum)",
"TailNum": "@(randomFlight.TailNum)",
"ActualElapsedTime": "@(randomFlight.ActualElapsedTime)",
"CRSElapsedTime": "@(randomFlight.CRSElapsedTime)",
"AirTime": "@(randomFlight.AirTime)",
"ArrDelay": "@(randomFlight.ArrDelay)",
"DepDelay": "@(randomFlight.DepDelay)",
"Origin": "@(randomFlight.Origin)",
"Dest": "@(randomFlight.Dest)",
"Distance": "@(randomFlight.Distance)",
"TaxiIn": "@(randomFlight.TaxiIn)",
"TaxiOut": "@(randomFlight.TaxiOut)",
"Cancelled": "@(randomFlight.Cancelled)",
"CancellationCode": "@(randomFlight.CancellationCode)",
"Diverted": "@(randomFlight.Diverted)",
"CarrierDelay": "@(randomFlight.CarrierDelay)",
"WeatherDelay": "@(randomFlight.WeatherDelay)",
"NASDelay": "@(randomFlight.NASDelay)",
"SecurityDelay": "@(randomFlight.SecurityDelay)",
"LateAircraftDelay": "@(randomFlight.LateAircraftDelay)"
}
}
43 changes: 43 additions & 0 deletions scripts/demo-tickets
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
create kafka-config

kafka {
bootstrap.servers="localhost:9092"
key.serializer = "org.apache.kafka.common.serialization.StringSerializer"
value.serializer = "org.apache.kafka.common.serialization.StringSerializer"
}


create twirl-template

@import scala.util.Random
@import com.stratio.khermes.helpers.faker.generators.Positive
@import com.stratio.khermes.helpers.faker.Faker
@(faker: Faker)
@defining(faker.TicketsStratio.generateTicket) { case (randomTicket) => {
"id": "@(randomTicket.id)",
"idSale": "@(randomTicket.idSale)",
"dateFlat": @(randomTicket.dateFlat),
"date": "@(randomTicket.date)",
"cashier": "@(randomTicket.cashier)",
"clientId": "@(randomTicket.clientId)",
"clientName": "@(randomTicket.clientName)",
"storeId": "@(faker.Number.number(3,Positive))",
"totalSale": @(randomTicket.totalSale),
"lines": [@(randomTicket.lines)],
"pays": [@(randomTicket.pays)]
}}


create generator-config

khermes {
templates-path = "/tmp/khermes/templates"
topic = "tickets"
template-name = "khermestemplate"
i18n = "ALL"

timeout-rules {
number-of-events: 100
duration: 5 seconds
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ akka {
}

zookeeper {
connection = "localhost:2181"
connection = "127.0.0.1:2181"
connectionTimeout = 60000
sessionTimeout = 180000
retryAttempts = 50
Expand Down
Loading

0 comments on commit c315c1a

Please sign in to comment.