A CLI for diffent kinds of message queues.
Go to file
finga 2a8488f7a8 Add manpage
The manpage gets also installed with the debian package.
2021-06-26 23:11:57 +02:00
.gitea/issue_template Issue templates for gitea 2021-06-20 18:16:19 +02:00
src Fix readme and clap help 2021-06-26 23:10:11 +02:00
.gitignore Initial commit 2021-06-14 03:05:23 +02:00
Cargo.lock Receive message(s) from a queue 2021-06-20 16:35:18 +02:00
Cargo.toml Add manpage 2021-06-26 23:11:57 +02:00
mqrs.1 Add manpage 2021-06-26 23:11:57 +02:00
README.md Fix readme and clap help 2021-06-26 23:10:11 +02:00

mqrs

mqrs is a small cli application to handle POSIX message queues.

Installation

To build mqrs a rust toolchain is necessary.

Install Rust

Install the Rust toolchain from rustup.rs.

Build mqrs

mqrs can be built for development:

cargo b

or for releasing:

cargo b --release

Build the mqrs Debian package

cargo deb

Install mqrs

When a Rust toolchain installed you can also install mqrs directly without cloning it manually:

cargo install --git https://git.onders.org/finga/mqrs.git mqrs

or from within the project:

cargo install mqrs

Run mqrs

mqrs can either be run from the project directory with:

cargo b

or you can copy the produced binary somewhere else or link to them from target/{debug,release}/mqrs depending on which one you built.

Using mqrs

mqrs supports five commands: create, info, unlink, send and recv. All commands do not have to be specified fully. If the command is clearly distinguishable from all the others, it does not have to be completed further.

Create a message queue

Use the create command to create a new POSIX message queue. Following optional arguments are supported:

  • -c, --capacity: Maximum number of messages in the queue
  • -p, --permissions: Permissions (octal) to create the queue with
  • -s, --msgsize: Message size in bytes

Print information about a message queue

Use the info command to print further information about a message queue.

Delete a message queue

Use the unlink command to delete a message queue.

Send a message to a queue

Use the send command to send a message to a message queue. Following optional arguments are supported:

  • -n, --non-blocking: Do not block
  • -d, --deadline <deadline>: Deadline until messages are sent (format: %Y-%m-%d %H:%M:%S)
  • -p, --priority <priority>: Use priority PRIO, PRIO >= 0 [default: 0]
  • -o, --timeout <timeout>: Timeout in <timeout>[s] (default) or <timeout>ms

Receive a message from a queue

Use the recv command to receive one or more messages from a message queue. Following optional arguments are supported:

  • -f, --follow: Print messages as they are received
  • -n, --non-blocking: Do not block
  • -t, --timestamp: Print a timestamp before each message
  • -d, --deadline <deadline>: Deadline until messages are received (format: %Y-%m-%d %H:%M:%S)
  • -o, --timeout <timeout>: Timeout in <timeout>[s] (default) or <timeout>ms