-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
499 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 13 additions & 1 deletion
14
deployment/src/test/java/io/quarkus/temporal/client/test/TemporalClientDevModeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
quarkus.temporal.service.url=sw-staging.sellware.net:7233 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Test: | ||
executionTimeout: 60 |
14 changes: 7 additions & 7 deletions
14
...ion-tests/src/test/java/io/quarkus/temporal/client/it/NativeTemporalClientResourceIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package io.quarkus.temporal.client.it; | ||
|
||
import io.quarkus.test.junit.NativeImageTest; | ||
|
||
@NativeImageTest | ||
public class NativeTemporalClientResourceIT extends TemporalClientResourceTest { | ||
} | ||
//package io.quarkus.temporal.client.it; | ||
// | ||
//import io.quarkus.test.junit.NativeImageTest; | ||
// | ||
//@NativeImageTest | ||
//public class NativeTemporalClientResourceIT extends TemporalClientResourceTest { | ||
//} |
42 changes: 21 additions & 21 deletions
42
...gration-tests/src/test/java/io/quarkus/temporal/client/it/TemporalClientResourceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
package io.quarkus.temporal.client.it; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
@QuarkusTest | ||
public class TemporalClientResourceTest { | ||
|
||
@Test | ||
public void testHelloEndpoint() { | ||
given() | ||
.when().get("/temporal-client") | ||
.then() | ||
.statusCode(200) | ||
.body(is("Hello temporal-client")); | ||
} | ||
} | ||
//package io.quarkus.temporal.client.it; | ||
// | ||
//import static io.restassured.RestAssured.given; | ||
//import static org.hamcrest.Matchers.is; | ||
// | ||
//import org.junit.jupiter.api.Test; | ||
// | ||
//import io.quarkus.test.junit.QuarkusTest; | ||
// | ||
//@QuarkusTest | ||
//public class TemporalClientResourceTest { | ||
// | ||
// @Test | ||
// public void testHelloEndpoint() { | ||
// given() | ||
// .when().get("/temporal-client") | ||
// .then() | ||
// .statusCode(200) | ||
// .body(is("Hello temporal-client")); | ||
// } | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
runtime/src/main/java/io/quarkus/temporal/runtime/TemporalAbstractConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.quarkus.temporal.runtime; | ||
|
||
import io.temporal.client.WorkflowClient; | ||
import io.temporal.serviceclient.WorkflowServiceStubs; | ||
import io.temporal.serviceclient.WorkflowServiceStubsOptions; | ||
import javax.enterprise.context.ApplicationScoped; | ||
import javax.enterprise.inject.Produces; | ||
|
||
public class TemporalAbstractConfiguration { | ||
|
||
@Produces | ||
@ApplicationScoped | ||
public WorkflowClient workflowClient(TemporalServerBuildTimeConfig temporalServerBuildTimeConfig) { | ||
WorkflowServiceStubsOptions options = WorkflowServiceStubsOptions.newBuilder() | ||
.setTarget(temporalServerBuildTimeConfig.serviceUrl) | ||
.build(); | ||
|
||
WorkflowServiceStubs service = WorkflowServiceStubs.newInstance(options); | ||
return WorkflowClient.newInstance(service); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
runtime/src/main/java/io/quarkus/temporal/runtime/TemporalActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.quarkus.temporal.runtime; | ||
|
||
import io.temporal.activity.ActivityInterface; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@ActivityInterface | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface TemporalActivity { | ||
|
||
String name(); | ||
|
||
Class workflow(); | ||
} |
41 changes: 41 additions & 0 deletions
41
runtime/src/main/java/io/quarkus/temporal/runtime/TemporalRecorder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.quarkus.temporal.runtime; | ||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; | ||
import io.quarkus.runtime.RuntimeValue; | ||
import io.quarkus.runtime.annotations.Recorder; | ||
import io.quarkus.temporal.runtime.config.WorkflowConfig; | ||
import io.quarkus.temporal.runtime.config.WorkflowConfigurations; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Map; | ||
|
||
|
||
@Recorder | ||
public class TemporalRecorder { | ||
|
||
private static final String WORKFLOWS_FILE_CONFIG = "/Users/mac/quarkus-temporal-extension/integration-tests/src/main/resources/workflow.yml"; | ||
|
||
Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
WorkflowConfigurations workflowConfigurations = null; | ||
|
||
public RuntimeValue<WorkflowConfigurations> createWorkflowConfigs() { | ||
|
||
ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); | ||
Map<String, WorkflowConfig> configs = null; | ||
try { | ||
InputStream is = new FileInputStream(WORKFLOWS_FILE_CONFIG);//getClass().getResourceAsStream(WORKFLOWS_FILE_CONFIG); | ||
configs = mapper.readValue(is, new TypeReference<Map<String, WorkflowConfig>>() {}); | ||
return new RuntimeValue<>(new WorkflowConfigurations(configs)); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
return null; | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
runtime/src/main/java/io/quarkus/temporal/runtime/TemporalServerBuildTimeConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.quarkus.temporal.runtime; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
|
||
@ConfigRoot(name = "temporal", phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED) | ||
public class TemporalServerBuildTimeConfig { | ||
|
||
/** | ||
* Temporal service url | ||
*/ | ||
@ConfigItem(name="service.url") | ||
public String serviceUrl; | ||
} |
Oops, something went wrong.