Skip to content

Commit

Permalink
Better debug message
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriano Santos committed Nov 14, 2023
1 parent 2bec117 commit 6d2a1f4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ The second thing we have to do is add the spawn dependency to the project.
<dependency>
<groupId>com.github.eigr</groupId>
<artifactId>spawn-java-std-sdk</artifactId>
<version>v1.2.6</version>
<version>v1.2.7</version>
</dependency>
```
We're also going to configure a few things for our application build to work, including compiling the protobuf files.
Expand Down Expand Up @@ -128,7 +128,7 @@ See below a full example of the pom.xml file:
<dependency>
<groupId>com.github.eigr</groupId>
<artifactId>spawn-java-std-sdk</artifactId>
<version>v1.2.6</version>
<version>v1.2.7</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>io.eigr.spawn</groupId>
<artifactId>spawn-java-std-sdk</artifactId>
<packaging>jar</packaging>
<version>1.2.6</version>
<version>1.2.7</version>
<name>spawn-java-std-sdk</name>
<url>http://maven.apache.org</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
import io.eigr.functions.protocol.Protocol;
import io.eigr.functions.protocol.actors.ActorOuterClass.ActorId;
import io.eigr.spawn.api.Spawn;
import io.eigr.spawn.api.actors.Value;
import io.eigr.spawn.api.actors.ActorContext;
import io.eigr.spawn.api.actors.ActorFactory;
import io.eigr.spawn.api.actors.Value;
import io.eigr.spawn.api.actors.workflows.SideEffect;
import io.eigr.spawn.api.exceptions.ActorInvocationException;
import io.eigr.spawn.api.extensions.SimpleDependencyInjector;
import io.eigr.spawn.internal.Entity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -97,9 +96,9 @@ private Protocol.ActorInvocationResponse handleRequest(HttpExchange exchange) th
}

Any encodedValue;
if (Objects.isNull(valueResponse.getResponse())){
if (Objects.isNull(valueResponse.getResponse())) {
encodedValue = Any.pack(Protocol.Noop.getDefaultInstance());
}else {
} else {
encodedValue = Any.pack(valueResponse.getResponse());
}

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

ActorContext actorContext;
if (context.hasState()) {
Object state = context.getState().unpack(entity.getStateType());
Any anyCtxState = context.getState();
log.debug("[{}] trying to get the state of the Actor {}. Parse Any type {} from State type {}",
system, actor, anyCtxState, entity.getStateType().getSimpleName());

Object state = anyCtxState.unpack(entity.getStateType());
actorContext = new ActorContext(this.spawn, state);
} else {
actorContext = new ActorContext(this.spawn);
Expand Down

0 comments on commit 6d2a1f4

Please sign in to comment.