Skip to content

Commit 41e2e42

Browse files
authored
Merge pull request #7 from h3nrique/main
2 parents 6d2a1f4 + ebc1c04 commit 41e2e42

File tree

9 files changed

+39
-39
lines changed

9 files changed

+39
-39
lines changed

pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
<properties>
1212
<maven.compiler.source>11</maven.compiler.source>
1313
<maven.compiler.target>11</maven.compiler.target>
14-
<project.encoding>UTF-8</project.encoding>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<caffeine.version>3.1.8</caffeine.version>
1616
<junit.version>4.13.2</junit.version>
17-
<mysql-connector.version>8.0.33</mysql-connector.version>
18-
<okhttp.version>4.10.0</okhttp.version>
19-
<protobuf.version>3.22.2</protobuf.version>
20-
<testcontainers.version>1.17.6</testcontainers.version>
17+
<mysql-connector.version>8.4.0</mysql-connector.version>
18+
<okhttp.version>4.12.0</okhttp.version>
19+
<protobuf.version>4.26.1</protobuf.version>
20+
<testcontainers.version>1.19.8</testcontainers.version>
2121
</properties>
2222

2323
<dependencies>
@@ -110,9 +110,9 @@
110110
<artifactId>protobuf-maven-plugin</artifactId>
111111
<version>0.6.1</version>
112112
<configuration>
113-
<protocArtifact>com.google.protobuf:protoc:3.19.2:exe:${os.detected.classifier}</protocArtifact>
113+
<protocArtifact>com.google.protobuf:protoc:4.26.1:exe:${os.detected.classifier}</protocArtifact>
114114
<pluginId>grpc-java</pluginId>
115-
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.47.0:exe:${os.detected.classifier}</pluginArtifact>
115+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.64.0:exe:${os.detected.classifier}</pluginArtifact>
116116
</configuration>
117117
<executions>
118118
<execution>

src/main/java/io/eigr/spawn/api/ActorRef.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.github.benmanes.caffeine.cache.Cache;
44
import com.google.protobuf.Any;
55
import com.google.protobuf.Empty;
6-
import com.google.protobuf.GeneratedMessageV3;
6+
import com.google.protobuf.GeneratedMessage;
77
import io.eigr.functions.protocol.Protocol;
88
import io.eigr.functions.protocol.actors.ActorOuterClass;
99
import io.eigr.spawn.api.exceptions.ActorCreationException;
@@ -104,7 +104,7 @@ protected static void spawnAllActors(List<ActorOuterClass.ActorId> actorIds, Spa
104104
* @return an Optional containing, or not, the response object to the Action call
105105
* @since 0.0.1
106106
*/
107-
public <T extends GeneratedMessageV3> Optional<T> invoke(String action, Class<T> outputType) throws ActorInvocationException {
107+
public <T extends GeneratedMessage> Optional<T> invoke(String action, Class<T> outputType) throws ActorInvocationException {
108108
Optional<T> res = invokeActor(action, Empty.getDefaultInstance(), outputType, Optional.empty());
109109
return res.map(outputType::cast);
110110

@@ -122,7 +122,7 @@ public <T extends GeneratedMessageV3> Optional<T> invoke(String action, Class<T>
122122
* @return an Optional containing, or not, the response object to the Action call
123123
* @since 0.0.1
124124
*/
125-
public <T extends GeneratedMessageV3> Optional<T> invoke(String action, Class<T> outputType, InvocationOpts opts) throws ActorInvocationException {
125+
public <T extends GeneratedMessage> Optional<T> invoke(String action, Class<T> outputType, InvocationOpts opts) throws ActorInvocationException {
126126
Optional<T> res = invokeActor(action, Empty.getDefaultInstance(), outputType, Optional.ofNullable(opts));
127127
return res.map(outputType::cast);
128128

@@ -139,7 +139,7 @@ public <T extends GeneratedMessageV3> Optional<T> invoke(String action, Class<T>
139139
* @return an Optional containing, or not, the response object to the Action call
140140
* @since 0.0.1
141141
*/
142-
public <T extends GeneratedMessageV3, S extends GeneratedMessageV3> Optional<T> invoke(String action, S value, Class<T> outputType) throws ActorInvocationException {
142+
public <T extends GeneratedMessage, S extends GeneratedMessage> Optional<T> invoke(String action, S value, Class<T> outputType) throws ActorInvocationException {
143143
Optional<T> res = invokeActor(action, value, outputType, Optional.empty());
144144
return res.map(outputType::cast);
145145

@@ -158,7 +158,7 @@ public <T extends GeneratedMessageV3, S extends GeneratedMessageV3> Optional<T>
158158
* @return an Optional containing, or not, the response object to the Action call
159159
* @since 0.0.1
160160
*/
161-
public <T extends GeneratedMessageV3, S extends GeneratedMessageV3> Optional<T> invoke(String action, S value, Class<T> outputType, InvocationOpts opts) throws ActorInvocationException {
161+
public <T extends GeneratedMessage, S extends GeneratedMessage> Optional<T> invoke(String action, S value, Class<T> outputType, InvocationOpts opts) throws ActorInvocationException {
162162
Optional<T> res = invokeActor(action, value, outputType, Optional.ofNullable(opts));
163163
return res.map(outputType::cast);
164164

@@ -172,7 +172,7 @@ public <T extends GeneratedMessageV3, S extends GeneratedMessageV3> Optional<T>
172172
* @param action name of the action to be called.
173173
* @since 0.0.1
174174
*/
175-
public <T extends GeneratedMessageV3> void invokeAsync(String action) throws ActorInvocationException {
175+
public <T extends GeneratedMessage> void invokeAsync(String action) throws ActorInvocationException {
176176
InvocationOpts opts = InvocationOpts.builder().async(true).build();
177177
invokeActor(action, Empty.getDefaultInstance(), null, Optional.of(opts));
178178
}
@@ -187,7 +187,7 @@ public <T extends GeneratedMessageV3> void invokeAsync(String action) throws Act
187187
* Please see the {@link io.eigr.spawn.api.InvocationOpts} class for more information
188188
* @since 0.0.1
189189
*/
190-
public <T extends GeneratedMessageV3> void invokeAsync(String action, InvocationOpts opts) throws ActorInvocationException {
190+
public <T extends GeneratedMessage> void invokeAsync(String action, InvocationOpts opts) throws ActorInvocationException {
191191
InvocationOpts mergedOpts = InvocationOpts.builder()
192192
.async(true)
193193
.delaySeconds(opts.getDelaySeconds())
@@ -207,7 +207,7 @@ public <T extends GeneratedMessageV3> void invokeAsync(String action, Invocation
207207
* @param value the action argument object.
208208
* @since 0.0.1
209209
*/
210-
public <T extends GeneratedMessageV3> void invokeAsync(String action, T value) throws ActorInvocationException {
210+
public <T extends GeneratedMessage> void invokeAsync(String action, T value) throws ActorInvocationException {
211211
InvocationOpts opts = InvocationOpts.builder().async(true).build();
212212
invokeActorAsync(action, value, Optional.of(opts));
213213
}
@@ -223,7 +223,7 @@ public <T extends GeneratedMessageV3> void invokeAsync(String action, T value) t
223223
* Please see the {@link io.eigr.spawn.api.InvocationOpts} class for more information
224224
* @since 0.0.1
225225
*/
226-
public <T extends GeneratedMessageV3> void invokeAsync(String action, T value, InvocationOpts opts) throws ActorInvocationException {
226+
public <T extends GeneratedMessage> void invokeAsync(String action, T value, InvocationOpts opts) throws ActorInvocationException {
227227
InvocationOpts mergedOpts = InvocationOpts.builder()
228228
.async(true)
229229
.delaySeconds(opts.getDelaySeconds())
@@ -258,7 +258,7 @@ public boolean isUnNamedActor() {
258258
return false;
259259
}
260260

261-
private <T extends GeneratedMessageV3, S extends GeneratedMessageV3> Optional<T> invokeActor(
261+
private <T extends GeneratedMessage, S extends GeneratedMessage> Optional<T> invokeActor(
262262
String cmd, S argument, Class<T> outputType, Optional<InvocationOpts> options) throws ActorInvocationException {
263263
Objects.requireNonNull(this.actorId, "ActorId cannot be null");
264264

@@ -318,7 +318,7 @@ private <T extends GeneratedMessageV3, S extends GeneratedMessageV3> Optional<T>
318318
return Optional.empty();
319319
}
320320

321-
private <T extends GeneratedMessageV3, S extends GeneratedMessageV3> void invokeActorAsync(
321+
private <T extends GeneratedMessage, S extends GeneratedMessage> void invokeActorAsync(
322322
String cmd, S argument, Optional<InvocationOpts> options) {
323323
Objects.requireNonNull(this.actorId, "ActorId cannot be null");
324324

src/main/java/io/eigr/spawn/api/actors/Value.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.eigr.spawn.api.actors;
22

3-
import com.google.protobuf.GeneratedMessageV3;
3+
import com.google.protobuf.GeneratedMessage;
44
import io.eigr.spawn.api.actors.workflows.Broadcast;
55
import io.eigr.spawn.api.actors.workflows.Forward;
66
import io.eigr.spawn.api.actors.workflows.Pipe;
@@ -57,11 +57,11 @@ public static Value at() {
5757
return new Value();
5858
}
5959

60-
public <R extends GeneratedMessageV3> R getResponse() {
60+
public <R extends GeneratedMessage> R getResponse() {
6161
return (R) response;
6262
}
6363

64-
public <S extends GeneratedMessageV3> S getState() {
64+
public <S extends GeneratedMessage> S getState() {
6565
return (S) state;
6666
}
6767

@@ -89,17 +89,17 @@ public ResponseType getType() {
8989
return type;
9090
}
9191

92-
public <R extends GeneratedMessageV3> Value response(R value) {
92+
public <R extends GeneratedMessage> Value response(R value) {
9393
this.response = value;
9494
return this;
9595
}
9696

97-
public <S extends GeneratedMessageV3> Value state(S state) {
97+
public <S extends GeneratedMessage> Value state(S state) {
9898
this.state = state;
9999
return this;
100100
}
101101

102-
public <S extends GeneratedMessageV3> Value state(S state, boolean checkpoint) {
102+
public <S extends GeneratedMessage> Value state(S state, boolean checkpoint) {
103103
this.state = state;
104104
this.checkpoint = checkpoint;
105105
return this;

src/main/java/io/eigr/spawn/api/actors/annotations/stateful/StatefulNamedActor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.eigr.spawn.api.actors.annotations.stateful;
22

3-
import com.google.protobuf.GeneratedMessageV3;
3+
import com.google.protobuf.GeneratedMessage;
44

55
import java.lang.annotation.ElementType;
66
import java.lang.annotation.Retention;
@@ -14,7 +14,7 @@
1414

1515
String name() default "";
1616

17-
Class<? extends GeneratedMessageV3> stateType();
17+
Class<? extends GeneratedMessage> stateType();
1818

1919
long deactivatedTimeout() default 60000;
2020

src/main/java/io/eigr/spawn/api/actors/annotations/stateful/StatefulPooledActor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.eigr.spawn.api.actors.annotations.stateful;
22

3-
import com.google.protobuf.GeneratedMessageV3;
3+
import com.google.protobuf.GeneratedMessage;
44

55
import java.lang.annotation.ElementType;
66
import java.lang.annotation.Retention;
@@ -14,7 +14,7 @@
1414

1515
String name() default "";
1616

17-
Class<? extends GeneratedMessageV3> stateType();
17+
Class<? extends GeneratedMessage> stateType();
1818

1919
long deactivatedTimeout() default 60000;
2020

src/main/java/io/eigr/spawn/api/actors/annotations/stateful/StatefulUnNamedActor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.eigr.spawn.api.actors.annotations.stateful;
22

3-
import com.google.protobuf.GeneratedMessageV3;
3+
import com.google.protobuf.GeneratedMessage;
44

55
import java.lang.annotation.ElementType;
66
import java.lang.annotation.Retention;
@@ -14,7 +14,7 @@
1414

1515
String name() default "";
1616

17-
Class<? extends GeneratedMessageV3> stateType();
17+
Class<? extends GeneratedMessage> stateType();
1818

1919
long deactivatedTimeout() default 60000;
2020

src/main/java/io/eigr/spawn/api/actors/workflows/Broadcast.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package io.eigr.spawn.api.actors.workflows;
22

33
import com.google.protobuf.Any;
4-
import com.google.protobuf.GeneratedMessageV3;
4+
import com.google.protobuf.GeneratedMessage;
55
import io.eigr.functions.protocol.Protocol;
66
import org.jetbrains.annotations.NotNull;
77

88
import java.util.Objects;
99
import java.util.Optional;
1010

11-
public final class Broadcast<T extends GeneratedMessageV3> {
11+
public final class Broadcast<T extends GeneratedMessage> {
1212

1313
private final Optional<String> channel;
1414
private final Optional<String> action;
@@ -21,12 +21,12 @@ private Broadcast(Optional<String> channel, Optional<String> action, T payload)
2121
}
2222

2323
@NotNull
24-
public static <T extends GeneratedMessageV3> Broadcast to(String channel, String action, T payload) {
24+
public static <T extends GeneratedMessage> Broadcast to(String channel, String action, T payload) {
2525
return new Broadcast<T>(Optional.of(channel), Optional.of(action), payload);
2626
}
2727

2828
@NotNull
29-
public static <T extends GeneratedMessageV3> Broadcast to(String channel, T payload) {
29+
public static <T extends GeneratedMessage> Broadcast to(String channel, T payload) {
3030
return new Broadcast<T>(Optional.ofNullable(channel), Optional.empty(), payload);
3131
}
3232

src/main/java/io/eigr/spawn/api/actors/workflows/SideEffect.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.eigr.spawn.api.actors.workflows;
22

33
import com.google.protobuf.Any;
4-
import com.google.protobuf.GeneratedMessageV3;
4+
import com.google.protobuf.GeneratedMessage;
55
import io.eigr.functions.protocol.Protocol;
66
import io.eigr.functions.protocol.actors.ActorOuterClass;
77
import io.eigr.spawn.api.InvocationOpts;
@@ -11,7 +11,7 @@
1111
import java.util.Optional;
1212
import java.util.StringJoiner;
1313

14-
public final class SideEffect<T extends GeneratedMessageV3> {
14+
public final class SideEffect<T extends GeneratedMessage> {
1515

1616
private final ActorRef actor;
1717
private final String command;
@@ -32,11 +32,11 @@ private SideEffect(ActorRef actor, String command, T payload, InvocationOpts opt
3232
this.opts = Optional.of(opts);
3333
}
3434

35-
public static <T extends GeneratedMessageV3> SideEffect to(ActorRef actor, String command, T payload) {
35+
public static <T extends GeneratedMessage> SideEffect to(ActorRef actor, String command, T payload) {
3636
return new SideEffect(actor, command, payload);
3737
}
3838

39-
public static <T extends GeneratedMessageV3> SideEffect to(ActorRef actor, String command, T payload, InvocationOpts opts) {
39+
public static <T extends GeneratedMessage> SideEffect to(ActorRef actor, String command, T payload, InvocationOpts opts) {
4040
return new SideEffect(actor, command, payload, opts);
4141
}
4242

src/main/java/io/eigr/spawn/internal/transport/server/ActorServiceHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private Protocol.ActorInvocationResponse handleRequest(HttpExchange exchange) th
8383
Any value = actorInvocationRequest.getValue();
8484

8585
Optional<Value> maybeValueResponse = callAction(system, actor, parent, commandName, value, context);
86-
log.info("Actor {} return ActorInvocationResponse for command {}. Result value: {}",
86+
log.debug("Actor {} return ActorInvocationResponse for command {}. Result value: {}",
8787
actor, commandName, maybeValueResponse);
8888

8989
if (maybeValueResponse.isPresent()) {

0 commit comments

Comments
 (0)