connect
connect copied to clipboard
Redis processor fails with HGETALL
Hi, I was trying to use redid processor with command HGETALL to retrieve all the fields and values inside an hashset but the processor return always nothing (it prints a blank line in the log)
This is a sample test:
input:
generate:
count: 1
mapping: root = ""
pipeline:
processors:
- redis:
url: redis://localhost:6379
retries: 0
command: hgetall
args_mapping: root = ["demo:list:whitelist"]
- log:
message: ${! meta() }
- catch:
- log:
message: Not Found
and output is:
INFO Running main config from specified file @service=benthos benthos_version=4.24.0 path=whitelist.yaml
INFO Listening for HTTP requests at: http://0.0.0.0:4195 @service=benthos
INFO Launching a benthos instance, use CTRL+C to close @service=benthos
INFO {} @service=benthos label="" path=root.pipeline.processors.1
INFO Pipeline has terminated. Shutting down the service @service=benthos
From reds cli:
HGETALL demo:list:whitelist
1) "AA123BB"
2) "Car 1"
3) "CC456DD"
4) "Car 2"
5) "MPC7772"
6) "Volkswagen"
Using HGET command with key and field works as expected.
I am also facing the same issue with hgetall. The output is empty.
Is there any update on this issue? My current workaround is to use multiple GET commands but that is pretty ugly and doesn't scale very well.
@Statkern15 You can use lua script to execute hgetall command.
@Statkern15 You can use lua script to execute hgetall command.
that's and excellent workaround thank you.
I tracked down the issue to type limitations in https://github.com/benthosdev/benthos/blob/279e25b03b2207b19804213c851ec386076f43a6/public/service/message.go#L262 PR coming up in the next few days.