- Handle closed executor in ws callbacks (#71)
Breaking change! This release changes the semantics of working with connection tokens described in Centrifugo v5 release post.
Previously, returning an empty token string from ConnectionTokenGetter
callback resulted in client disconnection with unauthorized reason.
Now returning an empty string from ConnectionTokenGetter
is a valid scenario which won't result into disconnect on the client side. It's still possible to disconnect client by returning instance of a special UnauthorizedException
from ConnectionTokenGetter
.
And we are putting back SetToken
method to the SDK – so it's now possible to reset the token to be empty upon user logout.
- Handle disconnect push. This is not used at the moment - but is an enabler for the future development.
- Our errors inherit from
Throwable
, and now we callsuper()
in their constructors. This allows propagating exceptioncause
, as the result the whole chain of exceptions is visible in error handler. #58 - Disconnect gracefully from WebSocket, instead of calling
ws.cancel()
. #56
- Fix
unsubscribe
API – it used legacy format of the command sent to the server - Add overloaded
newSubscription
withSubscriptionOptions
support. This allows settingSubscription
options upon creation - such as subscription token,SubscriptionTokenGetter
, and so on. See #53 - Diffirentiate
bad protocol
disconnects for better understanding where those came from. See #50
- Include consumer proguard rules #47 - this should provide ProGuard rules automatically when using
centrifuge-java
thus users of the library should not add rules manually in the application. - API compatibility check on CI #46
- Add ability to set custom DNS resolver for connecting to server #40
Also, several internal improvements (thanks to @ntoskrnl):
- Use protobuf gradle plugin to generate Protocol.java #41
- Refactor publishing to Maven Central #43
- GitHub Actions for CI/CD: test and release #45
- Fix reconnect after onFailure #39
- Avoid duplicate connecting event, better Exception msg if tokenGetter not set. Commit.
- Fixes in example
Breaking changes
Releases 0.2.0 and 0.2.1 were broken - see #36
This release adopts a new iteration of Centrifugal protocol and a new iteration of API. Client now behaves according to the client SDK API specification. The work has been done according to Centrifugo v4 roadmap.
Check out Centrifugo v4 release post that covers the reasoning behind changes.
All the current core features of Centrifugal client protocol are now supported here.
New release only works with Centrifugo >= v4.0.0 and Centrifuge >= 0.25.0. See Centrifugo v4 migration guide for details about the changes in the ecosystem.
Note, that Centrifugo v4 supports clients working over the previous protocol iteration, so you can update Centrifugo to v4 without any changes on the client side (but you need to turn on use_client_protocol_v1_by_default
option in the configuration of Centrifugo, see Centrifugo v4 migration guide for details).
This release adopts a new iteration of Centrifugal protocol and a new iteration of API. Client now behaves according to the client SDK API specification. The work has been done according to Centrifugo v4 roadmap.
Check out Centrifugo v4 release post that covers the reasoning behind changes.
All the current core features of Centrifugal client protocol are now supported here.
New release only works with Centrifugo >= v4.0.0 and Centrifuge >= 0.25.0. See Centrifugo v4 migration guide for details about the changes in the ecosystem.
Note, that Centrifugo v4 supports clients working over the previous protocol iteration, so you can update Centrifugo to v4 without any changes on the client side (but you need to turn on use_client_protocol_v1_by_default
option in the configuration of Centrifugo, see Centrifugo v4 migration guide for details).
Update to work with Centrifuge >= v0.18.0 and Centrifugo v3.
Breaking change: client History API behavior changed – Centrifuge >= v0.18.0 and Centrifugo >= v3.0.0 won't return all publications in a stream by default, see Centrifuge v0.18.0 release notes or Centrifugo v3 migration guide for more information and workaround on server-side. History call now accepts options. Example on how to mimic previous behavior:
HistoryOptions opts = new HistoryOptions.Builder().withLimit(-1).build();
subscription.history(opts, ...)
If you are using Centrifuge < v0.18.0 or Centrifugo v2 then default options will work the same way as before - i.e. return all publications in a history stream.
- Protocol definitions updated to the latest version
- Support for top-level
presence
,presenceStats
andhistory
methods - When working with Centrifugo v3 or Centrifuge >= v0.18.0 it's now possible to avoid using
?format=protobuf
in connection URL. Client will negotiate Protobuf protocol with a server using WebSocket subprotocol mechanism (in request headers).
- Add possibility to connect over proxy - #26
- attempt to fix JDK version problems
- Support message recovery
- Support server-side subscriptions
- Migrate to protobuf-javalite
- Pass exception to ErrorEvent
- Print stack trace in case of connect error
- Support RPC
method
field - #16
- add
Data
field forConnectEvent
- fix executing Subscription methods in Subscribed state - see #9
Change Subscription API a bit – users should first create new Subscription then manage it's lifecycle (subscribe, unsubscribe) until done with it. When done it's possible to remove subscription using Client.removeSubscription
method.
Initial release.