diff --git a/internal/driver/subscriptionrequest.go b/internal/driver/subscriptionrequest.go index 72a6f4e8..4e355487 100644 --- a/internal/driver/subscriptionrequest.go +++ b/internal/driver/subscriptionrequest.go @@ -93,10 +93,11 @@ func newSubscriptionRequest(attributes map[string]interface{}, requestData []byt messageLimit, ok := attributes[DefaultMessageLimit] if request.MessageLimit == nil && ok { - val, err := strconv.Atoi(fmt.Sprint(messageLimit)) + val64, err := strconv.ParseInt(fmt.Sprint(messageLimit), 10, 32) if err != nil { return nil, errors.NewCommonEdgeX(errors.KindServerError, fmt.Sprintf("failed to parse the request attribute '%s'", DefaultMessageLimit), err) } + val := int(val64) request.MessageLimit = &val } return request, nil