Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Conversation

@debasishg
Copy link
Contributor

This PR contains the following:

  1. No more default serdes through config. Hence implementation is completely type safe - any missing instances of Serialized, Consumed, Produced or Joined is flagged as a compile time error.
  2. If the user wishes, she can use the default serdes through config with the Java APIs. The Scala object can be converted to the underlying unsafe Java object through the inner wrapped object.
  3. Implicits for all primitive serdes are now available in a singleton Scala object - DefaultSerdes. Hence a single import DefaultSerdes._ will bring all of them into scope. Please check the README for details.
  4. The tests now include an example based on Avro based serdes (as per suggestion of Guozhang). The implementation of the Avro serializer is based on avro4s and is adopted from the Openshine implementation. But the principle is same as above - just declare an implicit for the AvroSerde and use it throughout the Kafka Streams application.
  5. Updated README.
Copy link

@blublinsky blublinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much simpler, making code nicer

Copy link

@seglo seglo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Not only the serdes, but `DefaultSerdes` also brings into scope implicit `Serialized`, `Produced`, `Consumed` and `Joined` instances. So all APIs that accept `Serialized`, `Produced`, `Consumed` or `Joined` will get these instances automatically with an `import DefaultSerdes._`.

### Examples
Just one import of `DefaultSerdes._` and the following code does not need a bit of `Serialized`, `Produced`, `Consumed` or `Joined` to be specified explicitly or through the default config. **And the best part is that for any missing instances of these you get a compilation error.** ..
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include the import in the example to make it more obvious?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure .. will do ..

algebird % "test",
chill % "test"
chill % "test",
avro4s % "test"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making sure that no dependencies tagged as test are published the central repo because of this line in build.sbt publishArtifact in Test := false ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do u think we should do ? Should we publish them in the repo ? This issue #56 is still open and it asks for this.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't think it makes sense to publish them. I think directing people from the README to the tests path in the repository is good enough. I just wanted to confirm that these deps don't get sucked up and pollute downstream projects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also thought so .. @seglo - could u pls comment on that issue #56 where the person is asking for this.

@debasishg debasishg merged commit 74aabcd into develop Mar 13, 2018
@debasishg debasishg deleted the no-config-serde branch March 13, 2018 02:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants