Skip to content

added typed stateful helloworld and docs/.../server/walkthrough#702

Merged
pjfanning merged 7 commits into
apache:mainfrom
kazuf3:feature/typedhelloworld-for-typed-actor
May 18, 2026
Merged

added typed stateful helloworld and docs/.../server/walkthrough#702
pjfanning merged 7 commits into
apache:mainfrom
kazuf3:feature/typedhelloworld-for-typed-actor

Conversation

@kazuf3
Copy link
Copy Markdown
Contributor

@kazuf3 kazuf3 commented May 18, 2026

See #699 and #698


Scala
: @@snip [GreeterServiceImpl.scala](/plugin-tester-scala/src/main/scala/example/myapp/statefulhelloworld/GreeterServiceImpl.scala) { #stateful-service }
: @@snip [GreeterServiceImpl.scala](/plugin-tester-scala/src/main/scala/example/myapp/typedhelloworld/GreeterServiceImpl.scala) { #stateful-service }
Copy link
Copy Markdown
Member

@pjfanning pjfanning May 18, 2026

Choose a reason for hiding this comment

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

Could you revert these changes and add new paragraphs that link to the typed version?

@kazuf3
Copy link
Copy Markdown
Contributor Author

kazuf3 commented May 18, 2026

@pjfanning

Yes, I will do so.
In the new paragraph, I will add explanation for typed actor specific.

Also in this case, I have to write the Java version of using typed actors, right?
Since I'm not very confident about that part, may I ask for detailed review for java version code?

@pjfanning
Copy link
Copy Markdown
Member

@pjfanning

Yes, I will do so. In the new paragraph, I will add explanation for typed actor specific.

Also in this case, I have to write the Java version of using typed actors, right? Since I'm not very confident about that part, may I ask for detailed review for java version code?

Sure. The java code can be based on copy pasting the existing stateful java sample and modifying with similar changes that you made with the scala one.

private final ActorSystem system;
private final ActorRef<GreeterActor.GreetingCommand> greeterActor;

public GreeterServiceImpl(ActorSystem system, ActorRef<GreeterActor.GreetingCommand> greeterActor) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@pjfanning I'm not very sure about this change. Instead of spawning the actor from root ActorSystem inside of service, let parent layer, possibly the server, to generate one from ActorContext and provide to the service.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My thought is that's better for testing, especially with ActorTestKit.

@kazuf3
Copy link
Copy Markdown
Contributor Author

kazuf3 commented May 18, 2026

Still need to figure out issues on paradox and mvn test

@kazuf3
Copy link
Copy Markdown
Contributor Author

kazuf3 commented May 18, 2026

All 4 tests (Format, Gradle, Maven, Paradox) passed locally.

Comment thread plugin-tester-scala/build.gradle Outdated
@kazuf3
Copy link
Copy Markdown
Contributor Author

kazuf3 commented May 18, 2026

I see. It's my bad, I forgot test these two in plugin-tester-scala.

Copy link
Copy Markdown
Member

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

lgtm

@pjfanning pjfanning merged commit 1788983 into apache:main May 18, 2026
14 checks passed
@pjfanning pjfanning mentioned this pull request May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants