Skip to content

Commit 129ee63

Browse files
authored
Merge pull request #10 from netifi/feature/update160
Feature/update160
2 parents 78e2cb4 + 3b82fb8 commit 129ee63

File tree

34 files changed

+398
-1922
lines changed

34 files changed

+398
-1922
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,7 @@ gradle-app.setting
103103
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
104104
# gradle/wrapper/gradle-wrapper.properties
105105

106-
# End of https://www.gitignore.io/api/java,linux,macos,gradle,android,intellij,androidstudio
106+
# End of https://www.gitignore.io/api/java,linux,macos,gradle,android,intellij,androidstudio
107+
108+
.vscode/
109+
**/generated/

.mvn/wrapper/MavenWrapperDownloader.java

100755100644
Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
/*
2-
Licensed to the Apache Software Foundation (ASF) under one
3-
or more contributor license agreements. See the NOTICE file
4-
distributed with this work for additional information
5-
regarding copyright ownership. The ASF licenses this file
6-
to you under the Apache License, Version 2.0 (the
7-
"License"); you may not use this file except in compliance
8-
with the License. You may obtain a copy of the License at
9-
10-
http://www.apache.org/licenses/LICENSE-2.0
11-
12-
Unless required by applicable law or agreed to in writing,
13-
software distributed under the License is distributed on an
14-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
KIND, either express or implied. See the License for the
16-
specific language governing permissions and limitations
17-
under the License.
18-
*/
19-
2+
* Copyright 2007-present the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
2016
import java.net.*;
2117
import java.io.*;
2218
import java.nio.channels.*;
2319
import java.util.Properties;
2420

