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

Update to Multilang Daemon to support StreamArn #1143

Merged
merged 16 commits into from
Jun 26, 2023

Conversation

pelaezryan
Copy link
Contributor

@pelaezryan pelaezryan commented Jun 15, 2023

*Extension of PR 1141 - Moved from branch to fork

Description of changes:

  1. Updated multilang daemon to support 'streamArn' being passed in via Properties
    • Validation to ensure Arn is properly structured.
  2. streamName is parsed out if 'streamArn' is passed in.
    • Meaning streamArn takes precedence if it is passed in
  3. Added unit test to verify stream Arn is working as expected
  4. Removed unused imports

==========================================================================================
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Ryan Pelaez added 3 commits June 14, 2023 16:46
@pelaezryan pelaezryan added the v2.x Issues related to the 2.x version label Jun 15, 2023
@pelaezryan pelaezryan requested a review from lucienlu-aws June 15, 2023 01:20
@pelaezryan pelaezryan self-assigned this Jun 15, 2023
@pelaezryan pelaezryan requested a review from stair-aws June 20, 2023 15:42
Comment on lines 97 to 100
@Test(expected = IllegalArgumentException.class)
public void testConstructorFailsBecauseStreamArnIsInvalid2() throws Exception {
setup("", "arn:aws:kinesis:us-east-2:ACCOUNT_ID:BadFormatting:stream/" + TEST_STREAM_NAME_IN_ARN, TEST_REGION);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: Parameterized would eliminate boilerplate for these similar tests.

No change needed.

Copy link
Contributor

@stair-aws stair-aws left a comment

Choose a reason for hiding this comment

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

LGTM. Recommend enhancing the KinesisClientLibConfigurator to clearly communicate when the Cx-provided configuration stomps on its own stream name.


}

Validate.notBlank(configuration.getStreamName(), "Stream name or Stream Arn is required. Stream Arn takes precedence if both are passed in.");
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for attempt at signaling "Stream Arn takes precedence ..."

However, this validation message only surfaces if the stream name is blank. Perhaps there should be a log.warn(...) -- circa ~79, before configuration.setStreamName(...) -- that warns of the name-stomping if-and-only-if a provided stream name is about to be overridden by the stream from the ARN.

assertNotNull(deamonConfig.getRecordProcessorFactory());

assertEquals(EXE, deamonConfig.getRecordProcessorFactory().getCommandArray()[0]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we only interested in the 0th element (and if so, why?), or should this compare the full array? Example:

assertEquals(new String[] { EXE }, dC.getRPF().getCA());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.x Issues related to the 2.x version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants