Centrifugo v1.3.0 Release Notes

  • ๐Ÿ‘€ Possible backwards incompatibility here (in client side code) - see first point.

    • omit fields in message JSON if field contains empty value: client on top level, info on top level, default_info in info object, channel_info in info object. This also affects top level data in join/leave messages and presence data โ€“ i.e. default_info and channel_info keys not included in JSON when empty. This can require adapting your client side code a bit if you rely on these keys but for most cases this should not affect your application. But we strongly suggest to test before updating. This change allows to reduce message size. See migration notes below for more details.
    • ๐Ÿ†• new option --admin_port to bind admin websocket and web interface to separate port. #44
    • ๐Ÿ†• new option --api_port to bind API endpoint to separate port. #44
    • ๐ŸŒ new option --insecure_web to use web interface without setting web_password and web_secret (for use in development or when you protected web interface by firewall rules). #44
    • โฌ‡๏ธ new channel option history_drop_inactive to drastically reduce resource usage (engine memory, messages travelling around) when you use message history. See #50
    • new Redis engine option --redis_api_num_shards. This option sets a number of Redis shard queues Centrifugo will use in addition to standard centrifugo.api queue. This allows to increase amount of messages you can publish into Centrifugo and preserve message order in channels. See #52 and documentation for more details.
    • ๐Ÿ›  fix race condition resulting in client disconnections on high channel subscribe/unsubscribe rate. #54
    • refactor last_event_id related stuff to prevent memory leaks on large amount of channels. #48
    • send special disconnect message to client when we don't want it to reconnect to Centrifugo (at moment to client sending malformed message).
    • pong wait handler for raw websocket to detect non responding clients.

    โšก๏ธ Also it's recommended to update javascipt client to latest version as it has some useful changes (see its changelog).

    How to migrate

    Message before:

    {
        "uid":"442586d4-688c-4a0d-52ad-d0a13d201dfc",
        "timestamp":"1450817253",
        "info": null,
        "channel":"$public:chat",
        "data":{"input":"1"},
        "client":""
    }
    

    Message now:

    {
        "uid":"442586d4-688c-4a0d-52ad-d0a13d201dfc",
        "timestamp":"1450817253",
        "channel":"$public:chat",
        "data":{"input":"1"},
    }
    

    I.e. not using empty client and info keys. If those keys are non empty then they present in message.

    Join message before:

    {
        "user":"2694",
        "client":"93615872-4e45-4da2-4733-55c955133436",
        "default_info": null,
        "channel_info":null
    }
    

    Join message now:

    {
        "user":"2694",
        "client":"93615872-4e45-4da2-4733-55c955133436"
    }
    

    If "default_info" or "channel_info" exist then they would be included:

    {
        "user":"2694",
        "client":"93615872-4e45-4da2-4733-55c955133436",
        "default_info": {"username": "FZambia"},
        "channel_info": {"extra": "some data here"}
    }