Closed sammy007 closed 2 months ago
How did you run into this error? Using JetStream in some way?
How did you run into this error? Using JetStream in some way?
I am using stream in my app and normal messages as well, currently I am trying to find where the bug in my app is :)
It would be really helpful to know which API call causes this, and see some snippet.
can you share the stream info of the stream?
you can also setup your own nats.ErrorHandler to override the default one to try to peek further at the json error
Well, it is not a stream. In a json encoded connection Publish
where I put a struct which contains [][]*SomeStruct as a field.
The struct is:
type A struct {
.. SKIPPED ...
B [][]*C
}
json: cannot unmarshal object into Go struct field A.B of type []*mypackage.C on connection [193] for subscription on "mySub"
The receiver is:
_, err = s.nec.BindRecvChan("mySub", mySubCh)
Will dig further tomorrow
mySubCh chan A
_, err = s.nec.BindRecvChan("mySub", mySubCh)
So this is the issue. No idea why it can't deserialize such structure. The structure is nothing special and serializes correctly.
Simlar to #245 it seems, but in my case I am just using normal two dimensional array.
Well, should be a separate issue anyway.
Observed behavior
nats.go logs unmarshal errors using built in log
Expected behavior
It should not log itself, return error instead which caller will log the way it prefers.
Server and client version
1.36
Host environment
No response
Steps to reproduce
No response