Class: Falqon::CLI::Show

Inherits:
Base
  • Object
show all
Defined in:
lib/falqon/cli/show.rb

Overview

Display messages in a queue

Usage:

falqon show -q, --queue=QUEUE

Options:

-q, --queue=QUEUE                                           # Queue name
    [--pending], [--no-pending], [--skip-pending]           # Display pending messages (default)
    [--processing], [--no-processing], [--skip-processing]  # Display processing messages
    [--dead], [--no-dead], [--skip-dead]                    # Display dead messages
-d, [--data], [--no-data], [--skip-data]                    # Display raw data
-m, [--meta], [--no-meta], [--skip-meta]                    # Display additional metadata
    [--head=N]                                              # Display N messages from head of queue
    [--tail=N]                                              # Display N messages from tail of queue
    [--index=N]                                             # Display message at index N
    [--range=N M]                                           # Display messages at index N to M
    [--id=N]                                                # Display message with ID N

Examples:

Print all messages in the queue (by default only pending messages are displayed)

$ falqon show --queue jobs
id = 1 data = 8742 bytes

Display only pending messages

$ falqon show --queue jobs --pending
...

Display only processing messages

$ falqon show --queue jobs --processing
...

Display only scheduled messages

$ falqon show --queue jobs --scheduled
...

Display only dead messages

$ falqon show --queue jobs --dead
...

Display raw data

$ falqon show --queue jobs --data
{"id":1,"message":"Hello, world!"}

Display additional metadata

$ falqon show --queue jobs --meta
id = 1 retries = 0 created_at = 1970-01-01 00:00:00 +0000 updated_at = 1970-01-01 00:00:00 +0000 data = 8742 bytes

Display first 5 messages

$ falqon show --queue jobs --head 5
id = 1 data = 8742 bytes
id = 2 data = 8742 bytes
id = 3 data = 8742 bytes
id = 4 data = 8742 bytes
id = 5 data = 8742 bytes

Display last 5 messages

$ falqon show --queue jobs --tail 5
...

Display message at index 5

$ falqon show --queue jobs --index 3 --index 5
id = 3 data = 8742 bytes
id = 5 data = 8742 bytes

Display messages from index 5 to 10

$ falqon show --queue jobs --range 5 10
...

Display message with ID 5

$ falqon show --queue jobs --id 5 --id 1
id = 5 data = 8742 bytes
id = 1 data = 8742 bytes