Skip to content

Commafeed starter - #171

Merged
arcuri82 merged 5 commits into
developfrom
commafeed-starter
Aug 21, 2026
Merged

Commafeed starter#171
arcuri82 merged 5 commits into
developfrom
commafeed-starter

Conversation

@omursahin

Copy link
Copy Markdown
Collaborator

No description provided.

@omursahin
omursahin requested a review from arcuri82 August 17, 2026 06:45
Comment thread .gitignore
/jdk_21_maven/cs/rest/person-controller/target/
/jdk_21_maven/em/embedded/rest/person-controller/target/
/jdk_21_maven/em/external/rest/person-controller/target/
/jdk_25_maven/em/external/rest/commafeed/target/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what about the the target folders of the API itself?

// Quarkus.run() blocks until shutdown, so it needs its own thread.
Thread thread = new Thread(() -> Quarkus.run(), "quarkus-sut");
thread.setDaemon(true);
thread.start();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

are we sure the thread will be killed when needed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Quarkus.blockingExit() kills that thread.


@Override
public void stopSut() {
Quarkus.blockingExit();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

will this stop/interrupt the manually started thread above?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes, I tested it.

try (ServerSocket socket = new ServerSocket(0)) {
socket.setReuseAddress(true);
return socket.getLocalPort();
} catch (IOException e) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how is this working? aren't you opening a port here? and then that would be no longer free? also, even if close it, might take a while before OS makes it available again... doesn't Quarkus have a system to dirctly bind on 0 and retrieve what chose by it? (like Spring)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I found a better way to start, but after starting sut, I had to use reflections to get the port number.

Liveness of the thread we started is NOT a usable signal: Quarkus.run() hands the
application over to its own "Quarkus Main Thread" and returns immediately. Poll the port.
*/
private void waitUntilListening() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

these seem very general functionality. if those indeed needed here, we should rather put them under client-java/controller, and call it here as library

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I updated my approach so that we no longer need this function.

@omursahin
omursahin requested a review from arcuri82 August 21, 2026 07:32
@arcuri82
arcuri82 merged commit 3820660 into develop Aug 21, 2026
25 checks passed
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