2521
public class MavenWrapperDownloader {
2622

23+
private static final String WRAPPER_VERSION = "0.5.4";
2724
/**
2825
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
2926
*/
30-
private static final String DEFAULT_DOWNLOAD_URL =
31-
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";
27+
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28+
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + " .jar";
3229

3330
/**
3431
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
@@ -76,13 +73,13 @@ public static void main(String args[]) {
7673
}
7774
}
7875
}
79-
System.out.println("- Downloading from: : " + url);
76+
System.out.println("- Downloading from: " + url);
8077

8178
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
8279
if(!outputFile.getParentFile().exists()) {
8380
if(!outputFile.getParentFile().mkdirs()) {
8481
System.out.println(
85-
"- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
82+
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
8683
}
8784
}
8885
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
@@ -98,6 +95,16 @@ public static void main(String args[]) {
9895
}
9996

10097
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99+
String username = System.getenv("MVNW_USERNAME");
100+
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101+
Authenticator.setDefault(new Authenticator() {
102+
@Override
103+
protected PasswordAuthentication getPasswordAuthentication() {
104+
return new PasswordAuthentication(username, password);
105+
}
106+
});
107+
}
101108
URL website = new URL(urlString);
102109
ReadableByteChannel rbc;
103110
rbc = Channels.newChannel(website.openStream());

.mvn/wrapper/maven-wrapper.jar

100755100644
2.32 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

100755100644
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.4/maven-wrapper-0.5.4.jar

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

build.gradle

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1+
plugins {
2+
id "io.spring.dependency-management" version "1.0.7.RELEASE" apply false
3+
}
4+
15
subprojects {
26
apply plugin: 'idea'
7+
apply plugin: 'io.spring.dependency-management'
38

49
group 'io.netifi.proteus.quickstart'
5-
version '1.5.3'
10+
version '1.6.0'
611

7-
// Proteus Versions
8-
ext {
9-
protobufVersion = '3.6.1'
10-
proteusVersion = '1.5.5'
11-
rsocketRpcVersion = '0.2.12'
12-
log4jVersion = '2.9.1'
12+
dependencyManagement {
13+
imports {
14+
mavenBom "io.netifi.proteus:proteus-rsocket-bom:1.6.0"
15+
mavenBom "io.netifi.proteus:proteus-bom:1.6.0"
16+
mavenBom "io.netifi.proteus:proteus-common-dependencies:1.6.0"
17+
}
1318
}
1419

1520
repositories {
@@ -18,4 +23,4 @@ subprojects {
1823
url 'https://dl.bintray.com/netifi/netifi-oss/'
1924
}
2025
}
21-
}
26+
}

client/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ sourceCompatibility = 1.8
88
dependencies {
99
compile project(':service-idl')
1010

11-
compile "io.netifi.proteus:proteus-client:$proteusVersion"
12-
compile "com.google.protobuf:protobuf-java:$protobufVersion"
11+
compile "io.netifi.proteus:proteus-client"
12+
compile "com.google.protobuf:protobuf-java"
1313

14-
compile "org.apache.logging.log4j:log4j-api:$log4jVersion"
15-
compile "org.apache.logging.log4j:log4j-core:$log4jVersion"
16-
compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
14+
compile "org.apache.logging.log4j:log4j-api"
15+
compile "org.apache.logging.log4j:log4j-core"
16+
compile "org.apache.logging.log4j:log4j-slf4j18-impl"
1717
}
1818

19-
mainClassName = 'io.netifi.proteus.quickstart.client.Main'
19+
mainClassName = 'io.netifi.proteus.quickstart.client.Main'

client/pom.xml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,40 @@
66
<parent>
77
<groupId>io.netifi.proteus.quickstart</groupId>
88
<artifactId>proteus-quickstart</artifactId>
9-
<version>1.5.5</version>
9+
<version>1.6.0</version>
1010
</parent>
1111

1212
<artifactId>client</artifactId>
1313
<name>client</name>
14-
<version>1.5.5</version>
14+
<version>1.6.0</version>
1515
<packaging>jar</packaging>
1616

1717
<dependencies>
1818
<dependency>
1919
<groupId>io.netifi.proteus.quickstart</groupId>
2020
<artifactId>service-idl</artifactId>
21-
<version>1.5.5</version>
21+
<version>${project.version}</version>
2222
<scope>compile</scope>
2323
</dependency>
2424
<dependency>
2525
<groupId>io.netifi.proteus</groupId>
2626
<artifactId>proteus-client</artifactId>
27-
<version>${proteusVersion}</version>
2827
</dependency>
2928
<dependency>
3029
<groupId>com.google.protobuf</groupId>
3130
<artifactId>protobuf-java</artifactId>
32-
<version>${protobufVersion}</version>
3331
</dependency>
3432
<dependency>
3533
<groupId>org.apache.logging.log4j</groupId>
3634
<artifactId>log4j-api</artifactId>
37-
<version>${log4j2Version}</version>
3835
</dependency>
3936
<dependency>
4037
<groupId>org.apache.logging.log4j</groupId>
4138
<artifactId>log4j-core</artifactId>
42-
<version>${log4j2Version}</version>
4339
</dependency>
4440
<dependency>
4541
<groupId>org.apache.logging.log4j</groupId>
46-
<artifactId>log4j-slf4j-impl</artifactId>
47-
<version>${log4j2Version}</version>
42+
<artifactId>log4j-slf4j18-impl</artifactId>
4843
</dependency>
4944
</dependencies>
5045

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
11
package io.netifi.proteus.quickstart.client;
22

33
import io.netifi.proteus.Proteus;
4+
import io.netifi.proteus.common.tags.Tags;
45
import io.netifi.proteus.quickstart.service.protobuf.HelloRequest;
56
import io.netifi.proteus.quickstart.service.protobuf.HelloServiceClient;
67
import io.netifi.proteus.rsocket.ProteusSocket;
78
import org.apache.logging.log4j.LogManager;
89
import org.apache.logging.log4j.Logger;
910

10-
/**
11-
* Starts the Proteus Quickstart Client
12-
*/
11+
/** Starts the Proteus Quickstart Client */
1312
public class Main {
14-
private static final Logger logger = LogManager.getLogger(Main.class);
15-
16-
public static void main(String... args) {
17-
18-
// Build Netifi Proteus Connection
19-
Proteus netifi =
20-
Proteus.builder()
21-
.group("quickstart.clients") // Group name of client
22-
.destination("client1") // Name of this client instance
23-
.accessKey(9007199254740991L)
24-
.accessToken("kTBDVtfRBO4tHOnZzSyY5ym2kfY=")
25-
.host("localhost") // Proteus Broker Host
26-
.port(8001) // Proteus Broker Port
27-
.build();
28-
29-
// Connect to Netifi Proteus Platform
30-
ProteusSocket conn = netifi.group("quickstart.services.helloservices");
31-
32-
// Create Client to Communicate with the HelloService (included example service)
33-
HelloServiceClient client = new HelloServiceClient(conn);
34-
35-
// Create Request to HelloService
36-
HelloRequest request = HelloRequest.newBuilder()
37-
.setName("World")
38-
.build();
39-
40-
logger.info("Sending 'World' to HelloService...");
41-
42-
// Call the HelloService
43-
logger.info(client.sayHello(request).block());
44-
}
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+
}
4544
}

docker-compose.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
version: '3.7'
3+
4+
services:
5+
broker1:
6+
image: netifi/proteus:1.6.0
7+
restart: always
8+
networks:
9+
- netifi
10+
environment:
11+
BROKER_SERVER_OPTS: >
12+
'-Dnetifi.broker.console.enabled=true'
13+
'-Dnetifi.broker.ssl.disabled=true'
14+
'-Dnetifi.authentication.0.accessKey=9007199254740991'
15+
'-Dnetifi.authentication.0.accessToken=kTBDVtfRBO4tHOnZzSyY5ym2kfY='
16+
'-Dnetifi.broker.admin.accessKey=9007199254740991'
17+
'-Dnetifi.broker.admin.accessToken=kTBDVtfRBO4tHOnZzSyY5ym2kfY='
18+
ports:
19+
- "7001:7001"
20+
- "8001:8001"
21+
- "8101:8101"
22+
- "9000:9000"
23+
networks:
24+
netifi:

0 commit comments

Comments
 (0)