Skip to content

Commit 6d2a1f4

Browse files
committed
Better debug message
1 parent 2bec117 commit 6d2a1f4

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ The second thing we have to do is add the spawn dependency to the project.
9494
<dependency>
9595
<groupId>com.github.eigr</groupId>
9696
<artifactId>spawn-java-std-sdk</artifactId>
97-
<version>v1.2.6</version>
97+
<version>v1.2.7</version>
9898
</dependency>
9999
```
100100
We're also going to configure a few things for our application build to work, including compiling the protobuf files.
@@ -128,7 +128,7 @@ See below a full example of the pom.xml file:
128128
<dependency>
129129
<groupId>com.github.eigr</groupId>
130130
<artifactId>spawn-java-std-sdk</artifactId>
131-
<version>v1.2.6</version>
131+
<version>v1.2.7</version>
132132
</dependency>
133133
<dependency>
134134
<groupId>ch.qos.logback</groupId>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>io.eigr.spawn</groupId>
55
<artifactId>spawn-java-std-sdk</artifactId>
66
<packaging>jar</packaging>
7-
<version>1.2.6</version>
7+
<version>1.2.7</version>
88
<name>spawn-java-std-sdk</name>
99
<url>http://maven.apache.org</url>
1010

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

+8-5
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
import io.eigr.functions.protocol.Protocol;
1010
import io.eigr.functions.protocol.actors.ActorOuterClass.ActorId;
1111
import io.eigr.spawn.api.Spawn;
12-
import io.eigr.spawn.api.actors.Value;
1312
import io.eigr.spawn.api.actors.ActorContext;
1413
import io.eigr.spawn.api.actors.ActorFactory;
14+
import io.eigr.spawn.api.actors.Value;
1515
import io.eigr.spawn.api.actors.workflows.SideEffect;
1616
import io.eigr.spawn.api.exceptions.ActorInvocationException;
17-
import io.eigr.spawn.api.extensions.SimpleDependencyInjector;
1817
import io.eigr.spawn.internal.Entity;
1918
import org.slf4j.Logger;
2019
import org.slf4j.LoggerFactory;
@@ -97,9 +96,9 @@ private Protocol.ActorInvocationResponse handleRequest(HttpExchange exchange) th
9796
}
9897

9998
Any encodedValue;
100-
if (Objects.isNull(valueResponse.getResponse())){
99+
if (Objects.isNull(valueResponse.getResponse())) {
101100
encodedValue = Any.pack(Protocol.Noop.getDefaultInstance());
102-
}else {
101+
} else {
103102
encodedValue = Any.pack(valueResponse.getResponse());
104103
}
105104

@@ -150,7 +149,11 @@ private Optional<Value> callAction(String system, String actor, String parent, S
150149

151150
ActorContext actorContext;
152151
if (context.hasState()) {
153-
Object state = context.getState().unpack(entity.getStateType());
152+
Any anyCtxState = context.getState();
153+
log.debug("[{}] trying to get the state of the Actor {}. Parse Any type {} from State type {}",
154+
system, actor, anyCtxState, entity.getStateType().getSimpleName());
155+
156+
Object state = anyCtxState.unpack(entity.getStateType());
154157
actorContext = new ActorContext(this.spawn, state);
155158
} else {
156159
actorContext = new ActorContext(this.spawn);

0 commit comments

Comments
 (0)