Skip to content

Commit

Permalink
Merge pull request #42 from reactivegroup/feature/multi_component
Browse files Browse the repository at this point in the history
feat: add multi component client supported
  • Loading branch information
kevinten10 authored Nov 30, 2021
2 parents 0904747 + a1d872c commit 758a522
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ For a Maven project, add the following to your `pom.xml` file:
<dependency>
<groupId>group.rxcloud</groupId>
<artifactId>cloud-runtimes-api</artifactId>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>
</dependency>
...
</dependencies>
Expand All @@ -62,6 +62,6 @@ For a Gradle project, add the following to your `build.gradle` file:
dependencies {
...
// https://mvnrepository.com/artifact/group.rxcloud/cloud-runtimes-api
implementation group: 'group.rxcloud', name: 'cloud-runtimes-api', version: '1.0.8.RELEASE'
implementation group: 'group.rxcloud', name: 'cloud-runtimes-api', version: '1.0.9.RELEASE'
}
```
4 changes: 2 additions & 2 deletions cloud-runtimes-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
<parent>
<groupId>group.rxcloud</groupId>
<artifactId>cloud-runtimes</artifactId>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>
</parent>

<artifactId>cloud-runtimes-api</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>

<properties>
<reactor-core.version>3.4.9</reactor-core.version>
<reactor-core.version>3.3.22.RELEASE</reactor-core.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@
import group.rxcloud.cloudruntimes.EnhancedCloudRuntimes;
import reactor.core.publisher.Mono;

import java.util.List;

/**
* Cloud Runtimes JVM Client.
*/
public interface CloudRuntimesClient extends AutoCloseable, CoreCloudRuntimes, EnhancedCloudRuntimes {

/**
* Registry Component names.
*/
List<String> registryNames();

/**
* Waits for the sidecar, giving up after timeout.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ default <T> Mono<T> invokeBinding(InvokeBindingRequest request, TypeRef<T> type)
}

@Override
default <T> Mono<T> invokeMethod(String appId, String methodName, Object data, HttpExtension httpExtension, Map<String, String> metadata, TypeRef<T> type) {
default <T> Mono<T> invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, Map<String, String> metadata, TypeRef<T> type) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

Expand Down Expand Up @@ -461,6 +461,9 @@ default Mono<Void> shutdown() {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
List<String> registryNames();

@Override
void close();
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public interface InvocationRuntimes {
*
* @param appId The Application ID where the service is.
* @param methodName The actual Method to be call in the application.
* @param data The data to be sent to invoke the service, use byte[] to skip serialization.
* @param request The request to be sent to invoke the service, use byte[] to skip serialization.
* @param httpExtension Additional fields that are needed if the receiving app is listening on
* HTTP, {@link HttpExtension#NONE} otherwise.
* @param metadata Metadata (in GRPC) or headers (in HTTP) to be sent in data.
* @param type The Type needed as return for the call.
* @param <T> The Type of the return, use byte[] to skip serialization.
* @return A Mono Plan of type T.
*/
<T> Mono<T> invokeMethod(String appId, String methodName, Object data, HttpExtension httpExtension,
<T> Mono<T> invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension,
Map<String, String> metadata, TypeRef<T> type);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
import group.rxcloud.cloudruntimes.utils.TypeRef;
import reactor.core.publisher.Mono;

/**
* TODO: 2021/10/12 API
* <p>
* see https://github.com/dapr/dapr/issues/3354
*/
public interface DatabaseRuntimes {

// TODO: 2021/10/12 API
// see https://github.com/dapr/dapr/issues/3354

// -- Database Base Operation API

/**
Expand Down Expand Up @@ -91,7 +93,6 @@ public interface DatabaseRuntimes {
*/
Mono<UpdateResponse> update(String dbName, String tableName, Object data);

// TODO: 2021/10/12 TODO
// -- Database Transaction Operation API

Mono<Void> BeginTransaction();
Expand Down
11 changes: 6 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<groupId>group.rxcloud</groupId>
<artifactId>cloud-runtimes</artifactId>
<packaging>pom</packaging>
<version>1.0.8.RELEASE</version>
<version>1.0.9.RELEASE</version>

<name>cloud-runtimes-jvm</name>
<description>Cloud Runtimes Specification for the JVM.</description>
Expand All @@ -46,7 +46,7 @@
<email>[email protected]</email>
</developer>
<developer>
<name>recklessctrip</name>
<name>reckless11</name>
<email>[email protected]</email>
</developer>
</developers>
Expand Down Expand Up @@ -76,15 +76,16 @@
<java.version>8</java.version>
<file.encoding>UTF-8</file.encoding>
<maven.version>3.8.1</maven.version>
<open.telemetry.version>1.9.0</open.telemetry.version>
<open.telemetry.version.alpha>1.9.0-alpha</open.telemetry.version.alpha>
<junit.version>5.3.1</junit.version>

<checkstyle.version>3.1.2</checkstyle.version>
<checkstyle.skip>false</checkstyle.skip>
<apache.rat.version>0.13</apache.rat.version>
<cobertura.maven.version>2.7</cobertura.maven.version>
<maven.surefire.version>3.0.0-M1</maven.surefire.version>
<maven.jacoco.version>0.8.6</maven.jacoco.version>
<junit.version>5.3.1</junit.version>
<open.telemetry.version>1.9.0</open.telemetry.version>
<open.telemetry.version.alpha>1.9.0-alpha</open.telemetry.version.alpha>
</properties>

<dependencyManagement>
Expand Down

0 comments on commit 758a522

Please sign in to comment.