diff --git a/pom.xml b/pom.xml
index d09049960..94c61f3f5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
io.scalecube
scalecube-parent
- 0.2.20
+ 0.3.1
scalecube-services-parent
@@ -59,23 +59,22 @@
- 2.6.18.rc1
- 1.0.32
+ 2.6.18.RC10
+ 1.0.33.RC1
2020.0.32
- 2.15.1
+ 2.18.0
4.1.93.Final
1.1.4
1.6.0
- 1.7.36
- 2.17.2
- 3.4.2
3.0.2
2.1.2
4.6.1
5.8.2
1.3
+ 2.17.2
+ 1.7.36
https://maven.pkg.github.com/scalecube/scalecube-services
@@ -150,13 +149,6 @@
import
-
-
- com.lmax
- disruptor
- ${disruptor.version}
-
-
io.rsocket
diff --git a/services-discovery/pom.xml b/services-discovery/pom.xml
index 21c370316..3a4e9e69f 100644
--- a/services-discovery/pom.xml
+++ b/services-discovery/pom.xml
@@ -14,13 +14,11 @@
io.scalecube
scalecube-cluster
-
io.scalecube
scalecube-services-api
${project.version}
-
org.apache.logging.log4j
@@ -32,7 +30,6 @@
log4j-core
test
-
io.scalecube
scalecube-codec-jackson
diff --git a/services-discovery/src/main/java/io/scalecube/services/discovery/ScalecubeServiceDiscovery.java b/services-discovery/src/main/java/io/scalecube/services/discovery/ScalecubeServiceDiscovery.java
index 4874b99ec..cb482b259 100644
--- a/services-discovery/src/main/java/io/scalecube/services/discovery/ScalecubeServiceDiscovery.java
+++ b/services-discovery/src/main/java/io/scalecube/services/discovery/ScalecubeServiceDiscovery.java
@@ -18,19 +18,19 @@
import io.scalecube.services.ServiceEndpoint;
import io.scalecube.services.discovery.api.ServiceDiscovery;
import io.scalecube.services.discovery.api.ServiceDiscoveryEvent;
+import java.lang.System.Logger;
+import java.lang.System.Logger.Level;
import java.nio.ByteBuffer;
import java.time.Duration;
import java.util.StringJoiner;
import java.util.function.UnaryOperator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import reactor.core.Exceptions;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Sinks;
public final class ScalecubeServiceDiscovery implements ServiceDiscovery {
- private static final Logger LOGGER = LoggerFactory.getLogger(ServiceDiscovery.class);
+ private static final Logger LOGGER = System.getLogger(ServiceDiscovery.class.getName());
private ClusterConfig clusterConfig;
private Cluster cluster;
@@ -107,17 +107,18 @@ public void shutdown() {
}
private void onMembershipEvent(MembershipEvent membershipEvent) {
- LOGGER.debug("onMembershipEvent: {}", membershipEvent);
+ LOGGER.log(Level.DEBUG, "onMembershipEvent: {0}", membershipEvent);
ServiceDiscoveryEvent discoveryEvent = toServiceDiscoveryEvent(membershipEvent);
if (discoveryEvent == null) {
- LOGGER.warn(
- "DiscoveryEvent is null, cannot publish it (corresponding membershipEvent: {})",
+ LOGGER.log(
+ Level.WARNING,
+ "DiscoveryEvent is null, cannot publish it (corresponding membershipEvent: {0})",
membershipEvent);
return;
}
- LOGGER.debug("Publish discoveryEvent: {}", discoveryEvent);
+ LOGGER.log(Level.DEBUG, "Publish discoveryEvent: {0}", discoveryEvent);
sink.emitNext(discoveryEvent, busyLooping(Duration.ofSeconds(3)));
}
@@ -141,7 +142,7 @@ private ServiceEndpoint toServiceEndpoint(ByteBuffer byteBuffer) {
try {
return (ServiceEndpoint) clusterConfig.metadataCodec().deserialize(byteBuffer.duplicate());
} catch (Exception e) {
- LOGGER.error("Failed to read metadata", e);
+ LOGGER.log(Level.ERROR, "Failed to read metadata", e);
throw Exceptions.propagate(e);
}
}
diff --git a/services-examples/pom.xml b/services-examples/pom.xml
index b924d66ee..5c590bef1 100644
--- a/services-examples/pom.xml
+++ b/services-examples/pom.xml
@@ -49,18 +49,17 @@
fastutil
8.1.1
-
- org.slf4j
- slf4j-api
+ org.apache.logging.log4j
+ log4j-core
org.apache.logging.log4j
- log4j-slf4j-impl
+ log4j-jpl
org.apache.logging.log4j
- log4j-core
+ log4j-slf4j-impl
diff --git a/services-gateway/pom.xml b/services-gateway/pom.xml
index 8bfff3973..f49ecc333 100644
--- a/services-gateway/pom.xml
+++ b/services-gateway/pom.xml
@@ -42,10 +42,6 @@
org.jctools
jctools-core
-
- org.slf4j
- slf4j-api
-
@@ -79,12 +75,12 @@
org.apache.logging.log4j
- log4j-core
+ log4j-jpl
test
- com.lmax
- disruptor
+ org.apache.logging.log4j
+ log4j-core
test
diff --git a/services-gateway/src/main/java/io/scalecube/services/gateway/GatewaySessionHandler.java b/services-gateway/src/main/java/io/scalecube/services/gateway/GatewaySessionHandler.java
index 650894d59..dbe6d2be5 100644
--- a/services-gateway/src/main/java/io/scalecube/services/gateway/GatewaySessionHandler.java
+++ b/services-gateway/src/main/java/io/scalecube/services/gateway/GatewaySessionHandler.java
@@ -2,15 +2,15 @@
import io.netty.buffer.ByteBuf;
import io.scalecube.services.api.ServiceMessage;
+import java.lang.System.Logger;
+import java.lang.System.Logger.Level;
import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import reactor.core.publisher.Mono;
import reactor.util.context.Context;
public interface GatewaySessionHandler {
- Logger LOGGER = LoggerFactory.getLogger(GatewaySessionHandler.class);
+ Logger LOGGER = System.getLogger(GatewaySessionHandler.class.getName());
GatewaySessionHandler DEFAULT_INSTANCE = new GatewaySessionHandler() {};
@@ -59,8 +59,9 @@ default void onResponse(
* @param context subscriber context
*/
default void onError(GatewaySession session, Throwable throwable, Context context) {
- LOGGER.error(
- "Exception occurred on session: {}, on context: {}, cause:",
+ LOGGER.log(
+ Level.ERROR,
+ "Exception occurred on session: {0,number,#}, on context: {1}",
session.sessionId(),
context,
throwable);
@@ -73,7 +74,8 @@ default void onError(GatewaySession session, Throwable throwable, Context contex
* @param throwable an exception that occurred (not null)
*/
default void onSessionError(GatewaySession session, Throwable throwable) {
- LOGGER.error("Exception occurred on session: {}, cause:", session.sessionId(), throwable);
+ LOGGER.log(
+ Level.ERROR, "Exception occurred on session: {0,number,#}", session.sessionId(), throwable);
}
/**
@@ -86,8 +88,11 @@ default void onSessionError(GatewaySession session, Throwable throwable) {
default Mono onConnectionOpen(long sessionId, Map headers) {
return Mono.fromRunnable(
() ->
- LOGGER.debug(
- "Connection opened, sessionId: {}, headers({})", sessionId, headers.size()));
+ LOGGER.log(
+ Level.DEBUG,
+ "Connection opened, sessionId: {0,number,#}, headers({1})",
+ sessionId,
+ headers.size()));
}
/**
@@ -96,7 +101,7 @@ default Mono onConnectionOpen(long sessionId, Map headers)
* @param session websocket session (not null)
*/
default void onSessionOpen(GatewaySession session) {
- LOGGER.info("Session opened: {}", session);
+ LOGGER.log(Level.INFO, "Session opened: {0}", session);
}
/**
@@ -105,6 +110,6 @@ default void onSessionOpen(GatewaySession session) {
* @param session websocket session (not null)
*/
default void onSessionClose(GatewaySession session) {
- LOGGER.info("Session closed: {}", session);
+ LOGGER.log(Level.INFO, "Session closed: {0}", session);
}
}
diff --git a/services-gateway/src/main/java/io/scalecube/services/gateway/ReferenceCountUtil.java b/services-gateway/src/main/java/io/scalecube/services/gateway/ReferenceCountUtil.java
index 1c534365e..9e8884e1c 100644
--- a/services-gateway/src/main/java/io/scalecube/services/gateway/ReferenceCountUtil.java
+++ b/services-gateway/src/main/java/io/scalecube/services/gateway/ReferenceCountUtil.java
@@ -1,12 +1,12 @@
package io.scalecube.services.gateway;
import io.netty.util.ReferenceCounted;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.lang.System.Logger;
+import java.lang.System.Logger.Level;
public final class ReferenceCountUtil {
- private static final Logger LOGGER = LoggerFactory.getLogger(ReferenceCountUtil.class);
+ private static final Logger LOGGER = System.getLogger(ReferenceCountUtil.class.getName());
private ReferenceCountUtil() {
// Do not instantiate
@@ -24,7 +24,11 @@ public static boolean safestRelease(Object msg) {
&& ((ReferenceCounted) msg).refCnt() > 0
&& ((ReferenceCounted) msg).release();
} catch (Throwable t) {
- LOGGER.warn("Failed to release reference counted object: {}, cause: {}", msg, t.toString());
+ LOGGER.log(
+ Level.WARNING,
+ "Failed to release reference counted object: {0}, cause: {1}",
+ msg,
+ t.toString());
return false;
}
}
diff --git a/services-gateway/src/main/java/io/scalecube/services/gateway/client/http/HttpGatewayClientTransport.java b/services-gateway/src/main/java/io/scalecube/services/gateway/client/http/HttpGatewayClientTransport.java
index ae7655f35..eea2b4c69 100644
--- a/services-gateway/src/main/java/io/scalecube/services/gateway/client/http/HttpGatewayClientTransport.java
+++ b/services-gateway/src/main/java/io/scalecube/services/gateway/client/http/HttpGatewayClientTransport.java
@@ -13,6 +13,8 @@
import io.scalecube.services.transport.api.ClientChannel;
import io.scalecube.services.transport.api.ClientTransport;
import io.scalecube.services.transport.api.DataCodec;
+import java.lang.System.Logger;
+import java.lang.System.Logger.Level;
import java.lang.reflect.Type;
import java.time.Duration;
import java.util.Map;
@@ -20,8 +22,6 @@
import java.util.function.Function;
import java.util.function.UnaryOperator;
import org.reactivestreams.Publisher;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.netty.NettyOutbound;
@@ -33,7 +33,7 @@
public final class HttpGatewayClientTransport implements ClientChannel, ClientTransport {
- private static final Logger LOGGER = LoggerFactory.getLogger(HttpGatewayClientTransport.class);
+ private static final Logger LOGGER = System.getLogger(HttpGatewayClientTransport.class.getName());
private static final String CONTENT_TYPE = "application/json";
private static final HttpGatewayClientCodec CLIENT_CODEC =
@@ -93,7 +93,7 @@ public Mono requestResponse(ServiceMessage request, Type respons
private Mono send(
ServiceMessage request, HttpClientRequest clientRequest, NettyOutbound outbound) {
- LOGGER.debug("Sending request: {}", request);
+ LOGGER.log(Level.DEBUG, "Sending request: {0}", request);
// prepare request headers
request.headers().forEach(clientRequest::header);
// send with publisher (defer buffer cleanup to netty)
@@ -127,7 +127,7 @@ private static ServiceMessage toMessage(HttpClientResponse httpResponse, ByteBuf
.forEach(entry -> builder.header(entry.getKey(), entry.getValue()));
ServiceMessage message = builder.build();
- LOGGER.debug("Received response: {}", message);
+ LOGGER.log(Level.DEBUG, "Received response: {0}", message);
return message;
}
diff --git a/services-gateway/src/main/java/io/scalecube/services/gateway/client/websocket/WebsocketGatewayClientSession.java b/services-gateway/src/main/java/io/scalecube/services/gateway/client/websocket/WebsocketGatewayClientSession.java
index 24c637c35..3d67cde36 100644
--- a/services-gateway/src/main/java/io/scalecube/services/gateway/client/websocket/WebsocketGatewayClientSession.java
+++ b/services-gateway/src/main/java/io/scalecube/services/gateway/client/websocket/WebsocketGatewayClientSession.java
@@ -8,13 +8,13 @@
import io.scalecube.services.api.ServiceMessage;
import io.scalecube.services.gateway.ReferenceCountUtil;
import io.scalecube.services.gateway.client.GatewayClientCodec;
+import java.lang.System.Logger;
+import java.lang.System.Logger.Level;
import java.nio.channels.ClosedChannelException;
import java.time.Duration;
import java.util.Map;
import java.util.StringJoiner;
import org.jctools.maps.NonBlockingHashMapLong;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Sinks;
import reactor.core.publisher.Sinks.Many;
@@ -25,7 +25,8 @@
public final class WebsocketGatewayClientSession {
- private static final Logger LOGGER = LoggerFactory.getLogger(WebsocketGatewayClientSession.class);
+ private static final Logger LOGGER =
+ System.getLogger(WebsocketGatewayClientSession.class.getName());
private static final ClosedChannelException CLOSED_CHANNEL_EXCEPTION =
new ClosedChannelException();
@@ -61,13 +62,14 @@ public final class WebsocketGatewayClientSession {
try {
message = clientCodec.decode(byteBuf);
} catch (Exception ex) {
- LOGGER.error("Response decoder failed:", ex);
+ LOGGER.log(Level.ERROR, "Response decoder failed", ex);
return;
}
// ignore messages w/o sid
if (!message.headers().containsKey(STREAM_ID)) {
- LOGGER.error("Ignore response: {} with null sid, session={}", message, id);
+ LOGGER.log(
+ Level.ERROR, "Ignore response: {0} with null sid, session={1}", message, id);
if (message.data() != null) {
ReferenceCountUtil.safestRelease(message.data());
}
@@ -103,18 +105,18 @@ Many newUnicastProcessor(long sid) {
}
private One