nats.io

jsAccountLimits::MaxBytesRequired is a bool ean, should it be int64_t?


The NATS C Client structure jsAccountInfo has a member Limits that holds a jsAccountLimits structure.

This structure in turn has a member MaxBytesRequired of which the datatype is a bool.

Shouldn't that member be define int64_t as are the other jsAccountInfo::Limits::... members?

I tried to give the boolean meaning, but i don't find any, hence it wonder if this is a declaration error.


Solution

  • I asked the question on the GitHub board of NATS C Client and the following answer was provided by the developing team:

    No, this is really a boolean. It is an account's limit that forces all streams to require a MaxBytes value to be set. In other word, if this boolean is enabled for the account limit and a stream is created without MaxBytes value, the stream creation will fail.

    Hence the name MaxBytesRequired must be read as: Do all streams need to be forced to have a MaxBytes value set.

    This is on an Account basis.