From 24d9adf13f7e3383048444d32f754f4fb9c725d5 Mon Sep 17 00:00:00 2001 From: Roman Shterenzon Date: Sat, 29 Apr 2023 14:38:50 +0300 Subject: [PATCH] Upgrade to RxJava 3 --- pom.xml | 6 +- .../bankera/BankeraStreamingExchange.java | 4 +- .../BankeraStreamingMarketDataService.java | 2 +- .../BinanceStreamingAccountService.java | 8 +- .../binance/BinanceStreamingExchange.java | 4 +- .../BinanceStreamingMarketDataService.java | 16 +-- .../binance/BinanceStreamingTradeService.java | 8 +- .../binance/BinanceUserDataChannel.java | 4 +- .../BinanceUserDataStreamingService.java | 3 +- .../BinanceFuturesPublicStreamsTest.java | 2 +- .../BinanceLiveFutureSubscriptionExample.java | 2 +- .../BinanceLiveSubscriptionExample.java | 2 +- .../binance/BinanceManualExample.java | 2 +- .../binance/BinancePublicStreamsTest.java | 2 +- .../BitfinexStreamingAccountService.java | 2 +- .../bitfinex/BitfinexStreamingAdapters.java | 2 +- .../bitfinex/BitfinexStreamingExchange.java | 4 +- .../BitfinexStreamingMarketDataService.java | 2 +- .../bitfinex/BitfinexStreamingService.java | 8 +- .../BitfinexStreamingTradeService.java | 2 +- .../bitfinex/BitfinexManualExample.java | 4 +- .../BitfinexStreamingServiceTest.java | 2 +- .../bitflyer/BitflyerStreamingExchange.java | 2 +- .../BitflyerStreamingMarketDataService.java | 2 +- .../bitmex/BitmexStreamingExchange.java | 4 +- .../BitmexStreamingMarketDataService.java | 2 +- .../bitmex/BitmexStreamingService.java | 12 +- .../bitmex/BitmexStreamingTradeService.java | 2 +- .../xchangestream/bitmex/BitmexOrderIT.java | 4 +- .../xchangestream/bitmex/BitmexTest.java | 14 +- .../v2/BitstampStreamingExchange.java | 4 +- .../BitstampStreamingMarketDataService.java | 2 +- .../bitstamp/BitstampManualExample.java | 2 +- ...ampStreamingMarketDataServiceBaseTest.java | 2 +- ...stampStreamingMarketDataServiceV2Test.java | 4 +- .../BTCMarketsStreamingExchange.java | 4 +- .../BTCMarketsStreamingMarketDataService.java | 2 +- .../btcmarkets/BTCMarketsManualExample.java | 2 +- .../cexio/CexioStreamingExchange.java | 2 +- .../CexioStreamingMarketDataService.java | 4 +- .../cexio/CexioStreamingRawService.java | 10 +- .../cexio/CexioStreamingServiceTest.java | 2 +- .../CoinbaseProStreamingExchange.java | 4 +- ...CoinbaseProStreamingMarketDataService.java | 2 +- .../CoinbaseProStreamingService.java | 2 +- .../CoinbaseProStreamingTradeService.java | 2 +- .../coincheck/CoincheckStreamingExchange.java | 4 +- .../CoincheckStreamingMarketDataService.java | 6 +- .../coincheck/CoincheckManualExample.java | 2 +- .../CoincheckStreamingIntegration.java | 2 +- .../coinjar/CoinjarStreamingExchange.java | 4 +- .../CoinjarStreamingMarketDataService.java | 2 +- .../coinjar/CoinjarStreamingService.java | 2 +- .../coinjar/CoinjarStreamingTradeService.java | 2 +- .../coinjar/CoinjarOrderChangesExample.java | 6 +- ...StreamingMarketDataServiceIntegration.java | 2 +- .../coinjar/CoinjarUserTradesExample.java | 6 +- .../v2/CoinmateStreamingAccountService.java | 2 +- .../v2/CoinmateStreamingExchange.java | 2 +- .../CoinmateStreamingMarketDataService.java | 2 +- .../v2/CoinmateStreamingTradeService.java | 2 +- ...oinmateStreamingMarketDataServiceTest.java | 4 +- .../core/StreamingAccountService.java | 2 +- .../xchangestream/core/StreamingExchange.java | 4 +- .../core/StreamingMarketDataService.java | 2 +- .../core/StreamingTradeService.java | 2 +- .../dydx/dydxStreamingExchange.java | 2 +- .../dydx/dydxStreamingService.java | 2 +- .../v1/dydxStreamingMarketDataService.java | 2 +- .../v3/dydxStreamingMarketDataService.java | 2 +- .../ftx/FtxStreamingExchange.java | 4 +- .../ftx/FtxStreamingMarketDataService.java | 2 +- .../ftx/FtxStreamingTradeService.java | 2 +- ...StreamingMarketDataServiceIntegration.java | 2 +- .../main/java/GateioStreamingExchange.java | 2 +- .../GateioStreamingMarketDataService.java | 2 +- .../src/main/java/GateioStreamingService.java | 2 +- .../src/test/java/GateioManualExample.java | 2 +- .../gemini/GeminiStreamingExchange.java | 4 +- .../GeminiStreamingMarketDataService.java | 2 +- .../gemini/GeminiStreamingService.java | 2 +- .../gemini/GeminiManualExample.java | 2 +- .../gemini/GeminiStreamingExchange.java | 6 +- .../GeminiStreamingMarketDataService.java | 4 +- .../gemini/GeminiStreamingService.java | 6 +- .../hitbtc/HitbtcStreamingExchange.java | 4 +- .../HitbtcStreamingMarketDataService.java | 2 +- .../hitbtc/HitbtcManualExample.java | 2 +- .../HitbtcStreamingMarketDataServiceTest.java | 4 +- .../huobi/HuobiStreamingExchange.java | 4 +- .../HuobiStreamingMarketDataService.java | 2 +- .../kraken/KrakenStreamingExchange.java | 4 +- .../KrakenStreamingMarketDataService.java | 2 +- .../kraken/KrakenStreamingService.java | 6 +- .../kraken/KrakenStreamingTradeService.java | 2 +- .../kraken/KrakenOrderbookExample.java | 2 +- .../kraken/KrakenTickerExample.java | 2 +- .../kraken/KrakenTradesExample.java | 2 +- .../KrakenFuturesStreamingExchange.java | 4 +- ...akenFuturesStreamingMarketDataService.java | 2 +- .../KrakenFuturesStreamingService.java | 2 +- .../KrakenFuturesStreamingTradeService.java | 2 +- ...uturesStreamingPrivateDataIntegration.java | 2 +- ...KrakenFuturesStreamingPrivateDataTest.java | 136 ++++++++++++++++++ ...FuturesStreamingPublicDataIntegration.java | 4 +- .../KrakenFuturesStreamingPublicDataTest.java | 82 +++++++++++ xchange-stream-kucoin/pom.xml | 2 +- .../kucoin/KucoinStreamingExchange.java | 7 +- .../KucoinStreamingMarketDataService.java | 4 +- .../kucoin/KucoinStreamingService.java | 9 +- .../kucoin/KucoinStreamingTradeService.java | 2 +- .../lgo/LgoLevel2BatchSubscription.java | 2 +- .../lgo/LgoStreamingAccountService.java | 2 +- .../lgo/LgoStreamingExchange.java | 4 +- .../lgo/LgoStreamingMarketDataService.java | 2 +- .../lgo/LgoStreamingTradeService.java | 2 +- .../lgo/LgoTradeBatchSubscription.java | 2 +- .../lgo/LgoUserBatchSubscription.java | 2 +- .../lgo/LgoStreamingAccountServiceTest.java | 6 +- .../LgoStreamingMarketDataServiceTest.java | 2 +- .../lgo/LgoStreamingTradeServiceTest.java | 2 +- .../okcoin/OkCoinStreamingExchange.java | 4 +- .../OkCoinStreamingMarketDataService.java | 2 +- .../okcoin/OkCoinStreamingService.java | 8 +- .../OkCoinStreamingMarketDataServiceTest.java | 4 +- .../okex/OkexStreamingExchange.java | 2 +- .../okex/OkexStreamingMarketDataService.java | 4 +- .../okex/OkexStreamingService.java | 8 +- .../okex/OkexStreamingTradeService.java | 2 +- .../OkexStreamingPrivateDataIntegtration.java | 2 +- .../OkexStreamingPublicDataIntegration.java | 5 +- .../poloniex2/PoloniexStreamingExchange.java | 4 +- .../PoloniexStreamingMarketDataService.java | 2 +- .../poloniex2/PoloniexStreamingService.java | 2 +- .../serum/SerumStreamingExchange.java | 4 +- xchange-stream-service-core/pom.xml | 4 +- .../service/ConnectableService.java | 2 +- .../service/netty/ConnectionStateModel.java | 6 +- .../service/netty/NettyStreamingService.java | 10 +- xchange-stream-service-pubnub/pom.xml | 4 +- .../pubnub/PubnubStreamingService.java | 6 +- 141 files changed, 461 insertions(+), 241 deletions(-) create mode 100644 xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPrivateDataTest.java create mode 100644 xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataTest.java diff --git a/pom.xml b/pom.xml index 0250003299b..f425801594e 100644 --- a/pom.xml +++ b/pom.xml @@ -343,9 +343,9 @@ - io.reactivex.rxjava2 + io.reactivex.rxjava3 rxjava - 2.2.21 + 3.1.8 com.pubnub @@ -583,4 +583,4 @@ - \ No newline at end of file + diff --git a/xchange-stream-bankera/src/main/java/info/bitrich/xchangestream/bankera/BankeraStreamingExchange.java b/xchange-stream-bankera/src/main/java/info/bitrich/xchangestream/bankera/BankeraStreamingExchange.java index 3dfa3052408..9dad6cb083c 100644 --- a/xchange-stream-bankera/src/main/java/info/bitrich/xchangestream/bankera/BankeraStreamingExchange.java +++ b/xchange-stream-bankera/src/main/java/info/bitrich/xchangestream/bankera/BankeraStreamingExchange.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.bankera.BankeraExchange; import org.knowm.xchange.bankera.service.BankeraMarketDataService; diff --git a/xchange-stream-bankera/src/main/java/info/bitrich/xchangestream/bankera/BankeraStreamingMarketDataService.java b/xchange-stream-bankera/src/main/java/info/bitrich/xchangestream/bankera/BankeraStreamingMarketDataService.java index 77c88da4eda..7a977bbee4d 100644 --- a/xchange-stream-bankera/src/main/java/info/bitrich/xchangestream/bankera/BankeraStreamingMarketDataService.java +++ b/xchange-stream-bankera/src/main/java/info/bitrich/xchangestream/bankera/BankeraStreamingMarketDataService.java @@ -1,7 +1,7 @@ package info.bitrich.xchangestream.bankera; import info.bitrich.xchangestream.core.StreamingMarketDataService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; diff --git a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingAccountService.java b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingAccountService.java index ca30c1773b4..9548c012d5b 100644 --- a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingAccountService.java +++ b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingAccountService.java @@ -6,10 +6,10 @@ import info.bitrich.xchangestream.binance.dto.OutboundAccountPositionBinanceWebsocketTransaction; import info.bitrich.xchangestream.core.StreamingAccountService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; -import io.reactivex.disposables.Disposable; -import io.reactivex.subjects.BehaviorSubject; -import io.reactivex.subjects.Subject; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.subjects.BehaviorSubject; +import io.reactivex.rxjava3.subjects.Subject; import org.knowm.xchange.currency.Currency; import org.knowm.xchange.dto.account.Balance; import org.knowm.xchange.exceptions.ExchangeException; diff --git a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingExchange.java b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingExchange.java index 05b22cd6218..560cabf3668 100644 --- a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingExchange.java +++ b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingExchange.java @@ -8,8 +8,8 @@ import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; import info.bitrich.xchangestream.service.netty.WebSocketClientHandler; import info.bitrich.xchangestream.util.Events; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingMarketDataService.java b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingMarketDataService.java index ac3d1c8a759..ff896dce7d6 100644 --- a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingMarketDataService.java +++ b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingMarketDataService.java @@ -14,14 +14,14 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; -import io.reactivex.Scheduler; -import io.reactivex.Single; -import io.reactivex.disposables.CompositeDisposable; -import io.reactivex.disposables.Disposable; -import io.reactivex.functions.Consumer; -import io.reactivex.schedulers.Schedulers; -import io.reactivex.subjects.BehaviorSubject; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.Scheduler; +import io.reactivex.rxjava3.core.Single; +import io.reactivex.rxjava3.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.functions.Consumer; +import io.reactivex.rxjava3.schedulers.Schedulers; +import io.reactivex.rxjava3.subjects.BehaviorSubject; import java.io.IOException; import java.util.*; import java.util.concurrent.ConcurrentHashMap; diff --git a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingTradeService.java b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingTradeService.java index e21f8eb6418..e393ee26f27 100644 --- a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingTradeService.java +++ b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceStreamingTradeService.java @@ -7,10 +7,10 @@ import info.bitrich.xchangestream.binance.dto.ExecutionReportBinanceUserTransaction.ExecutionType; import info.bitrich.xchangestream.core.StreamingTradeService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; -import io.reactivex.disposables.Disposable; -import io.reactivex.subjects.PublishSubject; -import io.reactivex.subjects.Subject; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.subjects.PublishSubject; +import io.reactivex.rxjava3.subjects.Subject; import java.io.IOException; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.derivative.FuturesContract; diff --git a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceUserDataChannel.java b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceUserDataChannel.java index 7d586661305..6ce72efe186 100644 --- a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceUserDataChannel.java +++ b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceUserDataChannel.java @@ -2,8 +2,8 @@ import static java.util.concurrent.TimeUnit.SECONDS; -import io.reactivex.Observable; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.disposables.Disposable; import java.io.IOException; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; diff --git a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceUserDataStreamingService.java b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceUserDataStreamingService.java index 38bcae2de42..27545efff80 100644 --- a/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceUserDataStreamingService.java +++ b/xchange-stream-binance/src/main/java/info/bitrich/xchangestream/binance/BinanceUserDataStreamingService.java @@ -5,7 +5,8 @@ import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; import info.bitrich.xchangestream.service.netty.WebSocketClientCompressionAllowClientNoContextAndServerNoContextHandler; import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; +import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceFuturesPublicStreamsTest.java b/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceFuturesPublicStreamsTest.java index 89518cf41a2..859627601b6 100644 --- a/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceFuturesPublicStreamsTest.java +++ b/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceFuturesPublicStreamsTest.java @@ -6,7 +6,7 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.util.concurrent.TimeUnit; import org.junit.Before; import org.junit.Ignore; diff --git a/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceLiveFutureSubscriptionExample.java b/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceLiveFutureSubscriptionExample.java index fa189f1635d..a212141a2e3 100644 --- a/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceLiveFutureSubscriptionExample.java +++ b/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceLiveFutureSubscriptionExample.java @@ -3,7 +3,7 @@ import info.bitrich.xchangestream.binancefuture.BinanceFutureStreamingExchange; import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceLiveSubscriptionExample.java b/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceLiveSubscriptionExample.java index b302e32de64..d72be15a841 100644 --- a/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceLiveSubscriptionExample.java +++ b/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceLiveSubscriptionExample.java @@ -2,7 +2,7 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceManualExample.java b/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceManualExample.java index 79b590b2475..42aef748369 100644 --- a/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceManualExample.java +++ b/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinanceManualExample.java @@ -3,7 +3,7 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.currency.CurrencyPair; import org.slf4j.Logger; diff --git a/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinancePublicStreamsTest.java b/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinancePublicStreamsTest.java index f64223416c4..3dc12e469f7 100644 --- a/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinancePublicStreamsTest.java +++ b/xchange-stream-binance/src/test/java/info/bitrich/xchangestream/binance/BinancePublicStreamsTest.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.util.concurrent.TimeUnit; import org.junit.Before; import org.junit.Ignore; diff --git a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAccountService.java b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAccountService.java index ffb808eb6e9..8ebbc9c2a0f 100644 --- a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAccountService.java +++ b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAccountService.java @@ -2,7 +2,7 @@ import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebSocketAuthBalance; import info.bitrich.xchangestream.core.StreamingAccountService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.currency.Currency; import org.knowm.xchange.dto.account.Balance; import org.knowm.xchange.exceptions.ExchangeException; diff --git a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAdapters.java b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAdapters.java index 3089c1806b9..d0f036837c1 100644 --- a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAdapters.java +++ b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingAdapters.java @@ -9,7 +9,7 @@ import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebSocketAuthOrder; import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebSocketAuthPreTrade; import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebSocketAuthTrade; -import io.reactivex.annotations.Nullable; +import io.reactivex.rxjava3.annotations.Nullable; import java.math.BigDecimal; import java.util.stream.Stream; import org.knowm.xchange.bitfinex.service.BitfinexAdapters; diff --git a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingExchange.java b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingExchange.java index fe383894a65..05295117e33 100644 --- a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingExchange.java +++ b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingExchange.java @@ -3,8 +3,8 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.apache.commons.lang3.StringUtils; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.bitfinex.BitfinexExchange; diff --git a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingMarketDataService.java b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingMarketDataService.java index b9f9104195f..891cab24a45 100644 --- a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingMarketDataService.java +++ b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingMarketDataService.java @@ -15,7 +15,7 @@ import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebsocketUpdateTrade; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.HashMap; import java.util.Map; import org.knowm.xchange.currency.Currency; diff --git a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java index 6161b50e115..ca51bf07942 100644 --- a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java +++ b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java @@ -11,10 +11,10 @@ import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebSocketUnSubscriptionMessage; import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; -import io.reactivex.Completable; -import io.reactivex.Observable; -import io.reactivex.disposables.Disposable; -import io.reactivex.subjects.PublishSubject; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.subjects.PublishSubject; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.time.Duration; diff --git a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingTradeService.java b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingTradeService.java index 4ed77a566ce..b17a0b89517 100644 --- a/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingTradeService.java +++ b/xchange-stream-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingTradeService.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebSocketAuthPreTrade; import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebSocketAuthTrade; import info.bitrich.xchangestream.core.StreamingTradeService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.function.Function; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.Order; diff --git a/xchange-stream-bitfinex/src/test/java/info/bitrich/xchangestream/bitfinex/BitfinexManualExample.java b/xchange-stream-bitfinex/src/test/java/info/bitrich/xchangestream/bitfinex/BitfinexManualExample.java index b767fc40b04..a7d4ef7c8dd 100644 --- a/xchange-stream-bitfinex/src/test/java/info/bitrich/xchangestream/bitfinex/BitfinexManualExample.java +++ b/xchange-stream-bitfinex/src/test/java/info/bitrich/xchangestream/bitfinex/BitfinexManualExample.java @@ -5,8 +5,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; import info.bitrich.xchangestream.service.ConnectableService; -import io.reactivex.Observable; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.disposables.Disposable; import org.apache.commons.lang3.concurrent.TimedSemaphore; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.currency.CurrencyPair; diff --git a/xchange-stream-bitfinex/src/test/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingServiceTest.java b/xchange-stream-bitfinex/src/test/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingServiceTest.java index 9be00430d6e..b2a671864ed 100644 --- a/xchange-stream-bitfinex/src/test/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingServiceTest.java +++ b/xchange-stream-bitfinex/src/test/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingServiceTest.java @@ -8,7 +8,7 @@ import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebSocketAuthOrder; import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebSocketAuthPreTrade; import info.bitrich.xchangestream.bitfinex.dto.BitfinexWebSocketAuthTrade; -import io.reactivex.observers.TestObserver; +import io.reactivex.rxjava3.observers.TestObserver; import java.io.IOException; import java.math.BigDecimal; import org.junit.Before; diff --git a/xchange-stream-bitflyer/src/main/java/info/bitrich/xchangestream/bitflyer/BitflyerStreamingExchange.java b/xchange-stream-bitflyer/src/main/java/info/bitrich/xchangestream/bitflyer/BitflyerStreamingExchange.java index b906543dc99..49d8582710e 100644 --- a/xchange-stream-bitflyer/src/main/java/info/bitrich/xchangestream/bitflyer/BitflyerStreamingExchange.java +++ b/xchange-stream-bitflyer/src/main/java/info/bitrich/xchangestream/bitflyer/BitflyerStreamingExchange.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.pubnub.PubnubStreamingService; -import io.reactivex.Completable; +import io.reactivex.rxjava3.core.Completable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.bitflyer.BitflyerExchange; diff --git a/xchange-stream-bitflyer/src/main/java/info/bitrich/xchangestream/bitflyer/BitflyerStreamingMarketDataService.java b/xchange-stream-bitflyer/src/main/java/info/bitrich/xchangestream/bitflyer/BitflyerStreamingMarketDataService.java index 4871df16369..dfcaa6abae0 100644 --- a/xchange-stream-bitflyer/src/main/java/info/bitrich/xchangestream/bitflyer/BitflyerStreamingMarketDataService.java +++ b/xchange-stream-bitflyer/src/main/java/info/bitrich/xchangestream/bitflyer/BitflyerStreamingMarketDataService.java @@ -11,7 +11,7 @@ import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; import info.bitrich.xchangestream.service.pubnub.PubnubStreamingService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.HashMap; import java.util.Map; import org.knowm.xchange.currency.CurrencyPair; diff --git a/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java b/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java index 46ed9a840b8..d9f895377df 100644 --- a/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java +++ b/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.bitmex.BitmexExchange; diff --git a/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingMarketDataService.java b/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingMarketDataService.java index c4685995d41..375d396c86f 100644 --- a/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingMarketDataService.java +++ b/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingMarketDataService.java @@ -15,7 +15,7 @@ import info.bitrich.xchangestream.bitmex.dto.RawOrderBook; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; diff --git a/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java b/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java index 96fde48e9f6..7cd0dd24504 100644 --- a/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java +++ b/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java @@ -11,12 +11,12 @@ import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; import io.netty.handler.codec.http.DefaultHttpHeaders; import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; -import io.reactivex.Completable; -import io.reactivex.CompletableSource; -import io.reactivex.Observable; -import io.reactivex.ObservableEmitter; -import io.reactivex.disposables.Disposable; -import io.reactivex.schedulers.Schedulers; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.CompletableSource; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableEmitter; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.schedulers.Schedulers; import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; diff --git a/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingTradeService.java b/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingTradeService.java index f601127b649..71afe7452aa 100644 --- a/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingTradeService.java +++ b/xchange-stream-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingTradeService.java @@ -1,7 +1,7 @@ package info.bitrich.xchangestream.bitmex; import info.bitrich.xchangestream.bitmex.dto.BitmexOrder; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.Arrays; import java.util.stream.Collectors; import org.knowm.xchange.currency.CurrencyPair; diff --git a/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexOrderIT.java b/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexOrderIT.java index 2c1e29b232d..65d9a9935d9 100644 --- a/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexOrderIT.java +++ b/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexOrderIT.java @@ -6,7 +6,7 @@ import info.bitrich.xchangestream.core.StreamingExchangeFactory; import info.bitrich.xchangestream.util.LocalExchangeConfig; import info.bitrich.xchangestream.util.PropsLoader; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.math.BigDecimal; import java.util.Date; @@ -223,7 +223,7 @@ public void shouldGetExecutionOnFill() { executionObservable .test() .awaitCount(5) - .assertNever(execution -> Objects.equals(execution.getClOrdID(), clOrdId)) + .assertValue(execution -> !Objects.equals(execution.getClOrdID(), clOrdId)) .dispose(); scheduler.shutdown(); diff --git a/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexTest.java b/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexTest.java index ec1b7ad0118..f181a84a340 100644 --- a/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexTest.java +++ b/xchange-stream-bitmex/src/test/java/info/bitrich/xchangestream/bitmex/BitmexTest.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; import info.bitrich.xchangestream.util.BookSanityChecker; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.Before; @@ -51,10 +51,8 @@ private void awaitCompletable(Completable completable) { private void awaitDataCount(Observable observable) { observable .test() - .assertSubscribed() .assertNoErrors() .awaitCount(BitmexTest.MIN_DATA_COUNT) - .assertNoTimeout() .dispose(); } @@ -87,16 +85,14 @@ public void shouldHaveNoBookErrors() { streamingMarketDataService .getOrderBook(xbtUsd) .test() - .assertSubscribed() - .assertNoErrors() + .assertComplete() .awaitCount(10) - .assertNever( + .assertValue( book -> { String err = BookSanityChecker.hasErrors(book); LOG.info("err {}", err); - return err != null; + return err == null; }) - .assertNoTimeout() .dispose(); } } diff --git a/xchange-stream-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingExchange.java b/xchange-stream-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingExchange.java index 12a251e9a86..f1dacc87082 100644 --- a/xchange-stream-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingExchange.java +++ b/xchange-stream-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingExchange.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.bitstamp.BitstampExchange; diff --git a/xchange-stream-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingMarketDataService.java b/xchange-stream-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingMarketDataService.java index cc3a07695ac..dffc50f0243 100644 --- a/xchange-stream-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingMarketDataService.java +++ b/xchange-stream-bitstamp/src/main/java/info/bitrich/xchangestream/bitstamp/v2/BitstampStreamingMarketDataService.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.bitstamp.dto.BitstampWebSocketTransaction; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.bitstamp.BitstampAdapters; import org.knowm.xchange.bitstamp.dto.marketdata.BitstampOrderBook; import org.knowm.xchange.currency.CurrencyPair; diff --git a/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampManualExample.java b/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampManualExample.java index 683785b69c8..66541db1490 100644 --- a/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampManualExample.java +++ b/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampManualExample.java @@ -7,7 +7,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; import info.bitrich.xchangestream.service.ConnectableService; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import org.apache.commons.lang3.concurrent.TimedSemaphore; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.currency.CurrencyPair; diff --git a/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampStreamingMarketDataServiceBaseTest.java b/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampStreamingMarketDataServiceBaseTest.java index 56606d5d9f2..592788bf0cb 100644 --- a/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampStreamingMarketDataServiceBaseTest.java +++ b/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampStreamingMarketDataServiceBaseTest.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.observers.TestObserver; +import io.reactivex.rxjava3.observers.TestObserver; import java.util.List; import org.junit.Assert; import org.knowm.xchange.dto.marketdata.OrderBook; diff --git a/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampStreamingMarketDataServiceV2Test.java b/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampStreamingMarketDataServiceV2Test.java index 7317c5841df..3aa8899b756 100644 --- a/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampStreamingMarketDataServiceV2Test.java +++ b/xchange-stream-bitstamp/src/test/java/info/bitrich/xchangestream/bitstamp/BitstampStreamingMarketDataServiceV2Test.java @@ -6,8 +6,8 @@ import com.fasterxml.jackson.databind.JsonNode; import info.bitrich.xchangestream.bitstamp.v2.BitstampStreamingMarketDataService; import info.bitrich.xchangestream.bitstamp.v2.BitstampStreamingService; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.observers.TestObserver; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; diff --git a/xchange-stream-btcmarkets/src/main/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsStreamingExchange.java b/xchange-stream-btcmarkets/src/main/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsStreamingExchange.java index b243199b324..152f383ff89 100644 --- a/xchange-stream-btcmarkets/src/main/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsStreamingExchange.java +++ b/xchange-stream-btcmarkets/src/main/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsStreamingExchange.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.btcmarkets.BTCMarketsExchange; diff --git a/xchange-stream-btcmarkets/src/main/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsStreamingMarketDataService.java b/xchange-stream-btcmarkets/src/main/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsStreamingMarketDataService.java index 96395447fe6..2bb76e1ed62 100644 --- a/xchange-stream-btcmarkets/src/main/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsStreamingMarketDataService.java +++ b/xchange-stream-btcmarkets/src/main/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsStreamingMarketDataService.java @@ -11,7 +11,7 @@ import info.bitrich.xchangestream.btcmarkets.dto.BTCMarketsWebSocketTradeMessage; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.marketdata.OrderBook; import org.knowm.xchange.dto.marketdata.Ticker; diff --git a/xchange-stream-btcmarkets/src/test/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsManualExample.java b/xchange-stream-btcmarkets/src/test/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsManualExample.java index 526af0b42e8..174c8fe0d24 100644 --- a/xchange-stream-btcmarkets/src/test/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsManualExample.java +++ b/xchange-stream-btcmarkets/src/test/java/info/bitrich/xchangestream/btcmarkets/BTCMarketsManualExample.java @@ -2,7 +2,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.currency.CurrencyPair; import org.slf4j.Logger; diff --git a/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingExchange.java b/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingExchange.java index 34986919e5b..bbdf59ec78a 100644 --- a/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingExchange.java +++ b/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingExchange.java @@ -3,7 +3,7 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; -import io.reactivex.Completable; +import io.reactivex.rxjava3.core.Completable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.cexio.CexIOExchange; import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException; diff --git a/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingMarketDataService.java b/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingMarketDataService.java index e24d2ccc524..d0799a49bdf 100644 --- a/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingMarketDataService.java +++ b/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingMarketDataService.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.cexio.dto.CexioWebSocketOrderBookSubscribeResponse; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.math.BigInteger; import java.util.ArrayList; import java.util.Date; @@ -25,7 +25,7 @@ public CexioStreamingMarketDataService(CexioStreamingRawService streamingOrderDa } static class OrderBookUpdateConsumer - implements io.reactivex.functions.Function< + implements io.reactivex.rxjava3.functions.Function< CexioWebSocketOrderBookSubscribeResponse, OrderBook> { BigInteger prevID = null; OrderBook orderBookSoFar = diff --git a/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingRawService.java b/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingRawService.java index 2d1a40eb701..d7640b20706 100644 --- a/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingRawService.java +++ b/xchange-stream-cexio/src/main/java/info/bitrich/xchangestream/cexio/CexioStreamingRawService.java @@ -15,11 +15,11 @@ import info.bitrich.xchangestream.cexio.dto.CexioWebSocketTransactionMessage; import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Completable; -import io.reactivex.CompletableEmitter; -import io.reactivex.CompletableOnSubscribe; -import io.reactivex.Observable; -import io.reactivex.subjects.PublishSubject; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.CompletableEmitter; +import io.reactivex.rxjava3.core.CompletableOnSubscribe; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.subjects.PublishSubject; import java.io.IOException; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.Order; diff --git a/xchange-stream-cexio/src/test/java/info/bitrich/xchangestream/cexio/CexioStreamingServiceTest.java b/xchange-stream-cexio/src/test/java/info/bitrich/xchangestream/cexio/CexioStreamingServiceTest.java index 1dabde0c963..bc34a5a27f8 100644 --- a/xchange-stream-cexio/src/test/java/info/bitrich/xchangestream/cexio/CexioStreamingServiceTest.java +++ b/xchange-stream-cexio/src/test/java/info/bitrich/xchangestream/cexio/CexioStreamingServiceTest.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import info.bitrich.xchangestream.cexio.dto.CexioWebSocketTransaction; -import io.reactivex.observers.TestObserver; +import io.reactivex.rxjava3.observers.TestObserver; import java.io.IOException; import java.math.BigDecimal; import java.time.Instant; diff --git a/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java b/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java index ecda42c04d6..7f0198d872b 100644 --- a/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java +++ b/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java @@ -6,8 +6,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; import info.bitrich.xchangestream.service.netty.WebSocketClientHandler; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import java.util.*; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.coinbasepro.CoinbaseProExchange; diff --git a/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingMarketDataService.java b/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingMarketDataService.java index 161860d633e..381a81f4851 100644 --- a/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingMarketDataService.java +++ b/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingMarketDataService.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.coinbasepro.dto.CoinbaseProWebSocketTransaction; import info.bitrich.xchangestream.core.StreamingMarketDataService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.math.BigDecimal; import java.util.List; import java.util.Map; diff --git a/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingService.java b/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingService.java index 03f65944390..013222f06e7 100644 --- a/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingService.java +++ b/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingService.java @@ -13,7 +13,7 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.time.Duration; import java.util.Arrays; diff --git a/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingTradeService.java b/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingTradeService.java index 1c939e1dc02..b5f6f024aa7 100644 --- a/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingTradeService.java +++ b/xchange-stream-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingTradeService.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.coinbasepro.dto.CoinbaseProWebSocketTransaction; import info.bitrich.xchangestream.core.StreamingTradeService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.Collections; import java.util.List; import org.knowm.xchange.coinbasepro.dto.trade.CoinbaseProFill; diff --git a/xchange-stream-coincheck/src/main/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingExchange.java b/xchange-stream-coincheck/src/main/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingExchange.java index e56a3261c3b..d70fdadbd1e 100644 --- a/xchange-stream-coincheck/src/main/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingExchange.java +++ b/xchange-stream-coincheck/src/main/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingExchange.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; import info.bitrich.xchangestream.util.Events; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import lombok.extern.slf4j.Slf4j; import org.knowm.xchange.coincheck.CoincheckExchange; diff --git a/xchange-stream-coincheck/src/main/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingMarketDataService.java b/xchange-stream-coincheck/src/main/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingMarketDataService.java index e17bbeea5ca..ade7a314387 100644 --- a/xchange-stream-coincheck/src/main/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingMarketDataService.java +++ b/xchange-stream-coincheck/src/main/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingMarketDataService.java @@ -4,9 +4,9 @@ import info.bitrich.xchangestream.coincheck.dto.CoincheckSubscriptionNames; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; -import io.reactivex.Single; -import io.reactivex.schedulers.Schedulers; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.Single; +import io.reactivex.rxjava3.schedulers.Schedulers; import java.util.stream.Stream; import lombok.NonNull; import lombok.RequiredArgsConstructor; diff --git a/xchange-stream-coincheck/src/test/java/info/bitrich/xchangestream/coincheck/CoincheckManualExample.java b/xchange-stream-coincheck/src/test/java/info/bitrich/xchangestream/coincheck/CoincheckManualExample.java index 04be09d8e05..87ce58476ff 100644 --- a/xchange-stream-coincheck/src/test/java/info/bitrich/xchangestream/coincheck/CoincheckManualExample.java +++ b/xchange-stream-coincheck/src/test/java/info/bitrich/xchangestream/coincheck/CoincheckManualExample.java @@ -1,7 +1,7 @@ package info.bitrich.xchangestream.coincheck; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.CompositeDisposable; import java.math.BigDecimal; import java.time.Duration; import lombok.SneakyThrows; diff --git a/xchange-stream-coincheck/src/test/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingIntegration.java b/xchange-stream-coincheck/src/test/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingIntegration.java index 266b169392f..5f37997c019 100644 --- a/xchange-stream-coincheck/src/test/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingIntegration.java +++ b/xchange-stream-coincheck/src/test/java/info/bitrich/xchangestream/coincheck/CoincheckStreamingIntegration.java @@ -3,7 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.CompositeDisposable; import java.time.Duration; import java.time.Instant; import java.util.concurrent.atomic.AtomicInteger; diff --git a/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingExchange.java b/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingExchange.java index 432f4ba7589..d3041feb527 100644 --- a/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingExchange.java +++ b/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingExchange.java @@ -3,8 +3,8 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingTradeService; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.coinjar.CoinjarExchange; public class CoinjarStreamingExchange extends CoinjarExchange implements StreamingExchange { diff --git a/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingMarketDataService.java b/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingMarketDataService.java index 10da1539251..b38794f3a75 100644 --- a/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingMarketDataService.java +++ b/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingMarketDataService.java @@ -6,7 +6,7 @@ import info.bitrich.xchangestream.coinjar.dto.CoinjarWebSocketBookEvent; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.math.BigDecimal; import java.util.List; import java.util.Map; diff --git a/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingService.java b/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingService.java index 041ba8229ab..e8e08fb9713 100644 --- a/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingService.java +++ b/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingService.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.coinjar.dto.CoinjarWebSocketSubscribeMessage; import info.bitrich.xchangestream.coinjar.dto.CoinjarWebSocketUnsubscribeMessage; import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; diff --git a/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingTradeService.java b/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingTradeService.java index ed4e3a65c4c..75dd2b70265 100644 --- a/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingTradeService.java +++ b/xchange-stream-coinjar/src/main/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingTradeService.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.coinjar.dto.CoinjarWebSocketUserTradeEvent; import info.bitrich.xchangestream.core.StreamingTradeService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.Order; import org.knowm.xchange.dto.trade.UserTrade; diff --git a/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarOrderChangesExample.java b/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarOrderChangesExample.java index 0ee26fbd6d7..43712e1c85e 100644 --- a/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarOrderChangesExample.java +++ b/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarOrderChangesExample.java @@ -3,8 +3,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; import info.bitrich.xchangestream.core.StreamingTradeService; -import io.reactivex.disposables.Disposable; -import io.reactivex.observers.BaseTestConsumer; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.observers.BaseTestConsumer; import org.junit.Test; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.utils.AuthUtils; @@ -28,7 +28,7 @@ public void runTest() { streamingTradeService .getOrderChanges(null) .test() - .awaitCount(10, BaseTestConsumer.TestWaitStrategy.SLEEP_100MS, 1000 * 60 * 10) + .awaitCount(10) .assertNoErrors(); disposable.dispose(); } diff --git a/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingMarketDataServiceIntegration.java b/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingMarketDataServiceIntegration.java index 69d8a731c80..dc078eea899 100644 --- a/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingMarketDataServiceIntegration.java +++ b/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarStreamingMarketDataServiceIntegration.java @@ -3,7 +3,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; import info.bitrich.xchangestream.core.StreamingMarketDataService; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import org.junit.Test; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.currency.Currency; diff --git a/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarUserTradesExample.java b/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarUserTradesExample.java index 4d3cf578220..a69d438f432 100644 --- a/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarUserTradesExample.java +++ b/xchange-stream-coinjar/src/test/java/info/bitrich/xchangestream/coinjar/CoinjarUserTradesExample.java @@ -3,8 +3,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; import info.bitrich.xchangestream.core.StreamingTradeService; -import io.reactivex.disposables.Disposable; -import io.reactivex.observers.BaseTestConsumer; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.observers.BaseTestConsumer; import org.junit.Test; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.utils.AuthUtils; @@ -28,7 +28,7 @@ public void runTest() { streamingTradeService .getUserTrades(null) .test() - .awaitCount(1, BaseTestConsumer.TestWaitStrategy.SLEEP_100MS, 1000 * 60 * 10) + .awaitCount(1) .assertNoErrors(); disposable.dispose(); } diff --git a/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingAccountService.java b/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingAccountService.java index 6840622d797..46fa1e3c44c 100644 --- a/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingAccountService.java +++ b/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingAccountService.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.coinmate.v2.dto.CoinmateWebsocketBalance; import info.bitrich.xchangestream.core.StreamingAccountService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; diff --git a/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingExchange.java b/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingExchange.java index 4bbee51d3e9..0ef5a9ebe3d 100644 --- a/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingExchange.java +++ b/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingExchange.java @@ -6,7 +6,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.core.StreamingTradeService; -import io.reactivex.Completable; +import io.reactivex.rxjava3.core.Completable; import org.knowm.xchange.coinmate.CoinmateExchange; public class CoinmateStreamingExchange extends CoinmateExchange implements StreamingExchange { diff --git a/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingMarketDataService.java b/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingMarketDataService.java index f369ba65552..c69d4cfe673 100644 --- a/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingMarketDataService.java +++ b/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingMarketDataService.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.coinmate.v2.dto.CoinmateWebSocketTrade; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.List; import org.knowm.xchange.coinmate.CoinmateAdapters; import org.knowm.xchange.coinmate.dto.marketdata.CoinmateOrderBook; diff --git a/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingTradeService.java b/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingTradeService.java index 01e8c667dda..f9b37ba2a00 100644 --- a/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingTradeService.java +++ b/xchange-stream-coinmate/src/main/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingTradeService.java @@ -7,7 +7,7 @@ import info.bitrich.xchangestream.coinmate.v2.dto.CoinmateWebsocketOpenOrder; import info.bitrich.xchangestream.core.StreamingTradeService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.Arrays; import java.util.Collections; import java.util.List; diff --git a/xchange-stream-coinmate/src/test/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingMarketDataServiceTest.java b/xchange-stream-coinmate/src/test/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingMarketDataServiceTest.java index 994d5f50940..b99c3a2cba4 100644 --- a/xchange-stream-coinmate/src/test/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingMarketDataServiceTest.java +++ b/xchange-stream-coinmate/src/test/java/info/bitrich/xchangestream/coinmate/v2/CoinmateStreamingMarketDataServiceTest.java @@ -6,8 +6,8 @@ import static org.mockito.Mockito.when; import com.fasterxml.jackson.databind.ObjectMapper; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.observers.TestObserver; import java.math.BigDecimal; import java.nio.file.Files; import java.nio.file.Paths; diff --git a/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingAccountService.java b/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingAccountService.java index ca9c9615204..3fa540b82a9 100644 --- a/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingAccountService.java +++ b/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingAccountService.java @@ -1,6 +1,6 @@ package info.bitrich.xchangestream.core; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.currency.Currency; import org.knowm.xchange.dto.account.Balance; import org.knowm.xchange.exceptions.ExchangeSecurityException; diff --git a/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingExchange.java b/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingExchange.java index f863996389e..d18a9f3fd75 100644 --- a/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingExchange.java +++ b/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingExchange.java @@ -3,8 +3,8 @@ import info.bitrich.xchangestream.service.ConnectableService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; import info.bitrich.xchangestream.service.netty.NettyStreamingService; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.Exchange; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException; diff --git a/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingMarketDataService.java b/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingMarketDataService.java index c801d102f70..e7f0a3f8e5d 100644 --- a/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingMarketDataService.java +++ b/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingMarketDataService.java @@ -1,6 +1,6 @@ package info.bitrich.xchangestream.core; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.marketdata.*; import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException; diff --git a/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingTradeService.java b/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingTradeService.java index 408e79c1cf6..95bd25317fc 100644 --- a/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingTradeService.java +++ b/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingTradeService.java @@ -1,6 +1,6 @@ package info.bitrich.xchangestream.core; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.Order; import org.knowm.xchange.dto.trade.UserTrade; diff --git a/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/dydxStreamingExchange.java b/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/dydxStreamingExchange.java index a6f0e7e96af..08e9ad93f33 100644 --- a/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/dydxStreamingExchange.java +++ b/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/dydxStreamingExchange.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.dydx.service.v1.dydxStreamingMarketDataService; -import io.reactivex.Completable; +import io.reactivex.rxjava3.core.Completable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.dydx.dydxExchange; import org.slf4j.Logger; diff --git a/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/dydxStreamingService.java b/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/dydxStreamingService.java index f4f99348dbb..0ee7b7cd265 100644 --- a/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/dydxStreamingService.java +++ b/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/dydxStreamingService.java @@ -9,7 +9,7 @@ import info.bitrich.xchangestream.dydx.dto.v3.dydxUpdateOrderBookMessage; import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/service/v1/dydxStreamingMarketDataService.java b/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/service/v1/dydxStreamingMarketDataService.java index 9bb3d2f8ab5..ff3d9919fc8 100644 --- a/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/service/v1/dydxStreamingMarketDataService.java +++ b/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/service/v1/dydxStreamingMarketDataService.java @@ -8,7 +8,7 @@ import info.bitrich.xchangestream.dydx.dto.v1.dydxInitialOrderBookMessage; import info.bitrich.xchangestream.dydx.dto.v1.dydxUpdateOrderBookMessage; import info.bitrich.xchangestream.dydx.dydxStreamingService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.math.BigDecimal; import java.util.Comparator; import java.util.List; diff --git a/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/service/v3/dydxStreamingMarketDataService.java b/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/service/v3/dydxStreamingMarketDataService.java index 27d4457f416..3ec8a94fd92 100644 --- a/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/service/v3/dydxStreamingMarketDataService.java +++ b/xchange-stream-dydx/src/main/java/info/bitrich/xchangestream/dydx/service/v3/dydxStreamingMarketDataService.java @@ -8,7 +8,7 @@ import info.bitrich.xchangestream.dydx.dto.v3.dydxInitialOrderBookMessage; import info.bitrich.xchangestream.dydx.dto.v3.dydxUpdateOrderBookMessage; import info.bitrich.xchangestream.dydx.dydxStreamingService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.math.BigDecimal; import java.util.Comparator; import java.util.List; diff --git a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingExchange.java b/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingExchange.java index 0530a420172..2548b2799c9 100644 --- a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingExchange.java +++ b/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingExchange.java @@ -6,8 +6,8 @@ import info.bitrich.xchangestream.core.StreamingTradeService; import info.bitrich.xchangestream.ftx.dto.FtxWebsocketCredential; import info.bitrich.xchangestream.service.netty.ConnectionStateModel; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.ftx.FtxExchange; diff --git a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingMarketDataService.java b/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingMarketDataService.java index 62d53808cbd..3e64d3394a4 100644 --- a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingMarketDataService.java +++ b/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingMarketDataService.java @@ -2,7 +2,7 @@ import com.google.common.collect.Lists; import info.bitrich.xchangestream.core.StreamingMarketDataService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.marketdata.OrderBook; import org.knowm.xchange.dto.marketdata.Ticker; diff --git a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingTradeService.java b/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingTradeService.java index 5fc6fead895..0679c6bd5ab 100644 --- a/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingTradeService.java +++ b/xchange-stream-ftx/src/main/java/info/bitrich/xchangestream/ftx/FtxStreamingTradeService.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import info.bitrich.xchangestream.core.StreamingTradeService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.Order; import org.knowm.xchange.dto.trade.UserTrade; diff --git a/xchange-stream-ftx/src/test/java/info/bitrich/xchangestream/ftx/FtxStreamingMarketDataServiceIntegration.java b/xchange-stream-ftx/src/test/java/info/bitrich/xchangestream/ftx/FtxStreamingMarketDataServiceIntegration.java index 9d80718a5a8..bba73ad4b73 100644 --- a/xchange-stream-ftx/src/test/java/info/bitrich/xchangestream/ftx/FtxStreamingMarketDataServiceIntegration.java +++ b/xchange-stream-ftx/src/test/java/info/bitrich/xchangestream/ftx/FtxStreamingMarketDataServiceIntegration.java @@ -9,7 +9,7 @@ import info.bitrich.xchangestream.core.StreamingExchangeFactory; import info.bitrich.xchangestream.ftx.dto.FtxOrderbookResponse; import info.bitrich.xchangestream.ftx.dto.FtxTickerResponse; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.io.IOException; import java.io.InputStream; import java.math.BigDecimal; diff --git a/xchange-stream-gateio/src/main/java/GateioStreamingExchange.java b/xchange-stream-gateio/src/main/java/GateioStreamingExchange.java index 16b1ae05677..41a7078a6c7 100644 --- a/xchange-stream-gateio/src/main/java/GateioStreamingExchange.java +++ b/xchange-stream-gateio/src/main/java/GateioStreamingExchange.java @@ -1,7 +1,7 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; -import io.reactivex.Completable; +import io.reactivex.rxjava3.core.Completable; import org.knowm.xchange.gateio.GateioExchange; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/xchange-stream-gateio/src/main/java/GateioStreamingMarketDataService.java b/xchange-stream-gateio/src/main/java/GateioStreamingMarketDataService.java index 9eb4ee34381..7bf3715e0e6 100644 --- a/xchange-stream-gateio/src/main/java/GateioStreamingMarketDataService.java +++ b/xchange-stream-gateio/src/main/java/GateioStreamingMarketDataService.java @@ -1,7 +1,7 @@ import dto.response.GateioOrderBookResponse; import dto.response.GateioTradesResponse; import info.bitrich.xchangestream.core.StreamingMarketDataService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.List; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.marketdata.OrderBook; diff --git a/xchange-stream-gateio/src/main/java/GateioStreamingService.java b/xchange-stream-gateio/src/main/java/GateioStreamingService.java index 878c2f13bee..e2df438894e 100644 --- a/xchange-stream-gateio/src/main/java/GateioStreamingService.java +++ b/xchange-stream-gateio/src/main/java/GateioStreamingService.java @@ -9,7 +9,7 @@ import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; import info.bitrich.xchangestream.service.netty.WebSocketClientCompressionAllowClientNoContextAndServerNoContextHandler; import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/xchange-stream-gateio/src/test/java/GateioManualExample.java b/xchange-stream-gateio/src/test/java/GateioManualExample.java index be720222698..d8c1ae2dd96 100644 --- a/xchange-stream-gateio/src/test/java/GateioManualExample.java +++ b/xchange-stream-gateio/src/test/java/GateioManualExample.java @@ -1,6 +1,6 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.currency.CurrencyPair; import org.slf4j.Logger; diff --git a/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingExchange.java b/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingExchange.java index b6d614f5731..b645c12bf74 100644 --- a/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingExchange.java +++ b/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingExchange.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException; import org.knowm.xchange.gemini.v1.GeminiExchange; diff --git a/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingMarketDataService.java b/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingMarketDataService.java index 76c1f597a57..6817f5684ba 100644 --- a/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingMarketDataService.java +++ b/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingMarketDataService.java @@ -2,7 +2,7 @@ import com.google.common.base.MoreObjects; import info.bitrich.xchangestream.core.StreamingMarketDataService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.math.BigDecimal; import java.util.Map; import java.util.SortedMap; diff --git a/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingService.java b/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingService.java index 818af4cdf06..5d08ba20acd 100644 --- a/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingService.java +++ b/xchange-stream-gemini-v2/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingService.java @@ -8,7 +8,7 @@ import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; import io.netty.util.internal.StringUtil; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/xchange-stream-gemini-v2/src/test/java/info/bitrich/xchangestream/gemini/GeminiManualExample.java b/xchange-stream-gemini-v2/src/test/java/info/bitrich/xchangestream/gemini/GeminiManualExample.java index dc5ab60bf90..64705a8b2b6 100644 --- a/xchange-stream-gemini-v2/src/test/java/info/bitrich/xchangestream/gemini/GeminiManualExample.java +++ b/xchange-stream-gemini-v2/src/test/java/info/bitrich/xchangestream/gemini/GeminiManualExample.java @@ -2,7 +2,7 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.currency.CurrencyPair; import org.slf4j.Logger; diff --git a/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingExchange.java b/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingExchange.java index 2732cdaa146..61f2d9501ee 100644 --- a/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingExchange.java +++ b/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingExchange.java @@ -4,9 +4,9 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.CompletableEmitter; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.CompletableEmitter; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException; import org.knowm.xchange.gemini.v1.GeminiExchange; diff --git a/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingMarketDataService.java b/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingMarketDataService.java index d692ce5f7f2..67d35a41186 100644 --- a/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingMarketDataService.java +++ b/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingMarketDataService.java @@ -10,8 +10,8 @@ import info.bitrich.xchangestream.gemini.dto.GeminiOrderbook; import info.bitrich.xchangestream.gemini.dto.GeminiWebSocketTransaction; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; -import io.reactivex.subjects.PublishSubject; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.subjects.PublishSubject; import java.util.Date; import java.util.HashMap; import java.util.Map; diff --git a/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingService.java b/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingService.java index 23ad27a172c..9f3a5891a09 100644 --- a/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingService.java +++ b/xchange-stream-gemini/src/main/java/info/bitrich/xchangestream/gemini/GeminiStreamingService.java @@ -2,9 +2,9 @@ import com.fasterxml.jackson.databind.JsonNode; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Observable; -import io.reactivex.subjects.BehaviorSubject; -import io.reactivex.subjects.Subject; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.subjects.BehaviorSubject; +import io.reactivex.rxjava3.subjects.Subject; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.knowm.xchange.currency.CurrencyPair; diff --git a/xchange-stream-hitbtc/src/main/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingExchange.java b/xchange-stream-hitbtc/src/main/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingExchange.java index a987dd67e73..d71b9fa6515 100644 --- a/xchange-stream-hitbtc/src/main/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingExchange.java +++ b/xchange-stream-hitbtc/src/main/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingExchange.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.hitbtc.v2.HitbtcExchange; diff --git a/xchange-stream-hitbtc/src/main/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingMarketDataService.java b/xchange-stream-hitbtc/src/main/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingMarketDataService.java index 69556ef7b09..5e6ebabf5e2 100644 --- a/xchange-stream-hitbtc/src/main/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingMarketDataService.java +++ b/xchange-stream-hitbtc/src/main/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingMarketDataService.java @@ -9,7 +9,7 @@ import info.bitrich.xchangestream.hitbtc.dto.HitbtcWebSocketTradeParams; import info.bitrich.xchangestream.hitbtc.dto.HitbtcWebSocketTradesTransaction; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.Arrays; import java.util.HashMap; import java.util.Map; diff --git a/xchange-stream-hitbtc/src/test/java/info/bitrich/xchangestream/hitbtc/HitbtcManualExample.java b/xchange-stream-hitbtc/src/test/java/info/bitrich/xchangestream/hitbtc/HitbtcManualExample.java index ae55e17c021..8bd3bbd4ede 100644 --- a/xchange-stream-hitbtc/src/test/java/info/bitrich/xchangestream/hitbtc/HitbtcManualExample.java +++ b/xchange-stream-hitbtc/src/test/java/info/bitrich/xchangestream/hitbtc/HitbtcManualExample.java @@ -2,7 +2,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import org.knowm.xchange.currency.CurrencyPair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/xchange-stream-hitbtc/src/test/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingMarketDataServiceTest.java b/xchange-stream-hitbtc/src/test/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingMarketDataServiceTest.java index e89d82bce97..3b1b841f33e 100644 --- a/xchange-stream-hitbtc/src/test/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingMarketDataServiceTest.java +++ b/xchange-stream-hitbtc/src/test/java/info/bitrich/xchangestream/hitbtc/HitbtcStreamingMarketDataServiceTest.java @@ -5,8 +5,8 @@ import static org.mockito.Mockito.when; import com.fasterxml.jackson.databind.ObjectMapper; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.observers.TestObserver; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.nio.file.Files; diff --git a/xchange-stream-huobi/src/main/java/info/bitrich/xchangestream/huobi/HuobiStreamingExchange.java b/xchange-stream-huobi/src/main/java/info/bitrich/xchangestream/huobi/HuobiStreamingExchange.java index f60b410a52c..339295aed2a 100644 --- a/xchange-stream-huobi/src/main/java/info/bitrich/xchangestream/huobi/HuobiStreamingExchange.java +++ b/xchange-stream-huobi/src/main/java/info/bitrich/xchangestream/huobi/HuobiStreamingExchange.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.huobi.HuobiExchange; public class HuobiStreamingExchange extends HuobiExchange implements StreamingExchange { diff --git a/xchange-stream-huobi/src/main/java/info/bitrich/xchangestream/huobi/HuobiStreamingMarketDataService.java b/xchange-stream-huobi/src/main/java/info/bitrich/xchangestream/huobi/HuobiStreamingMarketDataService.java index 9605f9bb851..ea0e8d4341d 100644 --- a/xchange-stream-huobi/src/main/java/info/bitrich/xchangestream/huobi/HuobiStreamingMarketDataService.java +++ b/xchange-stream-huobi/src/main/java/info/bitrich/xchangestream/huobi/HuobiStreamingMarketDataService.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import info.bitrich.xchangestream.core.StreamingMarketDataService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; diff --git a/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingExchange.java b/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingExchange.java index afdea5ff10e..5ec66d66c18 100644 --- a/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingExchange.java +++ b/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingExchange.java @@ -9,8 +9,8 @@ import info.bitrich.xchangestream.kraken.dto.KrakenSystemStatus; import info.bitrich.xchangestream.kraken.dto.enums.KrakenEventType; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import org.apache.commons.lang3.StringUtils; import org.knowm.xchange.ExchangeSpecification; diff --git a/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingMarketDataService.java b/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingMarketDataService.java index 612f8869843..a4a318d3f89 100644 --- a/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingMarketDataService.java +++ b/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingMarketDataService.java @@ -5,7 +5,7 @@ import com.google.common.collect.Sets; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.kraken.dto.enums.KrakenSubscriptionName; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.TreeSet; import org.apache.commons.lang3.ObjectUtils; import org.knowm.xchange.currency.CurrencyPair; diff --git a/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingService.java b/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingService.java index 01758e6893b..7da16daa7bd 100644 --- a/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingService.java +++ b/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingService.java @@ -17,9 +17,9 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; -import io.reactivex.Completable; -import io.reactivex.Observable; -import io.reactivex.ObservableEmitter; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableEmitter; import java.io.IOException; import java.time.Duration; import java.util.Collections; diff --git a/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingTradeService.java b/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingTradeService.java index e9d81d8e6d1..bff09bc8f41 100644 --- a/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingTradeService.java +++ b/xchange-stream-kraken/src/main/java/info/bitrich/xchangestream/kraken/KrakenStreamingTradeService.java @@ -6,7 +6,7 @@ import info.bitrich.xchangestream.kraken.dto.KrakenOwnTrade; import info.bitrich.xchangestream.kraken.dto.enums.KrakenSubscriptionName; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; diff --git a/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenOrderbookExample.java b/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenOrderbookExample.java index 9d0cf317eeb..476f61e953a 100644 --- a/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenOrderbookExample.java +++ b/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenOrderbookExample.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.math.BigDecimal; import java.util.concurrent.TimeUnit; import org.knowm.xchange.ExchangeSpecification; diff --git a/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenTickerExample.java b/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenTickerExample.java index a708926b92d..eba7d09c742 100644 --- a/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenTickerExample.java +++ b/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenTickerExample.java @@ -2,7 +2,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.util.concurrent.TimeUnit; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.currency.CurrencyPair; diff --git a/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenTradesExample.java b/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenTradesExample.java index 99ddafe29ae..30bf86e224d 100644 --- a/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenTradesExample.java +++ b/xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenTradesExample.java @@ -2,7 +2,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.util.concurrent.TimeUnit; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.currency.CurrencyPair; diff --git a/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingExchange.java b/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingExchange.java index 0dfb8492036..b58a4ad5de9 100644 --- a/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingExchange.java +++ b/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingExchange.java @@ -5,8 +5,8 @@ import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.core.StreamingTradeService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.krakenfutures.KrakenFuturesExchange; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingMarketDataService.java b/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingMarketDataService.java index 0afbc22d378..bdb2e95c850 100644 --- a/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingMarketDataService.java +++ b/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingMarketDataService.java @@ -7,7 +7,7 @@ import info.bitrich.xchangestream.krakenfutures.dto.KrakenFuturesStreamingTickerResponse; import info.bitrich.xchangestream.krakenfutures.dto.KrakenFuturesStreamingTradeResponse; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.util.HashMap; import java.util.Map; diff --git a/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingService.java b/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingService.java index eb572cb82b3..c56f157e24d 100644 --- a/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingService.java +++ b/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingService.java @@ -7,7 +7,7 @@ import info.bitrich.xchangestream.krakenfutures.dto.KrakenFuturesStreamingWebsocketMessage; import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Completable; +import io.reactivex.rxjava3.core.Completable; import java.io.IOException; import java.util.concurrent.TimeUnit; import org.apache.commons.lang3.NotImplementedException; diff --git a/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingTradeService.java b/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingTradeService.java index c5be78363d7..9d8b0fdeecc 100644 --- a/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingTradeService.java +++ b/xchange-stream-krakenfutures/src/main/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingTradeService.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.core.StreamingTradeService; import info.bitrich.xchangestream.krakenfutures.dto.KrakenFuturesStreamingFillsDeltaResponse; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.List; import org.knowm.xchange.dto.trade.UserTrade; import org.knowm.xchange.instrument.Instrument; diff --git a/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPrivateDataIntegration.java b/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPrivateDataIntegration.java index cc9dde1851f..3432111b792 100644 --- a/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPrivateDataIntegration.java +++ b/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPrivateDataIntegration.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.io.IOException; import java.math.BigDecimal; import java.util.Properties; diff --git a/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPrivateDataTest.java b/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPrivateDataTest.java new file mode 100644 index 00000000000..cb5745af1e7 --- /dev/null +++ b/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPrivateDataTest.java @@ -0,0 +1,136 @@ +package info.bitrich.xchangestream.krakenfutures; + +import info.bitrich.xchangestream.core.StreamingExchange; +import info.bitrich.xchangestream.core.StreamingExchangeFactory; +import io.reactivex.rxjava3.disposables.Disposable; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.knowm.xchange.ExchangeSpecification; +import org.knowm.xchange.derivative.FuturesContract; +import org.knowm.xchange.dto.Order; +import org.knowm.xchange.dto.meta.InstrumentMetaData; +import org.knowm.xchange.dto.trade.MarketOrder; +import org.knowm.xchange.instrument.Instrument; +import org.knowm.xchange.krakenfutures.KrakenFuturesExchange; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +@Ignore +public class KrakenFuturesStreamingPrivateDataTest { + + private static final Logger LOG = LoggerFactory.getLogger(KrakenFuturesStreamingPrivateDataTest.class); + StreamingExchange exchange; + Instrument instrument = new FuturesContract("BTC/USD/PERP"); + + @Before + public void setUp(){ + Properties properties = new Properties(); + + try { + properties.load(this.getClass().getResourceAsStream("/secret.keys")); + } catch (IOException e) { + throw new RuntimeException(e); + } + // Enter your authentication details here to run private endpoint tests + final String API_KEY = (properties.getProperty("apiKey") == null) ? System.getenv("krakenfutures_apikey"): properties.getProperty("apiKey"); + final String SECRET_KEY = (properties.getProperty("secret") == null) ? System.getenv("krakenfutures_secretkey"): properties.getProperty("secret"); + + ExchangeSpecification spec = new KrakenFuturesExchange().getDefaultExchangeSpecification(); + spec.setApiKey(API_KEY); + spec.setSecretKey(SECRET_KEY); + spec.setExchangeSpecificParametersItem(KrakenFuturesStreamingExchange.USE_SANDBOX, true); + + exchange = StreamingExchangeFactory.INSTANCE.createExchange(KrakenFuturesStreamingExchange.class); + exchange.applySpecification(spec); + exchange.connect().blockingAwait(); + + InstrumentMetaData metaData = exchange.getExchangeMetaData().getInstruments().get(instrument); + assertThat(metaData.getPriceScale()).isNotNull(); + assertThat(metaData.getVolumeScale()).isNotNull(); + assertThat(metaData.getMinimumAmount()).isNotNull(); + } + + @Test + public void checkUserTrades() throws InterruptedException, IOException { + int counter = 0; + + Disposable dis = exchange.getStreamingTradeService().getUserTrades(instrument) + .retry() + .subscribe(fill -> { + LOG.info(fill.toString()); + assertThat(fill).isNotNull(); + assertThat(fill.getInstrument()).isEqualTo(instrument); + }); + + Disposable dis2 = exchange.getStreamingTradeService().getUserTrades(new FuturesContract("ETH/USD/PERP")) + .retry() + .subscribe(fill -> { + LOG.info(fill.toString()); + assertThat(fill).isNotNull(); + assertThat(fill.getInstrument()).isEqualTo(new FuturesContract("ETH/USD/PERP")); + }); + while (counter < 4){ + String orderId; + if(counter == 3){ + orderId = exchange.getTradeService().placeMarketOrder(new MarketOrder.Builder(Order.OrderType.ASK, new FuturesContract("ETH/USD/PERP")) + .originalAmount(BigDecimal.ONE) + .build()); + } else { + orderId = exchange.getTradeService().placeMarketOrder(new MarketOrder.Builder(Order.OrderType.BID, instrument) + .originalAmount(BigDecimal.ONE) + .build()); + } + LOG.info("OrderId: "+orderId); + counter++; + TimeUnit.SECONDS.sleep(1); + } + dis.dispose(); + dis2.dispose(); + } + + @Test + public void checkAllUserTrades() throws InterruptedException, IOException { + int counter = 0; + + Disposable dis = exchange.getStreamingTradeService().getUserTrades() + .map(fill->{ + if(fill.getOrderUserReference().equals("2")){ + throw new IOException("Error"); + } else { + LOG.info(fill.toString()); + assertThat(fill).isNotNull(); + } + return fill; + }) + .retry() + .subscribe(); + + while (counter < 5){ + String orderId; + if(counter == 3){ + orderId = exchange.getTradeService().placeMarketOrder(new MarketOrder.Builder(Order.OrderType.ASK, new FuturesContract("ETH/USD/PERP")) + .originalAmount(BigDecimal.valueOf(0.1)) + .userReference(Integer.toString(counter)) + .build()); + } else { + orderId = exchange.getTradeService().placeMarketOrder(new MarketOrder.Builder(Order.OrderType.BID, instrument) + .originalAmount(BigDecimal.valueOf(0.1)) + .userReference(Integer.toString(counter)) + .build()); + } + LOG.info("OrderId: "+orderId); + counter++; + TimeUnit.SECONDS.sleep(1); + } + TimeUnit.SECONDS.sleep(2); + dis.dispose(); + } +} diff --git a/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataIntegration.java b/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataIntegration.java index 624b3464458..f129f34ba10 100644 --- a/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataIntegration.java +++ b/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataIntegration.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.math.BigDecimal; import java.util.concurrent.TimeUnit; import org.junit.Before; @@ -55,7 +55,6 @@ public void checkStreamingTicker() { return ticker; }) .test() - .assertSubscribed() .awaitCount(1) .assertValue(ticker -> ticker.getInstrument().equals(instrument)) .dispose(); @@ -73,7 +72,6 @@ public void checkStreamingFundingRate() { return fundingRate; }) .test() - .assertSubscribed() .awaitCount(1) .assertValue( fundingRate -> diff --git a/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataTest.java b/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataTest.java new file mode 100644 index 00000000000..71a44391f7b --- /dev/null +++ b/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataTest.java @@ -0,0 +1,82 @@ +package info.bitrich.xchangestream.krakenfutures; + +import info.bitrich.xchangestream.core.ProductSubscription; +import info.bitrich.xchangestream.core.StreamingExchange; +import info.bitrich.xchangestream.core.StreamingExchangeFactory; +import io.reactivex.rxjava3.disposables.Disposable; +import org.junit.Before; +import org.junit.Test; +import org.knowm.xchange.derivative.FuturesContract; +import org.knowm.xchange.dto.marketdata.OrderBook; +import org.knowm.xchange.dto.meta.InstrumentMetaData; +import org.knowm.xchange.instrument.Instrument; + +import java.math.BigDecimal; +import java.util.concurrent.TimeUnit; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +public class KrakenFuturesStreamingPublicDataTest { + + StreamingExchange exchange = StreamingExchangeFactory.INSTANCE.createExchange(KrakenFuturesStreamingExchange.class); + Instrument instrument = new FuturesContract("BTC/USD/PERP"); + + @Before + public void setUp(){ + InstrumentMetaData metaData = exchange.getExchangeMetaData().getInstruments().get(instrument); + assertThat(metaData.getPriceScale()).isNotNull(); + assertThat(metaData.getVolumeScale()).isNotNull(); + assertThat(metaData.getMinimumAmount()).isNotNull(); + exchange.connect(ProductSubscription.create().build()).blockingAwait(); + } + @Test + public void checkStreamingOrderBook() { + OrderBook orderBook = exchange.getStreamingMarketDataService().getOrderBook(instrument).blockingFirst(); + assertThat(orderBook.getBids().get(0).getInstrument()).isEqualTo(instrument); + assertThat(orderBook.getBids().get(0).getLimitPrice()).isLessThan(orderBook.getAsks().get(0).getLimitPrice()); + assertThat(orderBook.getBids().get(0).getLimitPrice()).isGreaterThan(BigDecimal.ZERO); + assertThat(orderBook.getBids().get(0).getOriginalAmount()).isGreaterThan(BigDecimal.ZERO); + } + + @Test + public void checkStreamingTicker() { + exchange.getStreamingMarketDataService().getTicker(instrument) + .map(ticker -> { + System.out.println(ticker); + assertThat(ticker).isNotNull(); + return ticker; + }) + .test() + .assertNoErrors() + .awaitCount(1) + .assertValue(ticker -> ticker.getInstrument().equals(instrument)) + .dispose(); + } + + @Test + public void checkStreamingFundingRate() { + exchange.getStreamingMarketDataService().getFundingRate(instrument) + .map(fundingRate -> { + System.out.println(fundingRate); + assertThat(fundingRate).isNotNull(); + return fundingRate; + }) + .test() + .assertNoErrors() + .awaitCount(1) + .assertValue(fundingRate -> fundingRate.getFundingRateEffectiveInMinutes() < 61 && fundingRate.getFundingRate1h() != null) + .dispose(); + } + + @Test + public void checkStreamingTrades() throws InterruptedException { + Disposable dis = exchange.getStreamingMarketDataService().getTrades(instrument) + .subscribe(trade -> { + System.out.println(trade.toString()); + assertThat(trade).isNotNull(); + assertThat(trade.getInstrument()).isEqualTo(instrument); + }); + TimeUnit.SECONDS.sleep(3); + dis.dispose(); + } +} diff --git a/xchange-stream-kucoin/pom.xml b/xchange-stream-kucoin/pom.xml index d0585ea3ec2..35fdc3342bf 100644 --- a/xchange-stream-kucoin/pom.xml +++ b/xchange-stream-kucoin/pom.xml @@ -34,4 +34,4 @@ - \ No newline at end of file + diff --git a/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingExchange.java b/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingExchange.java index 414ef039d52..e0cef1426e3 100644 --- a/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingExchange.java +++ b/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingExchange.java @@ -5,8 +5,11 @@ import info.bitrich.xchangestream.core.StreamingTradeService; import info.bitrich.xchangestream.service.netty.NettyStreamingService; import info.bitrich.xchangestream.util.Events; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; +import org.knowm.xchange.kucoin.KucoinExchange; +import org.knowm.xchange.kucoin.dto.response.WebsocketResponse; + import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; diff --git a/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingMarketDataService.java b/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingMarketDataService.java index cd26529aff9..0c2fddbdb94 100644 --- a/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingMarketDataService.java +++ b/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingMarketDataService.java @@ -6,8 +6,8 @@ import info.bitrich.xchangestream.kucoin.dto.KucoinOrderBookEventData; import info.bitrich.xchangestream.kucoin.dto.KucoinTickerEvent; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; -import io.reactivex.functions.Consumer; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.functions.Consumer; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicLong; diff --git a/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingService.java b/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingService.java index 82744b7868f..347e2ac9bc3 100644 --- a/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingService.java +++ b/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingService.java @@ -7,10 +7,11 @@ import info.bitrich.xchangestream.service.netty.WebSocketClientHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; -import io.reactivex.Completable; -import io.reactivex.CompletableSource; -import io.reactivex.Observable; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.CompletableSource; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.disposables.Disposable; + import java.io.IOException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; diff --git a/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingTradeService.java b/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingTradeService.java index 4a7ea7a2c67..37a11acbf1e 100644 --- a/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingTradeService.java +++ b/xchange-stream-kucoin/src/main/java/info/bitrich/xchangestream/kucoin/KucoinStreamingTradeService.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.core.StreamingTradeService; import info.bitrich.xchangestream.kucoin.dto.KucoinWebSocketOrderEvent; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.Order; import org.slf4j.Logger; diff --git a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoLevel2BatchSubscription.java b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoLevel2BatchSubscription.java index f36fc5a8671..4db4157e7d6 100644 --- a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoLevel2BatchSubscription.java +++ b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoLevel2BatchSubscription.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.lgo.domain.LgoGroupedLevel2Update; import info.bitrich.xchangestream.lgo.dto.LgoLevel2Update; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.marketdata.OrderBook; diff --git a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingAccountService.java b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingAccountService.java index 684e941d005..2c9fce22467 100644 --- a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingAccountService.java +++ b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingAccountService.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.lgo.domain.LgoGroupedBalanceUpdate; import info.bitrich.xchangestream.lgo.dto.LgoBalanceUpdate; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.List; import org.knowm.xchange.currency.Currency; import org.knowm.xchange.dto.account.Balance; diff --git a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingExchange.java b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingExchange.java index ebc4b687cff..ccd34bc5636 100644 --- a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingExchange.java +++ b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingExchange.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.lgo.LgoEnv; import org.knowm.xchange.lgo.LgoExchange; diff --git a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingMarketDataService.java b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingMarketDataService.java index ddb6ed16296..71e83feda54 100644 --- a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingMarketDataService.java +++ b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingMarketDataService.java @@ -1,7 +1,7 @@ package info.bitrich.xchangestream.lgo; import info.bitrich.xchangestream.core.StreamingMarketDataService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.knowm.xchange.currency.CurrencyPair; diff --git a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeService.java b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeService.java index f29437725da..0db78aa8d1c 100644 --- a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeService.java +++ b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeService.java @@ -9,7 +9,7 @@ import info.bitrich.xchangestream.lgo.dto.LgoAckUpdate; import info.bitrich.xchangestream.lgo.dto.LgoSocketPlaceOrder; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.util.Collection; import java.util.Date; diff --git a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoTradeBatchSubscription.java b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoTradeBatchSubscription.java index 52152fa50bd..15a99e5044e 100644 --- a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoTradeBatchSubscription.java +++ b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoTradeBatchSubscription.java @@ -4,7 +4,7 @@ import info.bitrich.xchangestream.lgo.domain.LgoGroupedTradeUpdate; import info.bitrich.xchangestream.lgo.dto.LgoTradesUpdate; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import org.knowm.xchange.currency.CurrencyPair; import org.knowm.xchange.dto.marketdata.Trade; diff --git a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoUserBatchSubscription.java b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoUserBatchSubscription.java index 8a2ae6a8f88..98fbfb0afaa 100644 --- a/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoUserBatchSubscription.java +++ b/xchange-stream-lgo/src/main/java/info/bitrich/xchangestream/lgo/LgoUserBatchSubscription.java @@ -9,7 +9,7 @@ import info.bitrich.xchangestream.lgo.dto.LgoUserSnapshot; import info.bitrich.xchangestream.lgo.dto.LgoUserUpdate; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingAccountServiceTest.java b/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingAccountServiceTest.java index f681612f097..99b3f9f32f6 100644 --- a/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingAccountServiceTest.java +++ b/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingAccountServiceTest.java @@ -7,8 +7,8 @@ import static org.mockito.Mockito.when; import com.fasterxml.jackson.databind.JsonNode; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.observers.TestObserver; import java.io.IOException; import java.math.BigDecimal; import java.util.Arrays; @@ -30,7 +30,7 @@ public void it_gives_initial_wallet_snapshot() throws IOException { TestObserver wallet = service.getWallet().test(); verify(streamingService).subscribeChannel("balance"); - wallet.assertSubscribed(); + wallet.assertNoErrors(); wallet.assertValueCount(1); wallet .values() diff --git a/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingMarketDataServiceTest.java b/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingMarketDataServiceTest.java index 61d5c21149d..8ddb821406b 100644 --- a/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingMarketDataServiceTest.java +++ b/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingMarketDataServiceTest.java @@ -7,7 +7,7 @@ import static org.mockito.Mockito.when; import com.fasterxml.jackson.databind.JsonNode; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.math.BigDecimal; import java.text.ParseException; diff --git a/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeServiceTest.java b/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeServiceTest.java index b05a73e3282..b090a6c00e9 100644 --- a/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeServiceTest.java +++ b/xchange-stream-lgo/src/test/java/info/bitrich/xchangestream/lgo/LgoStreamingTradeServiceTest.java @@ -15,7 +15,7 @@ import info.bitrich.xchangestream.lgo.domain.LgoOrderEvent; import info.bitrich.xchangestream.lgo.domain.LgoPendingOrderEvent; import info.bitrich.xchangestream.lgo.domain.LgoReceivedOrderEvent; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.math.BigDecimal; import java.net.URISyntaxException; diff --git a/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingExchange.java b/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingExchange.java index aa51e3e38c1..b124480700f 100644 --- a/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingExchange.java +++ b/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingExchange.java @@ -4,8 +4,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.okcoin.OkCoinExchange; public class OkCoinStreamingExchange extends OkCoinExchange implements StreamingExchange { diff --git a/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingMarketDataService.java b/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingMarketDataService.java index afad735b045..2984e8ced42 100644 --- a/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingMarketDataService.java +++ b/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingMarketDataService.java @@ -6,7 +6,7 @@ import info.bitrich.xchangestream.okcoin.dto.OkCoinWebSocketTrade; import info.bitrich.xchangestream.okcoin.dto.marketdata.FutureTicker; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; diff --git a/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingService.java b/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingService.java index b5f3318fd02..2e9ae82a95a 100644 --- a/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingService.java +++ b/xchange-stream-okcoin/src/main/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingService.java @@ -10,10 +10,10 @@ import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; import io.netty.handler.codec.http.websocketx.WebSocketFrame; -import io.reactivex.Completable; -import io.reactivex.CompletableSource; -import io.reactivex.Observable; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.CompletableSource; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.disposables.Disposable; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeUnit; diff --git a/xchange-stream-okcoin/src/test/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingMarketDataServiceTest.java b/xchange-stream-okcoin/src/test/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingMarketDataServiceTest.java index e33772d14f8..86ad0a771f7 100644 --- a/xchange-stream-okcoin/src/test/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingMarketDataServiceTest.java +++ b/xchange-stream-okcoin/src/test/java/info/bitrich/xchangestream/okcoin/OkCoinStreamingMarketDataServiceTest.java @@ -5,8 +5,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.observers.TestObserver; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; diff --git a/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingExchange.java b/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingExchange.java index 8156ddaf9fa..aea9cf83e5a 100644 --- a/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingExchange.java +++ b/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingExchange.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.core.StreamingTradeService; import info.bitrich.xchangestream.service.netty.WebSocketClientHandler; -import io.reactivex.Completable; +import io.reactivex.rxjava3.core.Completable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException; import org.knowm.xchange.okex.OkexExchange; diff --git a/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingMarketDataService.java b/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingMarketDataService.java index 089d019aa61..dea6cc27b60 100644 --- a/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingMarketDataService.java +++ b/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingMarketDataService.java @@ -5,8 +5,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; -import io.reactivex.subjects.PublishSubject; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.subjects.PublishSubject; import java.sql.Timestamp; import java.util.*; import java.util.concurrent.ConcurrentHashMap; diff --git a/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingService.java b/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingService.java index 91420b0f70b..e522b4d243c 100644 --- a/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingService.java +++ b/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingService.java @@ -8,10 +8,10 @@ import info.bitrich.xchangestream.service.netty.WebSocketClientHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; -import io.reactivex.Completable; -import io.reactivex.CompletableSource; -import io.reactivex.Observable; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.CompletableSource; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.disposables.Disposable; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; diff --git a/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingTradeService.java b/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingTradeService.java index 2699738dcd3..0e1f3c2cf7f 100644 --- a/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingTradeService.java +++ b/xchange-stream-okex/src/main/java/info/bitrich/xchangestream/okex/OkexStreamingTradeService.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import info.bitrich.xchangestream.core.StreamingTradeService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.util.List; import org.knowm.xchange.dto.meta.ExchangeMetaData; import org.knowm.xchange.dto.trade.UserTrade; diff --git a/xchange-stream-okex/src/test/java/info/bitrich/xchangestream/okex/OkexStreamingPrivateDataIntegtration.java b/xchange-stream-okex/src/test/java/info/bitrich/xchangestream/okex/OkexStreamingPrivateDataIntegtration.java index 3618e5721cd..f99be38ecd0 100644 --- a/xchange-stream-okex/src/test/java/info/bitrich/xchangestream/okex/OkexStreamingPrivateDataIntegtration.java +++ b/xchange-stream-okex/src/test/java/info/bitrich/xchangestream/okex/OkexStreamingPrivateDataIntegtration.java @@ -2,7 +2,7 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.disposables.Disposable; import java.io.IOException; import java.util.Properties; import java.util.concurrent.TimeUnit; diff --git a/xchange-stream-okex/src/test/java/info/bitrich/xchangestream/okex/OkexStreamingPublicDataIntegration.java b/xchange-stream-okex/src/test/java/info/bitrich/xchangestream/okex/OkexStreamingPublicDataIntegration.java index d3846efde13..913796bd015 100644 --- a/xchange-stream-okex/src/test/java/info/bitrich/xchangestream/okex/OkexStreamingPublicDataIntegration.java +++ b/xchange-stream-okex/src/test/java/info/bitrich/xchangestream/okex/OkexStreamingPublicDataIntegration.java @@ -4,7 +4,6 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; -import io.reactivex.disposables.Disposable; import java.util.concurrent.TimeUnit; import org.junit.Before; import org.junit.Test; @@ -12,6 +11,10 @@ import org.knowm.xchange.derivative.FuturesContract; import org.knowm.xchange.instrument.Instrument; +import info.bitrich.xchangestream.core.StreamingExchange; +import info.bitrich.xchangestream.core.StreamingExchangeFactory; +import io.reactivex.rxjava3.disposables.Disposable; + public class OkexStreamingPublicDataIntegration { private StreamingExchange exchange; diff --git a/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingExchange.java b/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingExchange.java index 3a36645ee4e..1f4193721c4 100644 --- a/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingExchange.java +++ b/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingExchange.java @@ -7,8 +7,8 @@ import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel.State; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.net.URL; import java.util.HashMap; diff --git a/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingMarketDataService.java b/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingMarketDataService.java index 65c552fa631..eb67b5e613d 100644 --- a/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingMarketDataService.java +++ b/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingMarketDataService.java @@ -17,7 +17,7 @@ import info.bitrich.xchangestream.poloniex2.dto.PoloniexWebSocketTickerTransaction; import info.bitrich.xchangestream.poloniex2.dto.PoloniexWebSocketTradeEvent; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.math.BigDecimal; import java.util.List; import java.util.Map; diff --git a/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingService.java b/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingService.java index 98a8a47ac8a..3f22d3f13d9 100644 --- a/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingService.java +++ b/xchange-stream-poloniex2/src/main/java/info/bitrich/xchangestream/poloniex2/PoloniexStreamingService.java @@ -6,7 +6,7 @@ import info.bitrich.xchangestream.poloniex2.dto.PoloniexWebSocketOrderbookModifiedEvent; import info.bitrich.xchangestream.poloniex2.dto.PoloniexWebSocketSubscriptionMessage; import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import java.io.IOException; import java.util.List; import java.util.Map; diff --git a/xchange-stream-serum/src/main/java/info/bitrich/xchangestream/serum/SerumStreamingExchange.java b/xchange-stream-serum/src/main/java/info/bitrich/xchangestream/serum/SerumStreamingExchange.java index 20eeb2233ca..c946df3c05f 100644 --- a/xchange-stream-serum/src/main/java/info/bitrich/xchangestream/serum/SerumStreamingExchange.java +++ b/xchange-stream-serum/src/main/java/info/bitrich/xchangestream/serum/SerumStreamingExchange.java @@ -6,8 +6,8 @@ import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.ConnectionStateModel; -import io.reactivex.Completable; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; import org.knowm.xchange.ExchangeSpecification; public class SerumStreamingExchange extends SerumExchange implements StreamingExchange { diff --git a/xchange-stream-service-core/pom.xml b/xchange-stream-service-core/pom.xml index eb0b8990270..79fbc9d313c 100644 --- a/xchange-stream-service-core/pom.xml +++ b/xchange-stream-service-core/pom.xml @@ -15,9 +15,9 @@ - io.reactivex.rxjava2 + io.reactivex.rxjava3 rxjava - \ No newline at end of file + diff --git a/xchange-stream-service-core/src/main/java/info/bitrich/xchangestream/service/ConnectableService.java b/xchange-stream-service-core/src/main/java/info/bitrich/xchangestream/service/ConnectableService.java index ff2aa44b3e3..6939a964cfa 100644 --- a/xchange-stream-service-core/src/main/java/info/bitrich/xchangestream/service/ConnectableService.java +++ b/xchange-stream-service-core/src/main/java/info/bitrich/xchangestream/service/ConnectableService.java @@ -1,6 +1,6 @@ package info.bitrich.xchangestream.service; -import io.reactivex.Completable; +import io.reactivex.rxjava3.core.Completable; /** Base class of streaming services, declares connect() method including before connection logic */ public abstract class ConnectableService { diff --git a/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/ConnectionStateModel.java b/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/ConnectionStateModel.java index 2b0599169d1..273d94c4840 100644 --- a/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/ConnectionStateModel.java +++ b/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/ConnectionStateModel.java @@ -1,8 +1,8 @@ package info.bitrich.xchangestream.service.netty; -import io.reactivex.Observable; -import io.reactivex.subjects.BehaviorSubject; -import io.reactivex.subjects.Subject; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.subjects.BehaviorSubject; +import io.reactivex.rxjava3.subjects.Subject; import java.util.concurrent.atomic.AtomicReference; /** diff --git a/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java b/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java index 925d9ad1e53..2b9e4dc6d86 100644 --- a/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java +++ b/xchange-stream-service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java @@ -36,11 +36,11 @@ import io.netty.handler.timeout.IdleStateHandler; import io.netty.util.internal.SocketUtils; import io.netty.util.internal.StringUtil; -import io.reactivex.Completable; -import io.reactivex.Observable; -import io.reactivex.ObservableEmitter; -import io.reactivex.subjects.PublishSubject; -import io.reactivex.subjects.Subject; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableEmitter; +import io.reactivex.rxjava3.subjects.PublishSubject; +import io.reactivex.rxjava3.subjects.Subject; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; diff --git a/xchange-stream-service-pubnub/pom.xml b/xchange-stream-service-pubnub/pom.xml index 601df5424b2..dccf2f76d86 100644 --- a/xchange-stream-service-pubnub/pom.xml +++ b/xchange-stream-service-pubnub/pom.xml @@ -19,7 +19,7 @@ - io.reactivex.rxjava2 + io.reactivex.rxjava3 rxjava @@ -29,4 +29,4 @@ - \ No newline at end of file + diff --git a/xchange-stream-service-pubnub/src/main/java/info/bitrich/xchangestream/service/pubnub/PubnubStreamingService.java b/xchange-stream-service-pubnub/src/main/java/info/bitrich/xchangestream/service/pubnub/PubnubStreamingService.java index 6880c4e6080..86966cd215b 100644 --- a/xchange-stream-service-pubnub/src/main/java/info/bitrich/xchangestream/service/pubnub/PubnubStreamingService.java +++ b/xchange-stream-service-pubnub/src/main/java/info/bitrich/xchangestream/service/pubnub/PubnubStreamingService.java @@ -15,9 +15,9 @@ import com.pubnub.api.models.consumer.pubsub.objects.PNMembershipResult; import com.pubnub.api.models.consumer.pubsub.objects.PNSpaceResult; import com.pubnub.api.models.consumer.pubsub.objects.PNUserResult; -import io.reactivex.Completable; -import io.reactivex.Observable; -import io.reactivex.ObservableEmitter; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.ObservableEmitter; import java.io.IOException; import java.util.Collections; import java.util.Map;