Skip to content

Commit

Permalink
Test und Counter fuer Rechnungsnummer
Browse files Browse the repository at this point in the history
  • Loading branch information
mc-b committed Sep 9, 2018
1 parent f004e89 commit 0d54a20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
</manifest>
</archive>
</configuration>
</execution>
</execution>
</executions>
</plugin>
</plugins>
Expand Down Expand Up @@ -185,5 +185,10 @@
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.27</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.27</version>
</dependency>
</dependencies>
</project>
8 changes: 4 additions & 4 deletions src/main/java/ch/mc_b/iot/kafka/AlertConsumer.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class AlertConsumer
{
private static final String REST_URI = "http://camunda:8080/engine-rest/process-definition/key/"; // <prozess>/start
private static Client client = ClientBuilder.newClient();
private static int counter = 1;

public static void main(String[] args) throws Exception
{
Expand All @@ -54,17 +55,16 @@ public static void main(String[] args) throws Exception
String value = record.value();
if ( value != null && value.startsWith( "alert" ) )
{
String text = "{ \"variables\": { \"rnr\": {\"value\": " + 123 + ", \"type\": \"long\"}, " +
String text = "{ \"variables\": { \"rnr\": {\"value\": " + counter++ + ", \"type\": \"long\"}, " +
"\"rbetrag\": {\"value\": " + 100.0 + ", \"type\": \"String\"} } }";
System.out.printf( "offset = %d, value = %s%n", offset, record.value() );
Response rc = client.target( REST_URI )
.path( "RechnungStep3/start" )
.request(MediaType.TEXT_PLAIN)
.post(Entity.entity( text , MediaType.TEXT_PLAIN ) );
.request(MediaType.APPLICATION_JSON)
.post(Entity.entity( text , MediaType.APPLICATION_JSON ) );
System.out.println( rc.getStatus() );
}
}
}
}

}

0 comments on commit 0d54a20

Please sign in to comment.