Github user tzulitai commented on a diff in the pull request: https://github.com/apache/flink/pull/5171#discussion_r158164454 --- Diff: flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/util/AWSUtil.java --- @@ -30,37 +30,44 @@ import com.amazonaws.auth.EnvironmentVariableCredentialsProvider; import com.amazonaws.auth.SystemPropertiesCredentialsProvider; import com.amazonaws.auth.profile.ProfileCredentialsProvider; -import com.amazonaws.regions.Region; +import com.amazonaws.client.builder.AwsClientBuilder; import com.amazonaws.regions.Regions; -import com.amazonaws.services.kinesis.AmazonKinesisClient; +import com.amazonaws.services.kinesis.AmazonKinesis; +import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder; import java.util.Properties; /** * Some utilities specific to Amazon Web Service. */ public class AWSUtil { + /** Used for formatting Flink-specific user agent string when creating Kinesis client. */ + private static final String USER_AGENT_FORMAT = "Apache Flink %s (%s) Kinesis Connector"; /** - * Creates an Amazon Kinesis Client. + * Creates an AmazonKinesis client. * @param configProps configuration properties containing the access key, secret key, and region - * @return a new Amazon Kinesis Client + * @return a new AmazonKinesis client */ - public static AmazonKinesisClient createKinesisClient(Properties configProps) { + public static AmazonKinesis createKinesisClient(Properties configProps) { // set a Flink-specific user agent - ClientConfiguration awsClientConfig = new ClientConfigurationFactory().getConfig(); - awsClientConfig.setUserAgent("Apache Flink " + EnvironmentInformation.getVersion() + - " (" + EnvironmentInformation.getRevisionInformation().commitId + ") Kinesis Connector"); + ClientConfiguration awsClientConfig = new ClientConfigurationFactory().getConfig() + .withUserAgentPrefix(String.format(USER_AGENT_FORMAT, --- End diff -- To my understanding, switching from setUserAgent to withUserAgentPrefix will result in different user agent strings, right? Though I think internally the setUserAgent method is directly forwarding to withUserAgentPrefix anyways ... No objection on this, just curious.
---