Skip to content

Commit 985383a

Browse files
authored
Merge pull request #721 from scalecube/develop
Prepare release
2 parents 5856d0f + cc6b75d commit 985383a

File tree

79 files changed

+1276
-1750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1276
-1750
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
custom:
2+
- https://www.om2.com/
3+
- https://exberry.io/

.github/release-drafter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
template: |
2+
## What’s Changed
3+
4+
$CHANGES

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ addons:
44
- libxml-xpath-perl
55
sudo: required
66
language: java
7-
jdk: openjdk8
7+
jdk: openjdk11
88
before_install:
99
- "./src/main/scripts/ci/before-install.sh"
1010
- "./src/main/scripts/cd/before-deploy.sh"

README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,27 @@ based on gossip protocol, without single point-of-failure or bottlenecks.<br><br
2121
</table>
2222
ScaleCube Services Features:
2323

24-
* Provision and interconnect microservices as a service-mesh (cluster)</li>
24+
* Provision and interconnect microservices peers in a cluster
25+
* Fully Distributed with No single-point-of-failure or single-point-of-bottleneck
26+
* Fast - Low latency and high throughput
27+
* Scaleable over- cores, jvms, clusters, regions.
28+
* Built-in Service Discovery and service routing
29+
* Zero configuration, automatic peer-to-peer service discovery using gossip
30+
* Simple non-blocking, asynchronous programming model
2531
* Reactive Streams support.
2632
* Fire And Forget - Send and not wait for a reply
2733
* Request Response - Send single request and expect single reply
2834
* Request Stream - Send single request and expect stream of responses.
2935
* Request bidirectional - send stream of requests and expect stream of responses.
30-
* No single-point-of-failure or single-point-of-bottleneck
31-
* Cluster aware and distributed
32-
* Modular, flexible deployment models and topology
33-
* Zero configuration, automatic peer-to-peer service discovery using gossip
34-
* Simple non-blocking, asynchronous programming model
35-
* Resilient due to failure detection, fault tolerance, and elasticity
36+
* Built-in failure detection, fault tolerance, and elasticity
3637
* Routing and balancing strategies for both stateless and stateful services
37-
* Low latency and high throughput
38-
* Takes advantage of the JVM and scales over available cores
39-
* Embeddable to existing Java applications
40-
* Natural Circuit-Breaker due to tight integration with scalecube-cluster failure detector.
38+
* Embeddable into existing applications
39+
* Natural Circuit-Breaker via scalecube-cluster discovery and failure detector.
4140
* Support Service instance tagging.
41+
* Modular, flexible deployment models and topology
4242
* pluggable api-gateway providers (http / websocket / rsocket)
43-
* pluggable service transport
44-
* pluggable encoders
43+
* pluggable service transports (tcp / aeron / rsocket)
44+
* pluggable encoders (json, SBE, Google protocol buffers)
4545

4646
User Guide:
4747

