Skip to content

All commands taking a message body should optionally accept it via STDIN #1461

@ktarplee

Description

@ktarplee

Proposed change

For example, nats request only accepts the body of the request via a command line argument. This means that for larger message sizes this is not viable. getconf ARG_MAX on my system is 1MB on other systems it ranges from 100kB to 2MB. The default maximum message size for NATS is 1MB. Due to some systems limiting the maximum number of bytes in the command line (ARG_MAX) to around 100kB this means that the command + flags + subject + request_body must be less than that. The effect is that the NATS CLI cannot be reliably used to send larger messages (even within the 1MB limit). If someone desires to bump up the 1MB limit in nats-server then the CLI is entirely unusable.

Some nats commands do support STDIN to get the message body. I am simply arguing that all commands accepting a body should support STDIN (in addition to a regular command line argument).

Use case

I have scripts that use the nats CLI for testing purposes and would like it to be feature complete.

Contribution

I have seen some discussion in the issues wavering on which way the NATS CLI should go from a design perspective. It seems like those need to be ironed out first before this issue is tackled. For example, this feature was implemented in the past version but then was removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalEnhancement idea or proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions