Skip to content

Conversation

@graytaylor0
Copy link
Member

@graytaylor0 graytaylor0 commented Feb 4, 2026

Description

The SQS sink has default values that are invalid and throw an InvalidPluginConfigurationException. The combination of defaults with codec ndjson and threshold.max_events_per_message at 25 are invalid together.

Changing the require codec makes it more clear to users what codec is being used and aligns more closely with other data prepper plugins, and does not throw unexpected validation exceptions from defaults.

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Taylor Gray <tylgry@amazon.com>
@graytaylor0 graytaylor0 changed the title Change default codec for sqs sink from ndjson to json, fix validation Remove default codec and require codec for sqs sink Feb 4, 2026
} else {
codecPluginSettings = new PluginSetting("ndjson", Map.of());
String codecPluginName = codecConfiguration.getPluginName();
if (!codecPluginName.equals("json") && !codecPluginName.equals("ndjson")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should allow for other codecs. I think the only time we want to be restrictive on the codec is when the customer is not using batching (ie. max_events_per_batch == 1). In that case, ndjson should be the only permissible codec.

Customers may want to serialize in Ion, XML, or other codecs.

@AssertTrue(message = "ndjson codec doesn't support max events per message greater than 1")
boolean isValidCodecConfig() {
if ((codec == null || codec.getPluginName().equals("ndjson")) && thresholdConfig.getMaxEventsPerMessage() > 1)
if ((codec != null && codec.getPluginName().equals("ndjson")) && thresholdConfig.getMaxEventsPerMessage() > 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think it is acceptable to use ndjson with more than one event per message.

I think this is the key condition we want to return false or invalid for.

if ((codec != null && !codec.getPluginName().equals("ndjson")) && thresholdConfig.getMaxEventsPerMessage() == 1)

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

Successfully merging this pull request may close these issues.

2 participants