Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue42 Remove references to coordinator endpoints from the LRAClient API #68

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,14 @@ public interface LRAClient {
String LRA_HTTP_RECOVERY_HEADER = "Long-Running-Action-Recovery";

/**
* Key for looking up the config property that specifies which host a
* coordinator is running on
* The config property that specifies a URL exposed for LRA orchestration and management
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the intent to document this property properly in issue #62 (Interoperability: Clients running on different MP platforms need to know how to start and end an LRA). If so will you add a note to the issue description and a link to issue #62 .

Copy link
Member Author

Choose a reason for hiding this comment

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

will do. However, for the javadoc is this sufficient? Please see my comment in the PR - #68 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

This bit of config is so that the TCK knows when the implementation has recovered. We briefly discussed this yesterday ("Are we going to specify recovery semantics in the spec? ")

We said that we would propose and SPI that implementations would implement in order to pass the TCK. In the LRA hangout a week last Monday I proposed something like:

public ManagementSPI {
LRAInfo getStatus(LRA lra); // get status of one LRA
Collection<LRAInfo> getLRAs(CompensatorStatus status); // list LRAs in the given state
//anything else
}

So to get recovering LRAs the status would be set to Completing or Compensating.

This would mean we would not need to configure the endpoint in the TCK.

String LRA_COORDINATOR_HOST_KEY = "lra.http.host";

/**
* Key for looking up the config property that specifies which port a
* coordinator is running on
*/
String LRA_COORDINATOR_PORT_KEY = "lra.http.port";

/**
* Key for looking up the config property that specifies which JAX-RS path a
* coordinator is running on
*/
String LRA_COORDINATOR_PATH_KEY = "lra.coordinator.path";

/**
* Key for looking up the config property that specifies which JAX-RS path a
* recovery coordinator is running on
*/
String LRA_RECOVERY_HOST_KEY = "lra.http.recovery.host";

/**
* Key for looking up the config property that specifies which JAX-RS path a
* recovery coordinator is running on
*/
String LRA_RECOVERY_PORT_KEY = "lra.http.recovery.port";

String LRA_HTTP_URL = "lra.http.url";

/**
* Key for looking up the config property that specifies which JAX-RS path a
* recovery coordinator is running on
* The config property that specifies a URL exposed for the LRA recovery semantics
*/
String LRA_RECOVERY_PATH_KEY = "lra.coordinator.recovery.path";
String LRA_RECOVERY_URL= "lra.http.recovery.url";

/**
* Explicitly dispose of all resources. After this call the instance may no
Expand Down
11 changes: 2 additions & 9 deletions tck/src/main/java/org/eclipse/microprofile/lra/tck/TckTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
import java.util.List;
import java.util.stream.IntStream;

import static org.eclipse.microprofile.lra.client.LRAClient.LRA_COORDINATOR_HOST_KEY;
import static org.eclipse.microprofile.lra.client.LRAClient.LRA_COORDINATOR_PORT_KEY;
import static org.eclipse.microprofile.lra.client.LRAClient.LRA_RECOVERY_PATH_KEY;
import static org.eclipse.microprofile.lra.client.LRAClient.LRA_RECOVERY_URL;
import static org.eclipse.microprofile.lra.tck.participant.api.ActivityController.ACCEPT_WORK;
import static org.eclipse.microprofile.lra.tck.participant.api.ActivityController.ACTIVITIES_PATH;

Expand Down Expand Up @@ -121,13 +119,8 @@ private static void initTck(LRAClient lraClient) {
}

int servicePort = Integer.getInteger("service.http.port", TEST_SWARM_PORT);
// TODO issue 42 will be removing these endpoint references
String rcHost = System.getProperty(LRA_COORDINATOR_HOST_KEY, "localhost");
String rcPath = System.getProperty(LRA_RECOVERY_PATH_KEY, "lra-recovery-coordinator");
int rcPort = Integer.getInteger(LRA_COORDINATOR_PORT_KEY, COORDINATOR_SWARM_PORT);

micrserviceBaseUrl = new URL(String.format("http://localhost:%d", servicePort));
rcBaseUrl = new URL(String.format("http://%s:%d/%s", rcHost, rcPort, rcPath));
rcBaseUrl = new URL(System.getProperty(LRA_RECOVERY_URL, "http://localhost:8080"));

msClient = ClientBuilder.newClient();
rcClient = ClientBuilder.newClient();
Expand Down