diff --git a/uri.go b/uri.go index fbfa45b..6abfa7d 100644 --- a/uri.go +++ b/uri.go @@ -46,7 +46,7 @@ type URI struct { AuthMechanism []string Heartbeat int ConnectionTimeout int - ChannelMax int + ChannelMax uint16 } // ParseURI attempts to parse the given AMQP URI according to the spec. @@ -162,11 +162,11 @@ func ParseURI(uri string) (URI, error) { } if params.Has("channel_max") { - value, err := strconv.Atoi(params.Get("channel_max")) + value, err := strconv.ParseUint(params.Get("channel_max"), 10, 16) if err != nil { return builder, fmt.Errorf("connection_timeout is not an integer: %v", err) } - builder.ChannelMax = value + builder.ChannelMax = uint16(value) } return builder, nil