|
8 | 8 | import org.apache.logging.log4j.LogManager;
|
9 | 9 | import org.apache.logging.log4j.Logger;
|
10 | 10 |
|
11 |
| -/** |
12 |
| - * Starts the Proteus Quickstart Client |
13 |
| - */ |
| 11 | +/** Starts the Proteus Quickstart Client */ |
14 | 12 | public class Main {
|
15 |
| - private static final Logger logger = LogManager.getLogger(Main.class); |
16 |
| - |
17 |
| - public static void main(String... args) { |
18 |
| - |
19 |
| - // Build Netifi Proteus Connection |
20 |
| - Proteus netifi = |
21 |
| - Proteus.tcp() |
22 |
| - .group("quickstart.clients") // Group name of client |
23 |
| - .destination("client1") // Name of this client instance |
24 |
| - .accessKey(9007199254740991L) |
25 |
| - .accessToken("kTBDVtfRBO4tHOnZzSyY5ym2kfY=") |
26 |
| - .host("localhost") // Proteus Broker Host |
27 |
| - .port(8001) // Proteus Broker Port |
28 |
| - .disableSsl() // Disabled for parity with Javascript Tutorial |
29 |
| - .build(); |
30 |
| - |
31 |
| - // Connect to Netifi Proteus Platform |
32 |
| - ProteusSocket conn = netifi.groupServiceSocket("quickstart.services.helloservices", |
33 |
| - Tags.empty()); |
34 |
| - |
35 |
| - // Create Client to Communicate with the HelloService (included example service) |
36 |
| - HelloServiceClient client = new HelloServiceClient(conn); |
37 |
| - |
38 |
| - // Create Request to HelloService |
39 |
| - HelloRequest request = HelloRequest.newBuilder() |
40 |
| - .setName("World") |
41 |
| - .build(); |
42 |
| - |
43 |
| - logger.info("Sending 'World' to HelloService..."); |
44 |
| - |
45 |
| - // Call the HelloService |
46 |
| - logger.info(client.sayHello(request).block()); |
47 |
| - } |
| 13 | + private static final Logger logger = LogManager.getLogger(Main.class); |
| 14 | + |
| 15 | + public static void main(String... args) { |
| 16 | + |
| 17 | + // Build Netifi Proteus Connection |
| 18 | + Proteus netifi = |
| 19 | + Proteus.tcp() |
| 20 | + .group("quickstart.clients") // Group name of client |
| 21 | + .destination("client1") // Name of this client instance |
| 22 | + .accessKey(9007199254740991L) |
| 23 | + .accessToken("kTBDVtfRBO4tHOnZzSyY5ym2kfY=") |
| 24 | + .host("localhost") // Proteus Broker Host |
| 25 | + .port(8001) // Proteus Broker Port |
| 26 | + .disableSsl() // Disabled for parity with Javascript Tutorial |
| 27 | + .build(); |
| 28 | + |
| 29 | + // Connect to Netifi Proteus Platform |
| 30 | + ProteusSocket conn = |
| 31 | + netifi.groupServiceSocket("quickstart.services.helloservices", Tags.empty()); |
| 32 | + |
| 33 | + // Create Client to Communicate with the HelloService (included example service) |
| 34 | + HelloServiceClient client = new HelloServiceClient(conn); |
| 35 | + |
| 36 | + // Create Request to HelloService |
| 37 | + HelloRequest request = HelloRequest.newBuilder().setName("World").build(); |
| 38 | + |
| 39 | + logger.info("Sending 'World' to HelloService..."); |
| 40 | + |
| 41 | + // Call the HelloService |
| 42 | + logger.info(client.sayHello(request).block()); |
| 43 | + } |
48 | 44 | }
|
0 commit comments