@@ -199,5 +199,9 @@ To add a dependency on ScaleCube Services using Maven, use the following:
199199
<groupId>io.scalecube</groupId>
200200
<artifactId>scalecube-services-transport-rsocket</artifactId>
201201
<version>${scalecube.version}</version>
202-
</dependency>
203-
202+
</dependency>
203+
```
204+
205+
----
206+
207+
## Sponsored by [OM2](https://www.om2.com/)

pom.xml

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<modelVersion>4.0.0</modelVersion>
44

55
<artifactId>scalecube-services-parent</artifactId>
6-
<version>2.8.11-SNAPSHOT</version>
6+
<version>2.9.0-SNAPSHOT</version>
77

88
<parent>
99
<groupId>io.scalecube</groupId>
1010
<artifactId>scalecube-parent-pom</artifactId>
11-
<version>0.0.19</version>
11+
<version>0.1.0-RC1</version>
1212
</parent>
1313
<packaging>pom</packaging>
1414

@@ -23,17 +23,17 @@
2323

2424
<properties>
2525
<jackson.version>2.10.0.pr1</jackson.version>
26-
<scalecube-cluster.version>2.4.9</scalecube-cluster.version>
27-
<scalecube-commons.version>1.0.1</scalecube-commons.version>
26+
<scalecube-cluster.version>2.4.10</scalecube-cluster.version>
27+
<scalecube-commons.version>1.0.2</scalecube-commons.version>
2828
<scalecube-benchmarks.version>1.2.2</scalecube-benchmarks.version>
29-
<scalecube-config.version>0.3.11</scalecube-config.version>
30-
<reactor.version>Californium-SR8</reactor.version>
31-
<rsocket.version>0.11.21</rsocket.version>
29+
<scalecube-config.version>0.4.3</scalecube-config.version>
30+
<reactor.version>Dysprosium-RELEASE</reactor.version>
31+
<rsocket.version>1.0.0-RC5</rsocket.version>
3232
<metrics.version>3.1.2</metrics.version>
3333
<protostuff.version>1.6.0</protostuff.version>
34-
<netty.version>4.1.36.Final</netty.version>
35-
<reactor-netty.version>0.8.8.RELEASE</reactor-netty.version>
36-
<slf4j.version>1.7.7</slf4j.version>
34+
<netty.version>4.1.37.Final</netty.version>
35+
<reactor-netty.version>0.9.0.RELEASE</reactor-netty.version>
36+
<slf4j.version>1.7.30</slf4j.version>
3737
<log4j.version>2.11.0</log4j.version>
3838
<disruptor.version>3.4.2</disruptor.version>
3939
<jsr305.version>3.0.2</jsr305.version>
@@ -69,6 +69,16 @@
6969
<artifactId>scalecube-cluster</artifactId>
7070
<version>${scalecube-cluster.version}</version>
7171
</dependency>
72+
<dependency>
73+
<groupId>io.scalecube</groupId>
74+
<artifactId>scalecube-codec-jackson</artifactId>
75+
<version>${scalecube-cluster.version}</version>
76+
</dependency>
77+
<dependency>
78+
<groupId>io.scalecube</groupId>
79+
<artifactId>scalecube-codec-jackson-smile</artifactId>
80+
<version>${scalecube-cluster.version}</version>
81+
</dependency>
7282

7383
<!-- Scalecube Config -->
7484
<dependency>
@@ -112,30 +122,19 @@
112122
<!-- RSocket -->
113123
<dependency>
114124
<groupId>io.rsocket</groupId>
115-
<artifactId>rsocket-core</artifactId>
116-
<version>${rsocket.version}</version>
117-
</dependency>
118-
<dependency>
119-
<groupId>io.rsocket</groupId>
120-
<artifactId>rsocket-transport-netty</artifactId>
125+
<artifactId>rsocket-bom</artifactId>
121126
<version>${rsocket.version}</version>
127+
<type>pom</type>
128+
<scope>import</scope>
122129
</dependency>
123130

124131
<!-- Jackson -->
125132
<dependency>
126-
<groupId>com.fasterxml.jackson.core</groupId>
127-
<artifactId>jackson-core</artifactId>
128-
<version>${jackson.version}</version>
129-
</dependency>
130-
<dependency>
131-
<groupId>com.fasterxml.jackson.core</groupId>
132-
<artifactId>jackson-databind</artifactId>
133-
<version>${jackson.version}</version>
134-
</dependency>
135-
<dependency>
136-
<groupId>com.fasterxml.jackson.datatype</groupId>
137-
<artifactId>jackson-datatype-jsr310</artifactId>
133+
<groupId>com.fasterxml.jackson</groupId>
134+
<artifactId>jackson-bom</artifactId>
138135
<version>${jackson.version}</version>
136+
<type>pom</type>
137+
<scope>import</scope>
139138
</dependency>
140139

141140
<!-- Protostuff/Protobuf -->
@@ -161,20 +160,12 @@
161160
</dependency>
162161

163162
<!-- Netty -->
164-
<dependency>
165-
<groupId>io.projectreactor.netty</groupId>
166-
<artifactId>reactor-netty</artifactId>
167-
<version>${reactor-netty.version}</version>
168-
</dependency>
169163
<dependency>
170164
<groupId>io.netty</groupId>
171-
<artifactId>netty-common</artifactId>
172-
<version>${netty.version}</version>
173-
</dependency>
174-
<dependency>
175-
<groupId>io.netty</groupId>
176-
<artifactId>netty-buffer</artifactId>
165+
<artifactId>netty-bom</artifactId>
177166
<version>${netty.version}</version>
167+
<type>pom</type>
168+
<scope>import</scope>
178169
</dependency>
179170

180171
<!-- Scalecube benchmarks -->
@@ -259,15 +250,15 @@
259250
</snapshots>
260251
<id>bintray</id>
261252
<name>bintray</name>
262-
<url>http://jcenter.bintray.com</url>
253+
<url>https://jcenter.bintray.com</url>
263254
</repository>
264255
<repository>
265256
<snapshots>
266257
<enabled>false</enabled>
267258
</snapshots>
268259
<id>central</id>
269260
<name>central</name>
270-
<url>http://repo1.maven.org</url>
261+
<url>https://repo1.maven.org</url>
271262
</repository>
272263
</repositories>
273264

@@ -286,7 +277,7 @@
286277
</snapshots>
287278
<id>central</id>
288279
<name>bintray-plugins</name>
289-
<url>http://jcenter.bintray.com</url>
280+
<url>https://jcenter.bintray.com</url>
290281
</pluginRepository>
291282
</pluginRepositories>
292283

services-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>io.scalecube</groupId>
88
<artifactId>scalecube-services-parent</artifactId>
9-
<version>2.8.11-SNAPSHOT</version>
9+
<version>2.9.0-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>scalecube-services-api</artifactId>

services-api/src/main/java/io/scalecube/services/Reflect.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import io.scalecube.services.auth.Auth;
1616
import io.scalecube.services.auth.Principal;
1717
import io.scalecube.services.methods.MethodInfo;
18-
import java.lang.reflect.Field;
1918
import java.lang.reflect.Method;
2019
import java.lang.reflect.Parameter;
2120
import java.lang.reflect.ParameterizedType;
@@ -133,6 +132,7 @@ public static boolean isRequestTypeServiceMessage(Method method) {
133132
* @param object to inspect
134133
* @return the parameterized Type of a given object or Object class if unknown.
135134
*/
135+
@SuppressWarnings("unused")
136136
public static Type parameterizedType(Object object) {
137137
if (object != null) {
138138
Type type = object.getClass().getGenericSuperclass();
@@ -269,7 +269,7 @@ public static String methodName(Method method) {
269269
*
270270
* @param serviceInterface service interface to get qualifier for
271271
* @param method service's method to get qualifier for
272-
* @return
272+
* @return qualifier string
273273
*/
274274
public static String qualifier(Class<?> serviceInterface, Method method) {
275275
return Qualifier.asString(Reflect.serviceName(serviceInterface), Reflect.methodName(method));
@@ -387,12 +387,6 @@ private static boolean isRequestChannel(Method method) {
387387
|| Publisher.class.isAssignableFrom(reqTypes[0]));
388388
}
389389

390-
public static void setField(Field field, Object object, Object value)
391-
throws IllegalAccessException {
392-
field.setAccessible(true);
393-
field.set(object, value);
394-
}
395-
396390
public static boolean isService(Class<?> type) {
397391
return type.isAnnotationPresent(Service.class);
398392
}

services-api/src/main/java/io/scalecube/services/ServiceCall.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.lang.reflect.Proxy;
2020
import java.lang.reflect.Type;
2121
import java.util.Collections;
22+
import java.util.HashMap;
2223
import java.util.Map;
2324
import java.util.Optional;
2425
import java.util.concurrent.Callable;
@@ -48,6 +49,7 @@ public class ServiceCall {
4849
// no-op
4950
};
5051
private Map<String, String> credentials = Collections.emptyMap();
52+
private String contentType;
5153

5254
/** Default constructor. */
5355
public ServiceCall() {}
@@ -58,6 +60,9 @@ private ServiceCall(ServiceCall other) {
5860
this.serviceRegistry = other.serviceRegistry;
5961
this.router = other.router;
6062
this.errorMapper = other.errorMapper;
63+
this.contentType = other.contentType;
64+
this.requestReleaser = other.requestReleaser;
65+
this.credentials = new HashMap<>(other.credentials);
6166
}
6267

6368
/**
@@ -156,6 +161,18 @@ public ServiceCall credentials(Map<String, String> credentials) {
156161
return target;
157162
}
158163

164+
/**
165+
* Creates new {@link ServiceCall}'s definition with a given content type.
166+
*
167+
* @param contentType content type.
168+
* @return new {@link ServiceCall} instance.
169+
*/
170+
public ServiceCall contentType(String contentType) {
171+
ServiceCall target = new ServiceCall(this);
172+
target.contentType = contentType;
173+
return target;
174+
}
175+
159176
/**
160177
* Issues fire-and-forget request.
161178
*
@@ -404,6 +421,7 @@ public Object invoke(Object proxy, Method method, Object[] params) {
404421
case REQUEST_CHANNEL:
405422
// this is REQUEST_CHANNEL so it means params[0] must
406423
// be a publisher - its safe to cast.
424+
//noinspection rawtypes
407425
return serviceCall
408426
.requestBidirectional(
409427
Flux.from((Publisher) request)
@@ -434,13 +452,15 @@ private ServiceMessage toServiceMessage(MethodInfo methodInfo, Object request) {
434452
return ServiceMessage.from((ServiceMessage) request)
435453
.qualifier(methodInfo.serviceName(), methodInfo.methodName())
436454
.headers(credentials)
455+
.dataFormatIfAbsent(contentType)
437456
.build();
438457
}
439458

440459
return ServiceMessage.builder()
441460
.qualifier(methodInfo.serviceName(), methodInfo.methodName())
442461
.headers(credentials)
443462
.data(request)
463+
.dataFormatIfAbsent(contentType)
444464
.build();
445465
}
446466

0 commit comments

Comments
 (0)