Skip to content

Commit 710492a

Browse files
authored
fix actor serialization (#441)
* substitute json encoder with serializer Signed-off-by: mikeee <[email protected]> * substitution for custom serializer Signed-off-by: mikeee <[email protected]> --------- Signed-off-by: mikeee <[email protected]>
1 parent ad25580 commit 710492a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

actor/manager/manager.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ package manager
1515

1616
import (
1717
"context"
18-
"encoding/json"
1918
"errors"
2019
"fmt"
2120
"log"
@@ -181,7 +180,7 @@ func (m *DefaultActorManagerContext) InvokeReminder(ctx context.Context, actorID
181180
return actorErr.ErrActorFactoryNotSet
182181
}
183182
reminderParams := &api.ActorReminderParams{}
184-
if err := json.Unmarshal(params, reminderParams); err != nil {
183+
if err := m.serializer.Unmarshal(params, reminderParams); err != nil {
185184
log.Printf("failed to unmarshal reminder param, err: %v ", err)
186185
return actorErr.ErrRemindersParamsInvalid
187186
}
@@ -204,7 +203,7 @@ func (m *DefaultActorManagerContext) InvokeTimer(ctx context.Context, actorID, t
204203
return actorErr.ErrActorFactoryNotSet
205204
}
206205
timerParams := &api.ActorTimerParam{}
207-
if err := json.Unmarshal(params, timerParams); err != nil {
206+
if err := m.serializer.Unmarshal(params, timerParams); err != nil {
208207
log.Printf("failed to unmarshal reminder param, err: %v ", err)
209208
return actorErr.ErrTimerParamsInvalid
210209
}

client/actor.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ package client
1515

1616
import (
1717
"context"
18-
"encoding/json"
1918
"errors"
2019
"fmt"
2120
"reflect"
@@ -400,7 +399,7 @@ func (c *GRPCClient) makeCallProxyFunction(actor actor.Client, methodName string
400399

401400
var data []byte
402401
if len(inIArr) > 0 {
403-
data, err = json.Marshal(inIArr[0])
402+
data, err = serializer.Marshal(inIArr[0])
404403
}
405404
if err != nil {
406405
panic(err)

0 commit comments

Comments
 (0)