Connect Kotlin Versions Save

The Kotlin implementation of Connect: Protobuf RPC that works.

v0.6.1

1 month ago

Protobuf Major Release

Release v0.6.1 requires the latest major release (4.x) of the com.google.protobuf runtime library and updates generated code to require the new version of the library. See https://protobuf.dev/support/cross-version-runtime-guarantee/#major for more details on the Protobuf release policy and https://protobuf.dev/news/2023-12-05/ for documentation on changes to the Java runtime library.

Users wishing to remain on the previous major release (3.x) should use v0.5.1.

What's Changed

API Improvements

  • The ConnectException constructor changed signature slightly in #248 (callers must use .withErrorDetails to specify error details).

Other changes

  • Update to to conformance suite v1.0.1 and fixes numerous bugs identified by conformance tests by @jhump in #248, #252, and #253

Full Changelog: https://github.com/connectrpc/connect-kotlin/compare/v0.6.0...v0.6.1

v0.5.1

1 month ago

What's Changed

API Improvements

  • The ConnectException constructor changed signature slightly in #248 (callers must use .withErrorDetails to specify error details).

Other changes

  • Update to to conformance suite v1.0.1 and fixes numerous bugs identified by conformance tests by @jhump in #248, #252, and #253

Full Changelog: https://github.com/connectrpc/connect-kotlin/compare/v0.5.0...v0.5.1

v0.6.0

2 months ago

Protobuf Major Release

Release v0.6.0 updates connect-kotlin to the latest major release (4.26.0) of the com.google.protobuf runtime library and updates generated code to require the new version of the library. See https://protobuf.dev/support/cross-version-runtime-guarantee/#major for more details on the Protobuf release policy and https://protobuf.dev/news/2023-12-05/ for documentation on changes to the Java runtime library.

Users are recommended to regenerate code with Protobuf 26.0 or later.

What's Changed

Enhancements

Full Changelog: https://github.com/connectrpc/connect-kotlin/compare/v0.5.0...v0.6.0

v0.5.0

2 months ago

Release v0.5.0 includes numerous fixes so that connect-kotlin now passes many test cases in the Connect conformance suite that failed with the previous release. It also includes some clean-up of some of the APIs (and internal implementation) which are not backwards-compatible, but should only require minor changes to user code. See the "API Updates" section below for a list of all changed APIs.

What's Changed

API Improvements

These include some API changes which may require modification to user programs.

  • Some cleanup in the HTTP request representations by @jhump in #211
  • Denormalize "Code" and further simplification of HTTP interfaces by @jhump in #224
    • This is likely the greatest impact to user code. See the "API Updates" for com.connectrpc.Code and com.connectrpc.ResponseMessage below for more details.
  • Simplify UnaryBlockingCall by @jhump in #225

Enhancements

  • Client-only and server-only streaming RPCs can now be used with HTTP 1.1 connections (previously required HTTP/2) by @jhump in #196, #210
  • Support for auto-dispatching potentially blocking operations to I/O coroutine context by @jhump in #218

Bugfixes

  • Fixes to bugs in unary RPCs that were revealed by conformance tests by @jhump in #193
  • Fixes to bugs in stream RPCs that were revealed by conformance tests by @jhump in #210

Other changes

  • Adds new conformance/client module by @jhump in #182, #194, #195, #196, #212, #213, #217, and #226
  • Fix android deprecation warning by @pkwarren in #204

New Contributors

  • @akshayjshah made their first contribution in #229

API Updates

com.connectrpc.BidirectionalStreamInterface

  • methods sendClose and receiveClose are now suspend methods

com.connectrpc.ClientOnlyStreamInterface

  • method sendClose is now a suspend method
  • adds new method: suspend fun cancel(), to cancel operation w/out completing it

com.connectrpc.ServerOnlyStreamInterface

  • method receiveClose is now a suspend method

com.connectrpc.Code

  • removes enum constant OK
    • An operation is now determined to be successful by lack of an exception, instead of having an OK code
  • method fromValue(Int?):Code changed to return nullable Code?; an input value of zero returns null

com.connectrpc.UnaryFunction

  • requestFunction now accepts a UnaryHTTPRequest instead of HTTPRequest

com.connectrpc.ResponseMessage

  • removed code property
    • Success concrete sub-type does not need a code: code is an error code and does not apply (was previously always OK)
    • Failure concrete sub-type now has only the code inside the cause: ConnectException property (the code property was redundant)
  • updated constructors for Success and Failure concrete sub-types to no longer accept code

com.connectrpc.StreamResult

  • changed cause property to be ConnectException? instead of Throwable?
    • calling code can use new com.connectrpc.asConnectException extension function to transform a Throwable into a ConnectException
  • removed code property
    • it was redundant with the code property of cause
  • update constructor to no longer accept code and to require ConnectException? for cause
  • fold is now an inline fun
  • maybeFold has been removed (trivial to accomplish the same thing with fold and nullable result type)

com.connectrpc.UnaryBlockingCall

  • now an interface, not a class
  • otherwise, same API except there is no constructor or factory function

com.connectrpc.http.HTTPClientInterface

  • method unary now accepts a UnaryHTTPRequest instead of HTTPRequest
  • method stream now accepts a duplex: Boolean parameter, indicating whether the operation needs to support full-duplex communication with the server (for bidirectional streams)

com.connectrpc.http.HTTPRequest

  • no longer has message or httpMethod properties
    • for stream operations, method was always "POST" and message was always null/not applicable
    • for unary operations, there is now a sub-class UnaryHTTPRequest which adds these two properties
  • constructor updated to no longer accept message or http method
  • clone method updated to no longer accept message or http method

com.connectrpc.http.HTTPResponse

  • added status: Int? property to indicate the numeric HTTP response code
  • removed code and tracingInfo properties
    • tracingInfo replaced by new status property
    • code is not needed; it is provided by code property of cause or inferred from new status property
  • constructor updated to accept status and no longer accept code and tracing info

com.connectrpc.http.Stream

  • now an interface, not a class
  • otherwise, same API except:
    • methods send, sendClose, and receiveClose are now suspend methods
    • isClosed method removed; use isReceiveClosed instead
  • there is also a Stream factory function with same signature as previous class constructor except that all three callbacks are now suspend functions

com.connectrpc.okhttp.ConnectOkHttpClient

  • updated to conform to changes to HTTPClientInterface

com.connectrpc.extensions.GoogleJavaJSONStrategy

  • added optional constructor parameter: registry: com.google.protobuf.TypeRegistry

com.connectrpc.extensions.GoogleJavaProtobufStrategy

  • added optional constructor parameter: registry: com.google.protobuf.ExtensionRegistryLite

com.connectrpc.extensions.GoogleJavaLiteProtobufStrategy

  • added optional constructor parameter: registry: com.google.protobuf.ExtensionRegistryLite

Full Changelog: https://github.com/connectrpc/connect-kotlin/compare/v0.4.0...v0.5.0

v0.4.0

5 months ago

What's Changed

Enhancements

  • Add support for accessing headers and trailers to streaming calls by @jhump in #171
  • Add method stream type to generated code by @pkwarren in #172

Bugfixes

  • Mark duplex streaming bodies as one shot by @pkwarren in #155
  • Fix URL resolution when base URI has non-empty path by @pkwarren in #173

Other changes

  • Add conformance tests for lite runtime by @pkwarren in #148
  • Upgrade Gradle to 8.5 by @pkwarren in #170

New Contributors

  • @jhump made their first contribution in #164

Full Changelog: https://github.com/connectrpc/connect-kotlin/compare/v0.3.1...v0.4.0

v0.3.1

6 months ago

What's Changed

Other changes

New Contributors

Full Changelog: https://github.com/connectrpc/connect-kotlin/compare/v0.3.0...v0.3.1

v0.3.0

7 months ago

Release v0.3.0 improves the streaming API for bidi and server streaming calls, renames ConnectError to ConnectException to match JVM conventions, and supports passing a separate OkHttp client for use in streaming calls.

What's Changed

API Improvements

Other changes

New Contributors

Full Changelog: https://github.com/connectrpc/connect-kotlin/compare/v0.2.0...v0.3.0

API Updates

com.connectrpc.http.HTTPResponse

  • error renamed to cause.

com.connectrpc.BidirectionalStreamInterface

  • resultChannel renamed to responseChannel. The channel now returns the response messages from the stream (canceling the channel with a ConnectException if an error occurs).

com.connectrpc.ClientOnlyStreamInterface

  • receiveAndClose now returns the response message instead of a message wrapped in the ResponseMessage type. The method will throw a ConnectException on error.

com.connectrpc.ConnectError

  • Renamed to ConnectException.
  • Changed to extend Exception instead of Throwable.

com.connectrpc.ResponseMessage.Failure

  • error renamed to cause.

com.connectrpc.ServerOnlyStreamInterface

  • resultChannel renamed to responseChannel. The channel now returns the response messages from the stream (canceling the channel with a ConnectException if an error occurs).

com.connectrpc.StreamResult.Complete

  • error renamed to cause.

v0.2.0

8 months ago

What's Changed

Release v0.2.0 fixes issues seen with streaming calls and addresses compatibility with gRPC servers.

Although connect-kotlin is still in alpha, we try to maintain compatibility between releases. Some of the fixes however required API changes, which are documented below.

Bugfixes

Other changes

Full Changelog: https://github.com/connectrpc/connect-kotlin/compare/v0.1.11...v0.2.0

API Updates

com.connectrpc.BidirectionalStreamInterface

Removed

  • close()
    • Use sendClose() instead. This may have confused callers that the close() method would close both send and receive sides of the connection when it was only closing the send side.

com.connectrpc.ClientOnlyStreamInterface

Added

  • sendClose()
    • This shouldn't typically need to be called as receiveAndClose() already closes the send side of the stream.
  • isSendClosed()

Changed

  • receiveAndClose()
    • Changed to return a ResponseMessage instead of a StreamResult. This allows callers to easily get access to the response as if they were calling a unary method. Previously, the StreamResult would only return the first result retrieved by the call, which typically was a Headers result (leaving callers unable to access the Message or Completion contents).

Removed

  • close()
    • Replaced with sendClose().

com.connectrpc.ServerOnlyStreamInterface

Added

  • receiveClose()
  • isReceiveClosed()

Removed

  • close()
    • This closed both the send and receive side of the stream (unlike in other interfaces which just closed the send side). If needed, callers should invoke receiveClose() instead (although this isn't necessary in normal use).
  • send()
    • Callers should invoke sendAndClose() instead. Otherwise, reading results from resultChannel() will hang since the send side of the stream should be closed before reading responses.

com.connectrpc.StreamResult

Removed

  • Removed the error field from the base StreamResult class. It was never used by the Headers or Message subclasses and only used on the Complete type. This should make it easier for callers to use Headers and Message types since they don't need to worry about handling error.

v0.1.11

8 months ago

What's Changed

This is the first release of Connect in the connectrpc GitHub organization. The package name has changed to com.connectrpc.

To update from the previous release, change the groupId from build.buf to com.connectrpc and the version to 0.1.11. The artifact names haven't changed.

To migrate to the new package name, a shell script is usually sufficient:

On Linux, or anywhere with GNU sed:

find . -type f \( -name "*.kt" -o -name "*.java" \) -exec sed -i 's|build.buf.connect|com.connectrpc|g' {} \;

On Mac, or anywhere with BSD sed:

find . -type f \( -name "*.kt" -o -name "*.java" \) -exec sed -i '' 's|build.buf.connect|com.connectrpc|g' {} \;

When you change your source code, you'll also need to switch to the version of protoc-gen-connect-kotlin in this repository. If you're using the Buf CLI with the buf.build/bufbuild/connect-kotlin remote plugin, switch to the buf.build/connectrpc/kotlin plugin.

We apologize for any inconvenience that this rename causes. We're doing this to prepare Connect for donation to a foundation, which will put it on a better footing for long-term maintenance by multiple stakeholders.

If you encounter any problems or have questions, please reach out to us by filing an issue or joining #connectrpc in the Gophers Slack.

New Contributors

Full Changelog: https://github.com/connectrpc/connect-kotlin/compare/v0.1.10...v0.1.11

v0.1.10

8 months ago

What's Changed

Enhancements

Other changes

New Contributors

Full Changelog: https://github.com/bufbuild/connect-kotlin/compare/v0.1.9...v0.1.10