Skip to content

Commit

Permalink
Revert "Assorted changes for new Java SDK (#213)"
Browse files Browse the repository at this point in the history
This reverts commit 28ded7c.
  • Loading branch information
slinkydeveloper authored Nov 20, 2024
1 parent 28ded7c commit 587c163
Show file tree
Hide file tree
Showing 39 changed files with 116 additions and 682 deletions.
4 changes: 2 additions & 2 deletions basics/basics-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {
mavenCentral()
}

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
annotationProcessor("dev.restate:sdk-api-gen:$restateVersion")
Expand All @@ -28,7 +28,7 @@ dependencies {
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1")

// Logging (optional)
implementation("org.apache.logging.log4j:log4j-core:2.24.1")
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
}

// Set main class
Expand Down
6 changes: 3 additions & 3 deletions basics/basics-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
mavenCentral()
}

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
// Annotation processor
Expand All @@ -22,10 +22,10 @@ dependencies {
implementation("dev.restate:sdk-http-vertx:$restateVersion")

// Logging (optional)
implementation("org.apache.logging.log4j:log4j-core:2.24.1")
implementation("org.apache.logging.log4j:log4j-core:2.23.0")

// Kotlinx serialization (optional)
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2")
}

// Setup Java/Kotlin compiler target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
mavenCentral()
}

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
// Restate SDK
Expand All @@ -31,7 +31,7 @@ dependencies {
implementation("org.apache.kafka:kafka-clients:3.6.1")

// Logging (optional)
implementation("org.apache.logging.log4j:log4j-core:2.24.1")
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
}

// Set main class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
mavenCentral()
}

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
// Kafka
Expand All @@ -24,7 +24,7 @@ dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.2")

