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

URL in AWS output is not interpolated #2434

Open
rtkkroland opened this issue Mar 22, 2024 · 5 comments
Open

URL in AWS output is not interpolated #2434

rtkkroland opened this issue Mar 22, 2024 · 5 comments
Labels
enhancement outputs Any tasks or issues relating specifically to outputs

Comments

@rtkkroland
Copy link

When trying to route messages based on metadata to different SQS endpoints, modifying the URL is the easiest, but it's the only field that's not interpolated :(

https://github.com/benthosdev/benthos/blame/34777e87934cba354219d803b32e26cfe565c930/internal/impl/aws/output_sqs.go#L39

This results in much sadness.

@krdenison
Copy link

krdenison commented Mar 22, 2024

Looking to do something like this in the url field where route is added to metadata by a previous processor and can be one of up to 20 values.

    output:
      aws_sqs:
        url: 'https://sqs.us-west-2.amazonaws.com/AWS_ACCOUNT/${! meta("route") }'
        max_in_flight: 64

@Jeffail
Copy link
Member

Jeffail commented Mar 25, 2024

Hey, this is technically possible as we can specify the URL per batch send request. However, one minor annoyance is that when you batch messages up (which is recommended for performance reasons) each individual message could yield a different URL, and so the logic and predictability of batch dispatching becomes much more complicated.

@Jeffail Jeffail added enhancement outputs Any tasks or issues relating specifically to outputs labels Mar 25, 2024
@rtkkroland
Copy link
Author

Would having URL determined per message be worse/better performance than using the switch output?

@mihaitodor
Copy link
Member

@rtkkroland: Not really. Just that the switch output requires that you to know the URLs when writing the config while interpolation allows you to extract the URL from each message at runtime. Benthos still has to extract some field from the message in each switch case to figure out which output to route the message to, so that will incur a similar performance penalty.

@rtkkroland
Copy link
Author

Awesome, let's do URL interpolation then! :D

  • Similar performance
  • Run-time configurable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement outputs Any tasks or issues relating specifically to outputs
Projects
None yet
Development

No branches or pull requests

4 participants