apache / pekko

Build highly concurrent, distributed, and resilient message-driven applications using Java/Scala
https://pekko.apache.org/
Apache License 2.0
1.17k stars 139 forks source link

Feature request:Add missing java api for `StreamTestKit` #970

Closed He-Pin closed 4 months ago

He-Pin commented 7 months ago

Motivation: Currently there are some methods are missing in the StreamTestkit for javadsl. And which is very annoying when you implement a GraphStage in Java and test it in pure Java.

I think this task is easy if anyone else in the community want to take a try. otherwise I would like to prepare this this weekend, because I coding in java everyday.

Result: More friendly for Java end users.

naosense commented 7 months ago

I checked the java version of StreamTestKit and it is quite different from the scala version. As much as I want to help, but I don't know how to get started, can you give me more detailed instructions?

He-Pin commented 7 months ago

@naosense Thanks for intreast this.

Screenshot_20240118_180539_GitHub.jpg

This one, you will see there are many scala methods don't have related crossesbanding java api.

naosense commented 7 months ago

As it was said in the WeChat group, should I change FiniteDuration to java.time.Duration, or add some equalent methods with java.time.Duration?

mdedetrich commented 7 months ago

As it was said in the WeChat group, should I change FiniteDuration to java.time.Duration, or add some equalent methods with java.time.Duration?

@naosense Yes you should, other parts of the javaapi for pekko-streams use java.time.Duration

He-Pin commented 7 months ago

I was on meeting, you should keep the method the same, but adopt the Scala type to Java native type.

He-Pin commented 7 months ago

@naosense You can take a look at https://github.com/apache/incubator-pekko/blob/main/CONTRIBUTING.md#java-apis-in-pekko for the type mapping, hope you have a nice ride, and thank you.

naosense commented 7 months ago

I created a PR, but I don't have permission to add a reviewer, please take a look when you have time @He-Pin

mdedetrich commented 7 months ago

I created a PR, but I don't have permission to add a reviewer, please take a look when you have time @He-Pin

Done