// Logging (optional)
implementation("org.apache.logging.log4j:log4j-core:2.24.1")
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {

repositories { mavenCentral() }

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
// Restate SDK
Expand All @@ -18,7 +18,7 @@ dependencies {
implementation("org.apache.kafka:kafka-clients:3.6.1")

// Logging (optional)
implementation("org.apache.logging.log4j:log4j-core:2.24.1")
implementation("org.apache.logging.log4j:log4j-core:2.23.0")
}

// Set main class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

repositories { mavenCentral() }

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
// Kafka
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = "1.0.0"
val restateVersion = "1.1.0"

kotlin {
jvmToolchain(17)
jvmToolchain(11)
}

dependencies {
Expand All @@ -24,7 +24,7 @@ dependencies {
implementation("dev.restate:sdk-api-kotlin:$restateVersion")
implementation("dev.restate:sdk-http-vertx:$restateVersion")

implementation("org.apache.logging.log4j:log4j-core:2.24.1")
implementation("org.apache.logging.log4j:log4j-core:2.23.0")
}

application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kotlin {

jvm()

jvmToolchain(17)
jvmToolchain(11)

sourceSets {
commonMain.dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {
mavenCentral()
}

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
annotationProcessor("dev.restate:sdk-api-gen:$restateVersion")
Expand All @@ -31,7 +31,7 @@ dependencies {
implementation("com.google.code.gson:gson:2.10.1")

// Logging (optional)
implementation("org.apache.logging.log4j:log4j-core:2.24.1")
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
}

// Set main class
Expand Down
8 changes: 5 additions & 3 deletions patterns-use-cases/integrations/java-spring/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
group = "dev.restate.examples"
version = "0.0.1-SNAPSHOT"

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

java {
toolchain {
Expand All @@ -31,13 +31,15 @@ dependencies {
implementation("org.springframework.boot", "spring-boot-starter-data-jpa")

// Restate SDK
implementation("dev.restate:sdk-spring-boot-starter:$restateVersion")
implementation("dev.restate:sdk-api:$restateVersion")
implementation("dev.restate:sdk-http-vertx:$restateVersion")
// To use Jackson to read/write state entries (optional)
implementation("dev.restate:sdk-serde-jackson:$restateVersion")

implementation("org.postgresql", "postgresql")

// Logging (optional)
implementation("org.apache.logging.log4j:log4j-core:2.24.1")
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
}

// Set main class
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package dev.restate.examples;

import dev.restate.sdk.springboot.EnableRestate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@EnableRestate
public class AppMain {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@
import dev.restate.sdk.common.Serde;
import dev.restate.sdk.common.TerminalException;
import dev.restate.sdk.serde.jackson.JacksonSerdes;
import dev.restate.sdk.springboot.RestateVirtualObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@RestateVirtualObject
@Component
@VirtualObject
public class ProductService {

private static final Serde<Product> productSerde = JacksonSerdes.of(Product.class);
@Autowired private ProductRepository productRepository;

private final ProductRepository productRepository;

public ProductService(ProductRepository productRepository) {
this.productRepository = productRepository;
}
private Serde<Product> productSerde = JacksonSerdes.of(Product.class);

@Handler
public Product getProductInformation(ObjectContext ctx) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package dev.restate.examples;

import dev.restate.sdk.http.vertx.RestateHttpEndpointBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class RestateEndpoint implements ApplicationRunner {

@Autowired private ProductService productService;

@Override
public void run(ApplicationArguments args) throws Exception {
RestateHttpEndpointBuilder.builder().bind(productService).buildAndListen();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
mavenCentral()
}

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
annotationProcessor("dev.restate:sdk-api-gen:$restateVersion")
Expand Down
4 changes: 2 additions & 2 deletions patterns-use-cases/sagas/sagas-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {
mavenCentral()
}

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
annotationProcessor("dev.restate:sdk-api-gen:$restateVersion")
Expand All @@ -21,5 +21,5 @@ dependencies {
implementation("dev.restate:sdk-serde-jackson:$restateVersion")

// Logging (optional)
implementation("org.apache.logging.log4j:log4j-core:2.24.1")
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
}
6 changes: 3 additions & 3 deletions patterns-use-cases/sagas/sagas-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
mavenCentral()
}

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
// Annotation processor
Expand All @@ -22,10 +22,10 @@ dependencies {
implementation("dev.restate:sdk-http-vertx:$restateVersion")

// Logging (optional)
implementation("org.apache.logging.log4j:log4j-core:2.24.1")
implementation("org.apache.logging.log4j:log4j-core:2.23.0")

// Kotlinx serialization (optional)
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2")
}

// Setup Java/Kotlin compiler target
Expand Down
6 changes: 0 additions & 6 deletions templates/java-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,3 @@
Sample project configuration of a Restate service using the Java SDK and HTTP server.

Have a look at the [Java Quickstart guide](https://docs.restate.dev/get_started/quickstart?sdk=java) for more information on how to use this project.

To run:

```shell
./gradlew run
```
12 changes: 2 additions & 10 deletions templates/java-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {
mavenCentral()
}

val restateVersion = "1.2.0"
val restateVersion = "1.1.1"

dependencies {
annotationProcessor("dev.restate:sdk-api-gen:$restateVersion")
Expand All @@ -21,18 +21,10 @@ dependencies {
implementation("dev.restate:sdk-serde-jackson:$restateVersion")

// Logging (optional)
implementation("org.apache.logging.log4j:log4j-core:2.24.1")

testImplementation(platform("org.junit:junit-bom:5.11.3"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("dev.restate:sdk-testing:$restateVersion")
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
}

// Set main class
application {
mainClass.set("my.example.Greeter")
}

tasks.named<Test>("test") {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Greeter {

@Handler
public String greet(Context ctx, String greeting) {
return "Hello " + greeting;
return greeting;
}

public static void main(String[] args) {
Expand Down
34 changes: 0 additions & 34 deletions templates/java-gradle/src/test/java/my/example/GreeterTest.java

This file was deleted.

2 changes: 1 addition & 1 deletion templates/java-maven-quarkus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<quarkus.platform.version>3.15.1</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.3.1</surefire-plugin.version>
<restate.version>1.2.0</restate.version>
<restate.version>1.1.1</restate.version>
</properties>

<dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion templates/java-maven-spring-boot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Have a look at the [Java Quickstart guide](https://docs.restate.dev/get_started/
To start the service, simply run:

```shell
$ mvn compile spring-boot:run
$ mvn spring-boot:run
```
Loading

0 comments on commit 587c163

Please sign in to comment.