Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not continuously reading from stdin #1

Open
jackmead515 opened this issue Dec 7, 2021 · 2 comments
Open

Not continuously reading from stdin #1

jackmead515 opened this issue Dec 7, 2021 · 2 comments

Comments

@jackmead515
Copy link

Maybe I'm using it wrong. And forgive, I don't know much go. Trying to pair this up with https://github.com/cloudamqp/amqpcat and consume from a rabbitmq queue and pipe to an sqs queue like so:

amqpcat --consumer --uri=amqp://@127.0.0.1:5672 --queue=my-queue | sqscat test-queue

But it keeps failing for some reason?

2021/12/07 11:14:59 run() failed: bufio.Scanner: Read returned impossible count
Error writing file: Broken pipe

Can this tool not constantly read from stdin? Or does it only spin up a certain number of threads and then die? Any help would be appreciated thanks.

@ppai-plivo
Copy link
Collaborator

Can this tool not constantly read from stdin?

As you can see in examples, sqscat certainly reads constantly from stdin.

Or does it only spin up a certain number of threads and then die?

By default will continue to read indefinitely until it encounters an error or until it reaches EOF. Specifying -n will read exact specified number of entries before exiting.

Can you pipe the results of your first command to a file and confirm that there's newline as delimiter between items/entries? And also confirm the maximum size of each line.

@jackmead515
Copy link
Author

Absolutely confirmed that there is a new line terminator. amqpcat automatically does this by default.

I have also tried gstbuf -oL amqpcat ... to force a new line buffering activity yet without luck.

But you say that it will read until EOF and then die? The -n will just die after a certain number of lines? Or will it just push the lines to sqs once that count has been reached and then wait for the next batch from stdin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants