From c034b9b90c3275c5ea1663bc83a0fc2adacc22cc Mon Sep 17 00:00:00 2001 From: quanticc Date: Mon, 6 Jul 2020 23:53:57 -0400 Subject: [PATCH] Update to latest dependencies --- build.gradle | 6 +++--- .../connect/common/DownstreamGatewayClient.java | 5 ++++- .../rabbitmq/shared/ExampleRabbitLocalCacheLeader.java | 10 ++++------ .../servers/ExampleRSocketGlobalRouterServer.java | 8 ++++---- examples/src/main/resources/logback.xml | 2 ++ 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index f89b272..4938a3a 100644 --- a/build.gradle +++ b/build.gradle @@ -23,10 +23,10 @@ ext { jdk_javadoc = "https://docs.oracle.com/en/java/javase/$jdk/docs/api/".toString() } - discord4j_core_version = '3.1.0-SNAPSHOT' - stores_redis_version = '3.1.1' + discord4j_core_version = '3.1.0.RC3' + stores_redis_version = '3.1.2' rsocket_version = '1.0.1' - rabbitmq_version = '1.4.2.RELEASE' + rabbitmq_version = '1.4.3.RELEASE' jsr305_version = '3.0.2' junit_version = '4.13' logback_version = '1.2.3' diff --git a/common/src/main/java/discord4j/connect/common/DownstreamGatewayClient.java b/common/src/main/java/discord4j/connect/common/DownstreamGatewayClient.java index 6296d5a..dba3dd5 100644 --- a/common/src/main/java/discord4j/connect/common/DownstreamGatewayClient.java +++ b/common/src/main/java/discord4j/connect/common/DownstreamGatewayClient.java @@ -17,6 +17,8 @@ package discord4j.connect.common; +import discord4j.common.close.CloseStatus; +import discord4j.common.close.DisconnectBehavior; import discord4j.discordjson.json.gateway.Dispatch; import discord4j.discordjson.json.gateway.Opcode; import discord4j.gateway.GatewayClient; @@ -222,7 +224,8 @@ public Duration getResponseTime() { @Override public Mono close(boolean allowResume) { return Mono.fromRunnable(() -> { - dispatchSink.next(GatewayStateChange.disconnected()); + dispatchSink.next(GatewayStateChange.disconnected(DisconnectBehavior.stop(null), + allowResume ? CloseStatus.ABNORMAL_CLOSE : CloseStatus.NORMAL_CLOSE)); senderSink.complete(); closeFuture.onComplete(); }); diff --git a/examples/src/main/java/discord4j/connect/rabbitmq/shared/ExampleRabbitLocalCacheLeader.java b/examples/src/main/java/discord4j/connect/rabbitmq/shared/ExampleRabbitLocalCacheLeader.java index aacaba0..359846a 100644 --- a/examples/src/main/java/discord4j/connect/rabbitmq/shared/ExampleRabbitLocalCacheLeader.java +++ b/examples/src/main/java/discord4j/connect/rabbitmq/shared/ExampleRabbitLocalCacheLeader.java @@ -37,8 +37,6 @@ import discord4j.core.object.presence.Presence; import discord4j.core.shard.InvalidationStrategy; import discord4j.core.shard.ShardingStrategy; -import discord4j.gateway.intent.Intent; -import discord4j.gateway.intent.IntentSet; import discord4j.store.api.noop.NoOpStoreService; import reactor.core.publisher.Mono; import reactor.rabbitmq.QueueSpecification; @@ -112,10 +110,10 @@ public static void main(String[] args) { .setSharding(shardingStrategy) // Properly coordinate IDENTIFY attempts across all shards .setShardCoordinator(RSocketShardCoordinator.createWithServerAddress(coordinatorServerAddress)) - .setDisabledIntents(IntentSet.of( - Intent.GUILD_PRESENCES, - Intent.GUILD_MESSAGE_TYPING, - Intent.DIRECT_MESSAGE_TYPING)) +// .setDisabledIntents(IntentSet.of( +// Intent.GUILD_PRESENCES, +// Intent.GUILD_MESSAGE_TYPING, +// Intent.DIRECT_MESSAGE_TYPING)) .setInitialStatus(s -> Presence.invisible()) // Disable invalidation strategy, event publishing and entity cache to save memory usage .setDispatchEventMapper(DispatchEventMapper.discardEvents()) diff --git a/examples/src/main/java/discord4j/connect/rsocket/shared/servers/ExampleRSocketGlobalRouterServer.java b/examples/src/main/java/discord4j/connect/rsocket/shared/servers/ExampleRSocketGlobalRouterServer.java index f0c3fe8..dcd26bf 100644 --- a/examples/src/main/java/discord4j/connect/rsocket/shared/servers/ExampleRSocketGlobalRouterServer.java +++ b/examples/src/main/java/discord4j/connect/rsocket/shared/servers/ExampleRSocketGlobalRouterServer.java @@ -17,14 +17,14 @@ package discord4j.connect.rsocket.shared.servers; -import discord4j.connect.rsocket.global.RSocketGlobalRouterServer; import discord4j.connect.Constants; +import discord4j.connect.rsocket.global.RSocketGlobalRouterServer; import discord4j.rest.request.BucketGlobalRateLimiter; import discord4j.rest.request.RequestQueueFactory; import io.rsocket.transport.netty.server.CloseableChannel; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import reactor.core.scheduler.Schedulers; +import reactor.util.Logger; +import reactor.util.Loggers; import java.net.InetSocketAddress; import java.time.Duration; @@ -35,7 +35,7 @@ */ public class ExampleRSocketGlobalRouterServer { - private static final Logger log = LoggerFactory.getLogger(ExampleRSocketGlobalRouterServer.class); + private static final Logger log = Loggers.getLogger(ExampleRSocketGlobalRouterServer.class); public static void main(String[] args) { // this server combines a Router and a GlobalRateLimiter servers diff --git a/examples/src/main/resources/logback.xml b/examples/src/main/resources/logback.xml index 5347e96..8b436d1 100644 --- a/examples/src/main/resources/logback.xml +++ b/examples/src/main/resources/logback.xml @@ -5,6 +5,8 @@ + +