This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.lightbend.lagom</groupId> | |
<artifactId>lagom-maven-dependencies</artifactId> | |
<version>${lagom.version}</version> | |
<scope>import</scope> | |
<type>pom</type> | |
</dependency> | |
<dependency> | |
<groupId>org.projectlombok</groupId> | |
<artifactId>lombok</artifactId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>com.lightbend.lagom</groupId> | |
<artifactId>lagom-maven-plugin</artifactId> | |
<version>${lagom.version}</version> | |
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET: http://localhost:9000/api/hello/AliceInWonderland | |
Result: Hello, AliceInWonderland! | |
POST: curl -H "Content-Type: application/json" -X POST -d '{"mssage": "Hi"}' http://localhost:9000/api/hello/TestMe | |
Result: { "done": true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return named("hellooo").withCalls( | |
pathCall("/api/hello/:id", this::hello), | |
pathCall("/api/hello/:id", this::useGreeting)). | |
withTopics(topic("hello-events", this::helloEvents). | |
withProperty(KafkaProperties.partitionKeyStrategy(), HelloEvent:: getName)).withAutoAcl(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[INFO] Service hello-impl listening for HTTP on 0:0:0:0:0:0:0:0:57797 | |
[INFO] Service stream-impl listening for HTTP on 0:0:0:0:0:0:0:0:58445 | |
[INFO] (Services started, press enter to stop and go back to the console…) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.example.allibilli.hello.impl.HelloServiceImpl [] - Streaming....HelloEvent.GreetingMessageChanged(name=Gopi, message=Gopi), 038caf70-7582-11e8-bb88-53b56a828326 | |
org.example.allibilli.hello.impl.HelloServiceImpl [] - Streaming....HelloEvent.GreetingMessageChanged(name=Gopi, message=Topi), 209b5850-7582-11e8-bb88-53b56a828326 | |
org.example.allibilli.hello.impl.HelloServiceImpl [] - Streaming....HelloEvent.GreetingMessageChanged(name=Gopi, message=Krishna), 43465080-7582-11e8-bb88-53b56a828326 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: A simple payload that can kick off the API | |
Background: | |
* url baseURL+'/test' | |
* configure headers = read('classpath:headers.js') | |
* def payload = read('payload.json') | |
Scenario: Create and Retrieve a menu by Id | |
And request payload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ http-nio-8080-exec-2] 2018-07-14 19:12:24 INFO com.allibilli.nio.api.AppService - ASYNC + SYNC POST: | |
[ http-nio-8080-exec-2] 2018-07-14 19:12:24 INFO com.allibilli.nio.async.AsyncMaker - POST: ASync Request: https://reqres.in/api/users - {"name": "Gopi","job": "Engineer"} | |
[ http-nio-8080-exec-2] 2018-07-14 19:12:25 INFO com.allibilli.nio.async.AsyncMaker - POST: ASync Request: https://reqres.in/api/users - {"name": "Gopi","job": "Engineer"} | |
[ http-nio-8080-exec-2] 2018-07-14 19:12:25 INFO com.allibilli.nio.async.AsyncMaker - POST: ASync Request: https://reqres.in/api/users - {"name": "Gopi","job": "Engineer"} | |
[ http-nio-8080-exec-2] 2018-07-14 19:12:25 INFO com.allibilli.nio.async.AsyncMaker - POST: ASync Request: https://reqres.in/api/users - {"name": "Gopi","job": "Engineer"} | |
[ http-nio-8080-exec-2] 2018-07-14 19:12:25 INFO com.allibilli.nio.async.AsyncMaker - POST: ASync Request: https://reqres.in/api/users - {"name": "Gopi","job": "Engineer"} | |
[ http-nio-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void initiateOutboundSyncReactor(ConcurrentLinkedQueue<Tuple3<String, String, HttpMethod>> q) { | |
simpleReact. | |
from(q.stream().map(it -> syncMaker.call(q.poll()))). | |
then(resp -> syncMaker.handleSyncResponse(resp)). | |
onFail(e -> syncMaker.handleError(e, e.getValue())); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void createGetQ(){ | |
for (int i = 0; i <= 10; ++i) { | |
Tuple3<String, String, HttpMethod> getTuple = new Tuple3("https://reqres.in/api/users/2?delay=3", payload, HttpMethod.GET); | |
get.add(getTuple); | |
} | |
} |
OlderNewer