Skip to content

Commit

Permalink
Building io.rsocket app for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Montura committed May 24, 2022
1 parent 34f2df6 commit f11673c
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 199 deletions.
178 changes: 51 additions & 127 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,82 +27,55 @@
<capcache.version>22.0</capcache.version>
<cap.cache.dir>${project.basedir}/capcache-${capcache.version}</cap.cache.dir>

<spring-boot.version>2.6.7</spring-boot.version>
<spring-native.version>0.11.5</spring-native.version>
<!-- <log4j2.version>2.17.0</log4j2.version>-->
<rsocket.version>1.1.1</rsocket.version>
</properties>

<dependencies>
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graalvm.sdk.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.6.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.springframework.experimental</groupId>
<artifactId>spring-native</artifactId>
<version>${spring-native.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.experimental</groupId>
<artifactId>spring-aot</artifactId>
<version>${spring-native.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-rsocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<!-- <dependencyManagement>-->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<scope>import</scope>
<type>pom</type>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graalvm.sdk.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.rsocket</groupId>
<artifactId>rsocket-core</artifactId>
<version>${rsocket.version}</version>
</dependency>
<dependency>
<groupId>io.rsocket</groupId>
<artifactId>rsocket-transport-netty</artifactId>
<version>${rsocket.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>log4j-over-slf4j</artifactId>-->
<!-- <version>2.0.0-alpha7</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.logging.log4j</groupId>-->
<!-- <artifactId>log4j-api</artifactId>-->
<!-- <version>${log4j2.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.logging.log4j</groupId>-->
<!-- <artifactId>log4j-core</artifactId>-->
<!-- <version>${log4j2.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.7.2</version>
<scope>import</scope>
<type>pom</type>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
<version>1.7.5</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.logging.log4j</groupId>-->
<!-- <artifactId>log4j-slf4j-impl</artifactId>-->
<!-- <version>${log4j2.version}</version>-->
<!-- </dependency>-->
</dependencies>
</dependencyManagement>

<pluginRepositories>
<pluginRepository>
<id>spring-release</id>
<name>Spring release</name>
<url>https://repo.spring.io/release</url>
</pluginRepository>
</pluginRepositories>
<!-- </dependencyManagement>-->

<build>
<plugins>
Expand All @@ -116,35 +89,9 @@
<parameters>true</parameters>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<mainClass>rsocket_test.Test</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>spring-release</id>
<name>Spring release</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<profiles>
<profile>
<id>graal-ios</id>
Expand All @@ -166,6 +113,16 @@
<!-- # https://chriswhocodes.com/graalvm_native_image_ce_jdk11_options.html -->
<buildArgs>
--allow-incomplete-classpath <!-- todo: check is it necessary for SPRING framework ? -->
--initialize-at-build-time=org.apache.log4j.Logger
<!-- &#45;&#45;initialize-at-build-time=org.apache.logging.slf4j.Log4jLogger-->
--initialize-at-build-time=org.slf4j.LoggerFactory
--initialize-at-build-time=org.slf4j.simple.SimpleLogger
--initialize-at-build-time=org.slf4j.impl.StaticLoggerBinder
--initialize-at-run-time=io.netty.util.internal.logging.Log4JLogger
--initialize-at-run-time=io.netty.util.AbstractReferenceCounted
--initialize-at-run-time=io.netty.channel.epoll
--initialize-at-run-time=io.netty.handler.ssl
--initialize-at-run-time=io.netty.channel.unix
--no-fallback
--verbose
-H:DashboardDump=dashboard
Expand Down Expand Up @@ -195,39 +152,6 @@
</executions>
</plugin>

<plugin>
<groupId>org.springframework.experimental</groupId>
<artifactId>spring-aot-maven-plugin</artifactId>
<version>${spring-native.version}</version>
<configuration>
<removeSpelSupport>true</removeSpelSupport>
<removeYamlSupport>true</removeYamlSupport>
</configuration>
<executions>
<execution>
<id>test-generate</id>
<goals>
<goal>test-generate</goal>
</goals>
</execution>
<execution>
<id>generate</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down
22 changes: 0 additions & 22 deletions src/main/java/rsocket_test/AppUser.java

This file was deleted.

21 changes: 0 additions & 21 deletions src/main/java/rsocket_test/RSocketController.java

This file was deleted.

25 changes: 19 additions & 6 deletions src/main/java/rsocket_test/Test.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
package rsocket_test;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import io.rsocket.Payload;
import io.rsocket.RSocket;
import io.rsocket.core.RSocketConnector;
import io.rsocket.transport.netty.client.WebsocketClientTransport;
import io.rsocket.util.DefaultPayload;
import reactor.core.publisher.Flux;

import java.net.URI;

@SpringBootApplication(proxyBeanMethods = false)
public class Test {
public static void main(String[] args) {
System.out.println("Hello from Java");
SpringApplication.run(Test.class, args);
WebsocketClientTransport ws = WebsocketClientTransport.create(URI.create("ws://rsocket-demo.herokuapp.com/ws"));
RSocket clientRSocket = RSocketConnector.connectWith(ws).block();

try {
Flux<Payload> s = clientRSocket.requestStream(DefaultPayload.create("peace"));

s.take(10).doOnNext(p -> System.out.println(p.getDataUtf8())).blockLast();
} finally {
clientRSocket.dispose();
}
}
}
}
5 changes: 0 additions & 5 deletions src/main/java/rsocket_test/UserService.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/resources/application.properties

This file was deleted.

0 comments on commit f11673c

Please sign in to comment.