>:
25 |
26 | [source,xml]
27 | ----
28 |
29 | io.awspring.cloud
30 | spring-cloud-aws-modulith-events-sqs
31 |
32 | ----
33 |
34 | The logical routing key will be used as SQS message group id. When routing key is set, requires SQS queue to be configured as a FIFO queue.
35 |
--------------------------------------------------------------------------------
/license-header.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-$YEAR the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/AwsAsyncClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2024 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure;
17 |
18 | import software.amazon.awssdk.awscore.client.builder.AwsAsyncClientBuilder;
19 |
20 | /**
21 | * Callback interface that can be used to customize a {@link AwsAsyncClientBuilder}.
22 | *
23 | * It gets applied to every configured asynchronous AWS client bean.
24 | *
25 | * @author Maciej Walkowiak
26 | * @since 3.3.0
27 | */
28 | public interface AwsAsyncClientCustomizer {
29 | /**
30 | * Callback to customize a {@link AwsAsyncClientBuilder} instance.
31 | *
32 | * @param builder the client builder to customize
33 | */
34 | void customize(AwsAsyncClientBuilder, ?> builder);
35 | }
36 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/AwsClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2024 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure;
17 |
18 | import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder;
19 |
20 | /**
21 | * Base callback interface to be extended by customizers for specific AWS clients.
22 | *
23 | * @param - type of AWS client builder to customize
24 | * @author Maciej Walkowiak
25 | * @since 3.3.0
26 | */
27 | public interface AwsClientCustomizer> {
28 |
29 | /**
30 | * Callback to customize an instance of AWS client builder.
31 | *
32 | * @param builder the client builder to customize
33 | */
34 | void customize(T builder);
35 | }
36 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/AwsSyncClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2024 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure;
17 |
18 | import software.amazon.awssdk.awscore.client.builder.AwsSyncClientBuilder;
19 |
20 | /**
21 | * Callback interface that can be used to customize a {@link AwsSyncClientBuilder}.
22 | *
23 | * It gets applied to every configured synchronous AWS client bean.
24 | *
25 | * @author Maciej Walkowiak
26 | * @since 3.3.0
27 | */
28 | public interface AwsSyncClientCustomizer {
29 | /**
30 | * Callback to customize a {@link AwsSyncClientBuilder} instance.
31 | *
32 | * @param builder the client builder to customize
33 | */
34 | void customize(AwsSyncClientBuilder, ?> builder);
35 | }
36 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * {@link org.springframework.boot.context.config.ConfigDataLoader} implementations for AWS services.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.config;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/parameterstore/AwsParameterStoreClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.config.parameterstore;
17 |
18 | import io.awspring.cloud.autoconfigure.core.AwsClientCustomizer;
19 | import software.amazon.awssdk.services.ssm.SsmClientBuilder;
20 |
21 | /**
22 | * @deprecated use {@link SsmClientCustomizer}
23 | * @author Matej Nedic
24 | * @since 3.0.0
25 | */
26 | @Deprecated(since = "3.3.0", forRemoval = true)
27 | public interface AwsParameterStoreClientCustomizer extends AwsClientCustomizer {
28 | }
29 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/parameterstore/ParameterStoreKeysMissingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.config.parameterstore;
17 |
18 | /**
19 | * Thrown when configuration provided to ConfigDataLoader is missing parameter store keys, for example
20 | * `spring.config.import=aws-parameterstore:`.
21 | *
22 | * @author Maciej Walkowiak
23 | * @since 3.0.0
24 | */
25 | public class ParameterStoreKeysMissingException extends RuntimeException {
26 |
27 | ParameterStoreKeysMissingException(String message) {
28 | super(message);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/parameterstore/SsmClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.config.parameterstore;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
19 | import software.amazon.awssdk.services.ssm.SsmClientBuilder;
20 |
21 | /**
22 | * Callback interface that can be used to customize a {@link SsmClientBuilder}.
23 | *
24 | * @author Maciej Walkowiak
25 | * @since 3.3.0
26 | */
27 | @FunctionalInterface
28 | public interface SsmClientCustomizer extends AwsClientCustomizer {
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/parameterstore/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * {@link org.springframework.boot.context.config.ConfigDataLoader} implementation for AWS Parameter Store.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.config.parameterstore;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/reload/ReloadStrategy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.config.reload;
17 |
18 | /**
19 | * Configuration for reload strategies.
20 | *
21 | * Heavily inspired by Spring Cloud Kubernetes.
22 | *
23 | * @author Nicola Ferraro
24 | * @author Matej Nedic
25 | * @author Maciej Walkowiak
26 | */
27 | public enum ReloadStrategy {
28 | /**
29 | * Fire a refresh of beans annotated with @ConfigurationProperties or @RefreshScope.
30 | */
31 | REFRESH,
32 |
33 | /**
34 | * Restarts the Spring ApplicationContext to apply the new configuration.
35 | */
36 | RESTART_CONTEXT
37 | }
38 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/reload/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Common classes used for reloading configuration properties.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.config.reload;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/s3/S3KeysMissingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2023 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.config.s3;
17 |
18 | /**
19 | * Thrown when configuration provided to ConfigDataLoader is missing S3 keys, for example
20 | * `spring.config.import=aws-s3:`.
21 | *
22 | * @author Kunal Varpe
23 | * @since 3.3.0
24 | */
25 | public class S3KeysMissingException extends RuntimeException {
26 |
27 | public S3KeysMissingException(String message) {
28 | super(message);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/s3/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * {@link org.springframework.boot.context.config.ConfigDataLoader} implementation for AWS S3.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.config.s3;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/secretsmanager/AwsSecretsManagerClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.config.secretsmanager;
17 |
18 | import io.awspring.cloud.autoconfigure.core.AwsClientCustomizer;
19 | import software.amazon.awssdk.services.secretsmanager.SecretsManagerClientBuilder;
20 |
21 | /**
22 | * @deprecated use {@link SecretsManagerClientCustomizer}
23 | * @author Matej Nedic
24 | * @since 3.0.0
25 | */
26 | @Deprecated(since = "3.3.0", forRemoval = true)
27 | public interface AwsSecretsManagerClientCustomizer extends AwsClientCustomizer {
28 | }
29 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/secretsmanager/SecretsManagerClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.config.secretsmanager;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
19 | import software.amazon.awssdk.services.secretsmanager.SecretsManagerClientBuilder;
20 |
21 | /**
22 | * Callback interface that can be used to customize a {@link SecretsManagerClientBuilder}.
23 | *
24 | * @author Maciej Walkowiak
25 | * @since 3.3.0
26 | */
27 | @FunctionalInterface
28 | public interface SecretsManagerClientCustomizer extends AwsClientCustomizer {
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/secretsmanager/SecretsManagerKeysMissingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.config.secretsmanager;
17 |
18 | /**
19 | * Thrown when configuration provided to ConfigDataLoader is missing Secrets Manager keys, for example
20 | * `spring.config.import=aws-secretsmanager:`.
21 | *
22 | * @author Maciej Walkowiak
23 | * @since 3.0.0
24 | */
25 | public class SecretsManagerKeysMissingException extends RuntimeException {
26 |
27 | public SecretsManagerKeysMissingException(String message) {
28 | super(message);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/config/secretsmanager/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * {@link org.springframework.boot.context.config.ConfigDataLoader} implementation for AWS Secrets Manager.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.config.secretsmanager;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/core/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Auto-configurations for core Spring Cloud AWS components -
19 | * {@link software.amazon.awssdk.auth.credentials.AwsCredentialsProvider} and
20 | * {@link software.amazon.awssdk.regions.providers.AwsRegionProvider}.
21 | */
22 | @org.springframework.lang.NonNullApi
23 | @org.springframework.lang.NonNullFields
24 | package io.awspring.cloud.autoconfigure.core;
25 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/dynamodb/DynamoDbClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.dynamodb;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
19 | import software.amazon.awssdk.services.dynamodb.DynamoDbClientBuilder;
20 |
21 | /**
22 | * Callback interface that can be used to customize a {@link DynamoDbClientBuilder}.
23 | *
24 | * @author Maciej Walkowiak
25 | * @since 3.3.0
26 | */
27 | @FunctionalInterface
28 | public interface DynamoDbClientCustomizer extends AwsClientCustomizer {
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/dynamodb/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Auto-configuration for DynamoDB integration.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.dynamodb;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/imds/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Auto-configuration for IMDS (EC2 Instance MetaData Service) integration.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.imds;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/metrics/CloudWatchAsyncClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.metrics;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
19 | import software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClientBuilder;
20 |
21 | /**
22 | * Callback interface that can be used to customize a {@link CloudWatchAsyncClientBuilder}.
23 | *
24 | * @author Maciej Walkowiak
25 | * @since 3.3.0
26 | */
27 | @FunctionalInterface
28 | public interface CloudWatchAsyncClientCustomizer extends AwsClientCustomizer {
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/metrics/CloudWatchProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2019 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.metrics;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientProperties;
19 | import org.springframework.boot.context.properties.ConfigurationProperties;
20 |
21 | /**
22 | * {@link ConfigurationProperties} for configuring CloudWatch client.
23 | *
24 | * @author Jon Schneider
25 | * @author Dawid Kublik
26 | * @author Bernardo Martins
27 | * @author Eddú Meléndez
28 | * @since 2.0.0
29 | */
30 | @ConfigurationProperties(prefix = "spring.cloud.aws.cloudwatch")
31 | public class CloudWatchProperties extends AwsClientProperties {
32 | }
33 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/metrics/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Auto-configuration for CloudWatch integration.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.metrics;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Auto-configurations for AWS services integrations.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/s3/S3ClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.s3;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
19 | import software.amazon.awssdk.services.s3.S3ClientBuilder;
20 |
21 | /**
22 | * Callback interface that can be used to customize a {@link S3ClientBuilder}.
23 | *
24 | * @author Maciej Walkowiak
25 | * @since 3.3.0
26 | */
27 | @FunctionalInterface
28 | public interface S3ClientCustomizer extends AwsClientCustomizer {
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/s3/S3EncryptionClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2024 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.s3;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
19 | import software.amazon.encryption.s3.S3EncryptionClient;
20 |
21 | /**
22 | * Callback interface that can be used to customize a {@link S3EncryptionClient.Builder}.
23 | *
24 | * @author Matej Nedic
25 | * @since 3.3.0
26 | */
27 | @FunctionalInterface
28 | public interface S3EncryptionClientCustomizer extends AwsClientCustomizer {
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/s3/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Auto-configuration for S3 integrations.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.s3;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/s3/properties/S3PluginProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2024 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.s3.properties;
17 |
18 | public class S3PluginProperties {
19 |
20 | /**
21 | * If set to false if Access Grants does not find/return permissions, S3Client won't try to determine if policies
22 | * grant access If set to true fallback policies S3/IAM will be evaluated.
23 | */
24 | private boolean enableFallback;
25 |
26 | public boolean getEnableFallback() {
27 | return enableFallback;
28 | }
29 |
30 | public void setEnableFallback(boolean enableFallback) {
31 | this.enableFallback = enableFallback;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/s3/properties/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Properties for auto-configuration
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.s3.properties;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/ses/SesClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.ses;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
19 | import software.amazon.awssdk.services.ses.SesClientBuilder;
20 |
21 | /**
22 | * Callback interface that can be used to customize a {@link SesClientBuilder}.
23 | *
24 | * @author Maciej Walkowiak
25 | * @since 3.3.0
26 | */
27 | @FunctionalInterface
28 | public interface SesClientCustomizer extends AwsClientCustomizer {
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/ses/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Auto-configuration for Amazon SES (Simple Email Service) integrations.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.ses;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/sns/SnsClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.sns;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
19 | import software.amazon.awssdk.services.sns.SnsClientBuilder;
20 |
21 | /**
22 | * Callback interface that can be used to customize a {@link SnsClientBuilder}.
23 | *
24 | * @author Maciej Walkowiak
25 | * @since 3.3.0
26 | */
27 | @FunctionalInterface
28 | public interface SnsClientCustomizer extends AwsClientCustomizer {
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/sns/SnsProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.sns;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientProperties;
19 | import org.springframework.boot.context.properties.ConfigurationProperties;
20 |
21 | /**
22 | * Properties related to AWS SNS.
23 | *
24 | * @author Matej Nedic
25 | * @since 3.0
26 | */
27 | @ConfigurationProperties(prefix = SnsProperties.PREFIX)
28 | public class SnsProperties extends AwsClientProperties {
29 |
30 | /**
31 | * The prefix used for AWS SNS configuration.
32 | */
33 | public static final String PREFIX = "spring.cloud.aws.sns";
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/sns/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Auto-configuration for Amazon SNS (Simple Notification Service) integrations.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.sns;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/sqs/SqsAsyncClientCustomizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.sqs;
17 |
18 | import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
19 | import software.amazon.awssdk.services.sqs.SqsAsyncClientBuilder;
20 |
21 | /**
22 | * Callback interface that can be used to customize a {@link SqsAsyncClientBuilder}.
23 | *
24 | * @author Maciej Walkowiak
25 | * @since 3.3.0
26 | */
27 | @FunctionalInterface
28 | public interface SqsAsyncClientCustomizer extends AwsClientCustomizer {
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/sqs/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Auto-configuration for Amazon SQS (Simple Queue Service) integrations.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.autoconfigure.sqs;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "properties": [
3 | {
4 | "defaultValue": true,
5 | "name": "spring.cloud.aws.sns.enabled",
6 | "description": "Enables SNS integration.",
7 | "type": "java.lang.Boolean"
8 | },
9 | {
10 | "defaultValue": true,
11 | "name": "spring.cloud.aws.ses.enabled",
12 | "description": "Enables Simple Email Service integration.",
13 | "type": "java.lang.Boolean"
14 | },
15 | {
16 | "defaultValue": true,
17 | "name": "spring.cloud.aws.s3.enabled",
18 | "description": "Enables S3 integration.",
19 | "type": "java.lang.Boolean"
20 | },
21 | {
22 | "defaultValue": true,
23 | "name": "spring.cloud.aws.dynamodb.enabled",
24 | "description": "Enables DynamoDb integration.",
25 | "type": "java.lang.Boolean"
26 | },
27 | {
28 | "defaultValue": true,
29 | "name": "spring.cloud.aws.sqs.enabled",
30 | "description": "Enables SQS integration.",
31 | "type": "java.lang.Boolean"
32 | }
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | # ConfigData Location Resolvers
2 | org.springframework.boot.context.config.ConfigDataLocationResolver=\
3 | io.awspring.cloud.autoconfigure.config.parameterstore.ParameterStoreConfigDataLocationResolver,\
4 | io.awspring.cloud.autoconfigure.config.secretsmanager.SecretsManagerConfigDataLocationResolver,\
5 | io.awspring.cloud.autoconfigure.config.s3.S3ConfigDataLocationResolver
6 |
7 | # ConfigData Loaders
8 | org.springframework.boot.context.config.ConfigDataLoader=\
9 | io.awspring.cloud.autoconfigure.config.parameterstore.ParameterStoreConfigDataLoader,\
10 | io.awspring.cloud.autoconfigure.config.secretsmanager.SecretsManagerConfigDataLoader,\
11 | io.awspring.cloud.autoconfigure.config.s3.S3ConfigDataLoader
12 |
13 | # Failure Analyzers
14 | org.springframework.boot.diagnostics.FailureAnalyzer=\
15 | io.awspring.cloud.autoconfigure.config.parameterstore.ParameterStoreMissingKeysFailureAnalyzer, \
16 | io.awspring.cloud.autoconfigure.config.secretsmanager.SecretsManagerMissingKeysFailureAnalyzer,\
17 | io.awspring.cloud.autoconfigure.config.s3.S3MissingKeysFailureAnalyzer
18 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/resources/META-INF/spring/aot.factories:
--------------------------------------------------------------------------------
1 | org.springframework.aot.hint.RuntimeHintsRegistrar=\
2 | io.awspring.cloud.autoconfigure.config.ConfigStoreRuntimeHints,\
3 | io.awspring.cloud.autoconfigure.core.CoreAOT
4 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | io.awspring.cloud.autoconfigure.core.AwsAutoConfiguration
2 | io.awspring.cloud.autoconfigure.core.CredentialsProviderAutoConfiguration
3 | io.awspring.cloud.autoconfigure.core.RegionProviderAutoConfiguration
4 | io.awspring.cloud.autoconfigure.imds.ImdsAutoConfiguration
5 | io.awspring.cloud.autoconfigure.metrics.CloudWatchExportAutoConfiguration
6 | io.awspring.cloud.autoconfigure.ses.SesAutoConfiguration
7 | io.awspring.cloud.autoconfigure.s3.S3TransferManagerAutoConfiguration
8 | io.awspring.cloud.autoconfigure.s3.S3AutoConfiguration
9 | io.awspring.cloud.autoconfigure.s3.S3CrtAsyncClientAutoConfiguration
10 | io.awspring.cloud.autoconfigure.sns.SnsAutoConfiguration
11 | io.awspring.cloud.autoconfigure.sqs.SqsAutoConfiguration
12 | io.awspring.cloud.autoconfigure.dynamodb.DynamoDbAutoConfiguration
13 | io.awspring.cloud.autoconfigure.config.secretsmanager.SecretsManagerReloadAutoConfiguration
14 | io.awspring.cloud.autoconfigure.config.secretsmanager.SecretsManagerAutoConfiguration
15 | io.awspring.cloud.autoconfigure.config.parameterstore.ParameterStoreReloadAutoConfiguration
16 | io.awspring.cloud.autoconfigure.config.parameterstore.ParameterStoreAutoConfiguration
17 | io.awspring.cloud.autoconfigure.config.s3.S3ReloadAutoConfiguration
18 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/s3/provider/MyAesProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2024 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.s3.provider;
17 |
18 | import io.awspring.cloud.autoconfigure.s3.S3AesProvider;
19 | import javax.crypto.KeyGenerator;
20 | import javax.crypto.SecretKey;
21 |
22 | public class MyAesProvider implements S3AesProvider {
23 | @Override
24 | public SecretKey generateSecretKey() {
25 | try {
26 | KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
27 | keyGenerator.init(256);
28 | return keyGenerator.generateKey();
29 | }
30 | catch (Exception e) {
31 | return null;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/s3/provider/MyRsaProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2024 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.autoconfigure.s3.provider;
17 |
18 | import io.awspring.cloud.autoconfigure.s3.S3RsaProvider;
19 | import java.security.KeyPair;
20 | import java.security.KeyPairGenerator;
21 |
22 | public class MyRsaProvider implements S3RsaProvider {
23 | @Override
24 | public KeyPair generateKeyPair() {
25 | try {
26 | KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
27 | keyPairGenerator.initialize(2048);
28 | return keyPairGenerator.generateKeyPair();
29 | }
30 | catch (Exception e) {
31 | return null;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/test/resources/config.properties:
--------------------------------------------------------------------------------
1 | spring.config.import=aws-secretsmanager:/config/spring,classpath:config_second.properties
2 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/test/resources/config_second.properties:
--------------------------------------------------------------------------------
1 | another-parameter=from properties file
2 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/test/resources/io/awspring/cloud/autoconfigure/core/CredentialsProviderAutoConfigurationTests-profile:
--------------------------------------------------------------------------------
1 | [default]
2 | aws_access_key_id=defaultKey
3 | aws_secret_access_key=defaultKey
4 | aws_session_token=defaultToken
5 |
6 | [customProfile]
7 | aws_access_key_id=testAccessKey
8 | aws_secret_access_key=testSecretKey
9 | aws_session_token=testSessionToken
10 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/test/resources/io/awspring/cloud/autoconfigure/core/RegionProviderAutoConfigurationTests-profile:
--------------------------------------------------------------------------------
1 | [default]
2 | aws_access_key_id=defaultKey
3 | aws_secret_access_key=defaultKey
4 | aws_session_token=defaultToken
5 | region=us-east-1
6 |
7 | [profile customProfile]
8 | aws_access_key_id=testAccessKey
9 | aws_secret_access_key=testSecretKey
10 | aws_session_token=testSessionToken
11 | region=eu-west-1
12 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/test/resources/io/awspring/cloud/autoconfigure/core/SesAutoConfigurationTest-profile:
--------------------------------------------------------------------------------
1 | [default]
2 | aws_access_key_id=defaultKey
3 | aws_secret_access_key=defaultKey
4 | aws_session_token=defaultToken
5 |
6 |
--------------------------------------------------------------------------------
/spring-cloud-aws-autoconfigure/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/spring-cloud-aws-core/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 |
8 | io.awspring.cloud
9 | spring-cloud-aws
10 | 3.4.0-SNAPSHOT
11 |
12 |
13 | spring-cloud-aws-core
14 | Spring Cloud AWS Core
15 |
16 |
17 |
18 | software.amazon.awssdk
19 | regions
20 |
21 |
22 | software.amazon.awssdk
23 | auth
24 |
25 |
26 | org.springframework
27 | spring-core
28 |
29 |
30 |
31 |
32 |
33 |
34 | src/main/resources/
35 | true
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/spring-cloud-aws-core/src/main/java/io/awspring/cloud/core/AWSCoreRuntimeHints.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2023 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.core;
17 |
18 | import org.springframework.aot.hint.RuntimeHints;
19 | import org.springframework.aot.hint.RuntimeHintsRegistrar;
20 |
21 | public class AWSCoreRuntimeHints implements RuntimeHintsRegistrar {
22 |
23 | @Override
24 | public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
25 | hints.resources().registerPattern("io/awspring/cloud/core/SpringCloudClientConfiguration.properties");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/spring-cloud-aws-core/src/main/java/io/awspring/cloud/core/config/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Base classes for storing and retrieving configuration from AWS resources.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.core.config;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-core/src/main/java/io/awspring/cloud/core/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Common infrastructure for all Spring Cloud AWS modules.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.core;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-core/src/main/java/io/awspring/cloud/core/region/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Utilities for handling AWS region selection.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.core.region;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-core/src/main/resources/META-INF/spring/aot.factories:
--------------------------------------------------------------------------------
1 | org.springframework.aot.hint.RuntimeHintsRegistrar=\
2 | io.awspring.cloud.core.AWSCoreRuntimeHints
3 |
--------------------------------------------------------------------------------
/spring-cloud-aws-core/src/main/resources/io/awspring/cloud/core/SpringCloudClientConfiguration.properties:
--------------------------------------------------------------------------------
1 | build.version=@pom.version@
2 |
--------------------------------------------------------------------------------
/spring-cloud-aws-docker-compose/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | spring-cloud-aws
8 | io.awspring.cloud
9 | 3.4.0-SNAPSHOT
10 |
11 | 4.0.0
12 |
13 | spring-cloud-aws-docker-compose
14 | Spring Cloud AWS Docker Compose
15 | Spring Cloud AWS Docker Compose Integration
16 |
17 |
18 |
19 | io.awspring.cloud
20 | spring-cloud-aws-autoconfigure
21 |
22 |
23 | org.springframework.boot
24 | spring-boot-docker-compose
25 |
26 |
27 | org.springframework
28 | spring-test
29 | test
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/spring-cloud-aws-docker-compose/src/main/java/io/awspring/cloud/docker/compose/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Docker Compose integration.
3 | */
4 | @org.springframework.lang.NonNullApi
5 | @org.springframework.lang.NonNullFields
6 | package io.awspring.cloud.docker.compose;
7 |
--------------------------------------------------------------------------------
/spring-cloud-aws-docker-compose/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
2 | io.awspring.cloud.docker.compose.AwsDockerComposeConnectionDetailsFactory
3 |
--------------------------------------------------------------------------------
/spring-cloud-aws-docker-compose/src/test/resources/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | localstack:
3 | image: localstack/localstack
4 | environment:
5 | AWS_ACCESS_KEY_ID: noop
6 | AWS_SECRET_ACCESS_KEY: noop
7 | AWS_DEFAULT_REGION: eu-central-1
8 | ports:
9 | - "4566:4566"
10 |
--------------------------------------------------------------------------------
/spring-cloud-aws-dynamodb/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 |
10 | 4.0.0
11 | spring-cloud-aws-dynamodb
12 | Spring Cloud AWS DynamoDb Integration
13 |
14 |
15 |
16 | software.amazon.awssdk
17 | dynamodb
18 |
19 |
20 | org.springframework
21 | spring-core
22 |
23 |
24 | software.amazon.awssdk
25 | dynamodb-enhanced
26 |
27 |
28 | org.testcontainers
29 | localstack
30 | test
31 |
32 |
33 | org.testcontainers
34 | junit-jupiter
35 | test
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/spring-cloud-aws-dynamodb/src/main/java/io/awspring/cloud/dynamodb/DynamoDbTableNameResolver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.dynamodb;
17 |
18 | import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
19 |
20 | /**
21 | * Resolves DynamoDB table name from a {@link Class}. Used by {@link DynamoDbTemplate}.
22 | *
23 | * @author Matej Nedic
24 | * @since 3.0
25 | */
26 | public interface DynamoDbTableNameResolver {
27 |
28 | /**
29 | * Resolves DynamoDb table name from a {@link Class} typically annotated with {@link DynamoDbBean}.
30 | *
31 | * @param clazz - the class from which DynamoDb table is resolved
32 | * @return the table name
33 | * @param - the type for class
34 | */
35 | String resolve(Class clazz);
36 | }
37 |
--------------------------------------------------------------------------------
/spring-cloud-aws-dynamodb/src/main/java/io/awspring/cloud/dynamodb/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * DynamoDb integration.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.dynamodb;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-dynamodb/src/test/java/io/awspring/cloud/dynamodb/Book.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.dynamodb;
17 |
18 | import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
19 | import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbPartitionKey;
20 |
21 | @DynamoDbBean
22 | public class Book {
23 | private String title;
24 | private String subtitle;
25 |
26 | public Book() {
27 | }
28 |
29 | Book(String title, String subtitle) {
30 | this.title = title;
31 | this.subtitle = subtitle;
32 | }
33 |
34 | // title should never be partition key but for sake of a test.
35 | @DynamoDbPartitionKey
36 | public String getTitle() {
37 | return title;
38 | }
39 |
40 | public String getSubtitle() {
41 | return subtitle;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/spring-cloud-aws-dynamodb/src/test/java/io/awspring/cloud/dynamodb/FakePerson.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.dynamodb;
17 |
18 | public class FakePerson {
19 |
20 | private String firstName;
21 | private String lastName;
22 |
23 | public FakePerson() {
24 | }
25 |
26 | public FakePerson(String firstName, String lastName) {
27 | this.firstName = firstName;
28 | this.lastName = lastName;
29 | }
30 |
31 | public String getFirstName() {
32 | return firstName;
33 | }
34 |
35 | public String getLastName() {
36 | return lastName;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/spring-cloud-aws-dynamodb/src/test/java/io/awspring/cloud/dynamodb/Person.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.dynamodb;
17 |
18 | import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
19 | import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbPartitionKey;
20 |
21 | @DynamoDbBean
22 | public class Person {
23 | private String firstName;
24 | private String lastName;
25 |
26 | public Person() {
27 | }
28 |
29 | public Person(String firstName, String lastName) {
30 | this.firstName = firstName;
31 | this.lastName = lastName;
32 | }
33 |
34 | // FirstName should never be partition key but for sake of a test.
35 | @DynamoDbPartitionKey
36 | public String getFirstName() {
37 | return firstName;
38 | }
39 |
40 | public String getLastName() {
41 | return lastName;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/spring-cloud-aws-dynamodb/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spring-cloud-aws-modulith/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | io.awspring.cloud
7 | spring-cloud-aws
8 | 3.4.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | spring-cloud-aws-modulith
13 | Spring Cloud AWS - Spring Modulith Integrations
14 | Spring Cloud AWS - Spring Modulith Integrations
15 | pom
16 |
17 |
18 | spring-cloud-aws-modulith-events-sns
19 | spring-cloud-aws-modulith-events-sqs
20 |
21 |
22 |
--------------------------------------------------------------------------------
/spring-cloud-aws-modulith/spring-cloud-aws-modulith-events-sns/src/main/java/io/awspring/cloud/modulith/events/sns/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * AWS SNS event externalization support.
3 | */
4 | @org.springframework.lang.NonNullApi
5 | package io.awspring.cloud.modulith.events.sns;
6 |
--------------------------------------------------------------------------------
/spring-cloud-aws-modulith/spring-cloud-aws-modulith-events-sns/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | io.awspring.cloud.modulith.events.sns.SnsEventExternalizerConfiguration
2 |
--------------------------------------------------------------------------------
/spring-cloud-aws-modulith/spring-cloud-aws-modulith-events-sns/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.modulith.events.jdbc.schema-initialization.enabled=true
2 |
--------------------------------------------------------------------------------
/spring-cloud-aws-modulith/spring-cloud-aws-modulith-events-sns/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/spring-cloud-aws-modulith/spring-cloud-aws-modulith-events-sqs/src/main/java/io/awspring/cloud/modulith/events/sqs/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * AWS SQS event externalization support.
3 | */
4 | @org.springframework.lang.NonNullApi
5 | package io.awspring.cloud.modulith.events.sqs;
6 |
--------------------------------------------------------------------------------
/spring-cloud-aws-modulith/spring-cloud-aws-modulith-events-sqs/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | io.awspring.cloud.modulith.events.sqs.SqsEventExternalizerConfiguration
2 |
--------------------------------------------------------------------------------
/spring-cloud-aws-modulith/spring-cloud-aws-modulith-events-sqs/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.artemis.embedded.topics=target
2 | spring.modulith.events.jdbc.schema-initialization.enabled=true
3 |
--------------------------------------------------------------------------------
/spring-cloud-aws-modulith/spring-cloud-aws-modulith-events-sqs/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/spring-cloud-aws-parameter-store/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | io.awspring.cloud
7 | spring-cloud-aws
8 | 3.4.0-SNAPSHOT
9 |
10 |
11 | 4.0.0
12 | spring-cloud-aws-parameter-store
13 | Spring Cloud AWS Parameter Store Integration
14 |
15 |
16 |
17 | io.awspring.cloud
18 | spring-cloud-aws-core
19 |
20 |
21 |
22 | software.amazon.awssdk
23 | ssm
24 |
25 |
26 | org.springframework
27 | spring-context
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/spring-cloud-aws-parameter-store/src/main/java/io/awspring/cloud/parameterstore/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Integration with AWS Parameter Store.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.parameterstore;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-s3/src/main/java/io/awspring/cloud/s3/S3Exception.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.s3;
17 |
18 | import org.springframework.lang.Nullable;
19 |
20 | /**
21 | * Exception thrown when S3 operation fails.
22 | *
23 | * @author Maciej Walkowiak
24 | */
25 | public class S3Exception extends RuntimeException {
26 |
27 | public S3Exception(String message, @Nullable Throwable cause) {
28 | super(message, cause);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/spring-cloud-aws-s3/src/main/java/io/awspring/cloud/s3/S3ObjectContentTypeResolver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.s3;
17 |
18 | import org.springframework.lang.Nullable;
19 |
20 | /**
21 | * Resolves content type of S3 objects.
22 | *
23 | * @author Maciej Walkowiak
24 | * @since 3.0
25 | */
26 | public interface S3ObjectContentTypeResolver {
27 | /**
28 | * Resolves content type from a file name.
29 | *
30 | * @param fileName - the file name
31 | * @return content type or null if not resolved
32 | */
33 | @Nullable
34 | String resolveContentType(String fileName);
35 | }
36 |
--------------------------------------------------------------------------------
/spring-cloud-aws-s3/src/main/java/io/awspring/cloud/s3/S3OutputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.s3;
17 |
18 | import java.io.IOException;
19 | import java.io.OutputStream;
20 |
21 | /**
22 | * Represents {@link OutputStream} that writes data to S3.
23 | *
24 | * @author Maciej Walkowiak
25 | * @since 3.0
26 | */
27 | public abstract class S3OutputStream extends OutputStream {
28 |
29 | /**
30 | * Cancels the upload and cleans up temporal resources (temp files, partial multipart upload).
31 | */
32 | public void abort() throws IOException {
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-s3/src/main/java/io/awspring/cloud/s3/S3RuntimeHints.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2023 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.s3;
17 |
18 | import org.springframework.aot.hint.RuntimeHints;
19 | import org.springframework.aot.hint.RuntimeHintsRegistrar;
20 |
21 | public class S3RuntimeHints implements RuntimeHintsRegistrar {
22 | @Override
23 | public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
24 | hints.resources().registerPattern("io/awspring/cloud/s3/S3ObjectContentTypeResolver.properties");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/spring-cloud-aws-s3/src/main/java/io/awspring/cloud/s3/UploadFailedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.s3;
17 |
18 | import org.springframework.lang.Nullable;
19 |
20 | /**
21 | * Thrown when uploading to S3 fails.
22 | *
23 | * @author Maciej Walkowiak
24 | * @since 3.0
25 | */
26 | public class UploadFailedException extends S3Exception {
27 |
28 | /**
29 | * A path to temporary location containing a file that has not been uploaded to S3.
30 | */
31 | @Nullable
32 | private final String path;
33 |
34 | public UploadFailedException(@Nullable String path, @Nullable Exception se) {
35 | super("Upload failed. File is stored in a temporary folder in the filesystem " + path, se);
36 | this.path = path;
37 | }
38 |
39 | @Nullable
40 | public String getPath() {
41 | return path;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/spring-cloud-aws-s3/src/main/java/io/awspring/cloud/s3/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * S3 integration.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.s3;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-s3/src/main/resources/META-INF/spring/aot.factories:
--------------------------------------------------------------------------------
1 | org.springframework.aot.hint.RuntimeHintsRegistrar=\
2 | io.awspring.cloud.s3.S3RuntimeHints
3 |
--------------------------------------------------------------------------------
/spring-cloud-aws-s3/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/.gitignore:
--------------------------------------------------------------------------------
1 | *.js
2 | !jest.config.js
3 | *.d.ts
4 | node_modules
5 |
6 | # CDK asset staging directory
7 | .cdk.staging
8 | cdk.out
9 |
10 | # Parcel default cache directory
11 | .parcel-cache
12 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/.npmignore:
--------------------------------------------------------------------------------
1 | *.ts
2 | !*.d.ts
3 |
4 | # CDK asset staging directory
5 | .cdk.staging
6 | cdk.out
7 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.8"
2 |
3 | services:
4 | localstack:
5 | container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
6 | image: localstack/localstack:4.4.0
7 | ports:
8 | - "127.0.0.1:4566:4566" # LocalStack Gateway
9 | - "127.0.0.1:4510-4559:4510-4559" # external services port range
10 | environment:
11 | - LOCALSTACK_API_KEY=${LOCALSTACK_API_KEY}
12 | - DEBUG=${DEBUG-}
13 | - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-}
14 | - DOCKER_HOST=unix:///var/run/docker.sock
15 | volumes:
16 | - "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
17 | - "/var/run/docker.sock:/var/run/docker.sock"
18 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/infrastructure/cdk.json:
--------------------------------------------------------------------------------
1 | {
2 | "app": "mvn -e -q compile exec:java",
3 | "watch": {
4 | "include": [
5 | "**"
6 | ],
7 | "exclude": [
8 | "README.md",
9 | "cdk*.json",
10 | "target",
11 | "pom.xml",
12 | "src/test"
13 | ]
14 | },
15 | "context": {
16 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
17 | "@aws-cdk/core:stackRelativeExports": true,
18 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
19 | "@aws-cdk/aws-lambda:recognizeVersionProps": true,
20 | "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true,
21 | "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
22 | "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
23 | "@aws-cdk/core:target-partitions": [
24 | "aws",
25 | "aws-cn"
26 | ]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/infrastructure/src/main/java/io/awspring/cloud/samples/infrastructure/InfrastructureApp.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.samples.infrastructure;
17 |
18 | import software.amazon.awscdk.App;
19 | import software.amazon.awscdk.StackProps;
20 |
21 | public class InfrastructureApp {
22 |
23 | public static void main(final String[] args) {
24 | App app = new App();
25 |
26 | new InfrastructureStack(app, "InfrastructureStack", StackProps.builder().build());
27 |
28 | app.synth();
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/readme.md:
--------------------------------------------------------------------------------
1 | # Spring Cloud AWS Samples
2 |
3 | Samples are prepared to run on LocalStack - a local equivalent of AWS.
4 |
5 | To start LocalStack locally:
6 |
7 | ```
8 | $ docker-compose up
9 | ```
10 |
11 | ## Infrastructure
12 |
13 | Samples use AWS CDK to create the infrastructure components to run the sample. To deploy infrastructure, you need to install CDK and [CDK local](https://github.com/localstack/aws-cdk-local):
14 |
15 | ```
16 | $ npm install -g aws-cdk-local aws-cdk
17 | ```
18 |
19 | Then, in `infrastructure` directory:
20 |
21 | ```
22 | $ mvn package
23 | $ cdklocal bootstrap
24 | $ cdklocal deploy
25 | ```
26 |
27 | ## How to run?
28 |
29 | Samples are regular Spring Boot applications. The best way to run them is to run the main `@SpringBootApplication` annotated class directly from an IDE.
30 |
31 | ## How to destroy infrastructure?
32 |
33 | Infrastructure is destroyed once LocalStack container shuts down. If you want to destroy infrastructure manually, run:
34 |
35 | ```
36 | $ cdklocal destroy
37 | ```
38 |
39 | ## How to run against real AWS?
40 |
41 | To run samples against real AWS, update `spring.cloud.aws` properties in sample's `application.properties` to reflect your AWS configuration or delete these properties completely to use defaults.
42 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-docker-compose-sample/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | localstack:
3 | image: localstack/localstack
4 | container_name: localstack
5 | environment:
6 | SERVICES: sqs
7 | AWS_ACCESS_KEY_ID: noop
8 | AWS_SECRET_ACCESS_KEY: noop
9 | AWS_DEFAULT_REGION: eu-central-1
10 | ports:
11 | - "4566:4566"
12 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-docker-compose-sample/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws-samples
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | spring-cloud-aws-docker-compose-sample
13 | Spring Cloud AWS Docker Compose Sample
14 |
15 |
16 |
17 | org.springframework.boot
18 | spring-boot-starter
19 |
20 |
21 |
22 | io.awspring.cloud
23 | spring-cloud-aws-starter-sqs
24 |
25 |
26 |
27 | io.awspring.cloud
28 | spring-cloud-aws-docker-compose
29 | runtime
30 | true
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-docker-compose-sample/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=spring-cloud-aws-docker-compose-sample
2 |
3 | # Notice we don't need to configure spring.cloud.aws.* properties (endpoint, region, access keys),
4 | # since this is configured in the docker-compose.yaml file and automatically picked up by the application
5 |
6 | spring.docker.compose.file=spring-cloud-aws-samples/spring-cloud-aws-docker-compose-sample/docker-compose.yaml
7 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-dynamodb-sample/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws-samples
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | spring-cloud-aws-dynamodb-sample
13 | Spring Cloud AWS DynamoDb Sample
14 |
15 |
16 |
17 | org.springframework.boot
18 | spring-boot-starter
19 |
20 |
21 |
22 | io.awspring.cloud
23 | spring-cloud-aws-starter-dynamodb
24 |
25 |
26 |
27 | io.awspring.cloud
28 | spring-cloud-aws-testcontainers
29 | test
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-dynamodb-sample/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # LocalStack configuration
2 | spring.cloud.aws.endpoint=http://localhost:4566
3 | spring.cloud.aws.region.static=us-east-1
4 | spring.cloud.aws.credentials.access-key=noop
5 | spring.cloud.aws.credentials.secret-key=noop
6 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-parameter-store-sample/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | io.awspring.cloud
7 | spring-cloud-aws-samples
8 | 3.4.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | spring-cloud-aws-parameter-store-sample
13 | Spring Cloud AWS Parameter Store Sample
14 |
15 |
16 |
17 | org.springframework.boot
18 | spring-boot-starter
19 |
20 |
21 | io.awspring.cloud
22 | spring-cloud-aws-starter-parameter-store
23 |
24 |
25 |
26 |
27 |
28 |
29 | org.springframework.boot
30 | spring-boot-maven-plugin
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-parameter-store-sample/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # importing single parameter
2 | spring.config.import=aws-parameterstore:/config/spring/
3 | logging.level.io.awspring.cloud=debug
4 |
5 | # LocalStack configuration
6 | spring.cloud.aws.endpoint=http://localhost:4566
7 | spring.cloud.aws.region.static=us-east-1
8 | spring.cloud.aws.credentials.access-key=noop
9 | spring.cloud.aws.credentials.secret-key=noop
10 |
11 | # importing multiple parameters
12 | # spring.config.import: aws-parameterstore:/config/spring;/config/common
13 |
14 | # secrets can be marked as optional - if any of them does not exist application startup will continue
15 | # spring.config.import: optional:aws-parameterstore:/config/spring;/config/common
16 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-s3-sample/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | io.awspring.cloud
7 | spring-cloud-aws-samples
8 | 3.4.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | spring-cloud-aws-s3-sample
13 | Spring Cloud AWS S3 Sample
14 |
15 |
16 |
17 | org.springframework.boot
18 | spring-boot-starter-web
19 |
20 |
21 | io.awspring.cloud
22 | spring-cloud-aws-starter-s3
23 |
24 |
25 |
26 |
27 |
28 |
29 | org.springframework.boot
30 | spring-boot-maven-plugin
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-s3-sample/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # LocalStack configuration
2 | spring.cloud.aws.endpoint=http://localhost:4566
3 | spring.cloud.aws.region.static=us-east-1
4 | spring.cloud.aws.credentials.access-key=noop
5 | spring.cloud.aws.credentials.secret-key=noop
6 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-secrets-manager-sample/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | # importing single secret
2 | #spring.config.import: aws-secretsmanager:/secrets/spring-cloud-aws-sample-app
3 | logging.level:
4 | io.awspring.cloud.secretsmanager: debug
5 |
6 | # LocalStack configuration
7 | spring.cloud.aws.endpoint: http://localhost:4566
8 | spring.cloud.aws.region.static: us-east-1
9 | spring.cloud.aws.credentials.access-key: noop
10 | spring.cloud.aws.credentials.secret-key: noop
11 |
12 | # importing multiple secrets
13 | # spring.config.import: aws-secretsmanager:/secrets/spring-cloud-aws-sample-app;/secret/common
14 |
15 | # importing secrets based on spring.application.name property value for each active profile
16 | # NOTE: if any of the secrets is missing, application won't start unless the "optional" prefix is set
17 | #spring.config.import: "aws-secretsmanager:"
18 |
19 | # secrets can be marked as optional - if any of them does not exist application startup will continue
20 | # spring.config.import: optional:aws-secretsmanager:/secrets/spring-cloud-aws-sample-app;/secret/common
21 |
22 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-ses-sample/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 |
3 | services:
4 | ses-sample-localstack:
5 | container_name: localstack
6 | environment:
7 | - DEBUG=1
8 | - LOCALSTACK_HOSTNAME=localhost
9 | - TEST_AWS_ACCOUNT_ID=000000000000
10 | - AWS_DEFAULT_REGION=us-east-1
11 | - SERVICES=ses
12 | - S3_MOUNT=/tmp
13 | image: localstack/localstack:latest
14 | ports:
15 | - "4566:4566"
16 | volumes:
17 | - /var/run/docker.sock:/var/run/docker.sock
18 |
19 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-ses-sample/src/main/resources/answer.txt:
--------------------------------------------------------------------------------
1 | Question to Spring Cloud AWS: What is the meaning of life, the universe, and everything?
2 | Answer from Spring Cloud AWS: 42
3 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-ses-sample/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # LocalStack configuration
2 | spring.cloud.aws.endpoint=http://localhost:4566
3 | spring.cloud.aws.region.static=us-east-1
4 | spring.cloud.aws.credentials.access-key=noop
5 | spring.cloud.aws.credentials.secret-key=noop
6 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-sns-sample/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws-samples
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 |
10 | 4.0.0
11 | spring-cloud-aws-sns-sample
12 |
13 |
14 |
15 | org.springframework.boot
16 | spring-boot-starter
17 |
18 |
19 |
20 | org.springframework.boot
21 | spring-boot-starter-web
22 |
23 |
24 |
25 | io.awspring.cloud
26 | spring-cloud-aws-starter-sns
27 |
28 |
29 |
30 |
31 |
32 |
33 | org.springframework.boot
34 | spring-boot-maven-plugin
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-sns-sample/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # LocalStack configuration
2 | spring.cloud.aws.endpoint=http://localhost:4566
3 | spring.cloud.aws.region.static=us-east-1
4 | spring.cloud.aws.credentials.access-key=noop
5 | spring.cloud.aws.credentials.secret-key=noop
6 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-sqs-sample/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws-samples
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 |
10 | 4.0.0
11 | spring-cloud-aws-sqs-sample
12 |
13 |
14 |
15 | org.springframework.boot
16 | spring-boot-starter
17 |
18 |
19 |
20 | org.springframework.boot
21 | spring-boot-starter-web
22 |
23 |
24 |
25 | io.awspring.cloud
26 | spring-cloud-aws-starter-sqs
27 |
28 |
29 |
30 |
31 |
32 |
33 | org.springframework.boot
34 | spring-boot-maven-plugin
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/spring-cloud-aws-samples/spring-cloud-aws-sqs-sample/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # LocalStack configuration
2 | spring.cloud.aws.endpoint=http://localhost:4566
3 | spring.cloud.aws.region.static=us-east-1
4 | spring.cloud.aws.credentials.access-key=noop
5 | spring.cloud.aws.credentials.secret-key=noop
6 |
--------------------------------------------------------------------------------
/spring-cloud-aws-secrets-manager/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | io.awspring.cloud
7 | spring-cloud-aws
8 | 3.4.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | spring-cloud-aws-secrets-manager
13 | Spring Cloud AWS Secrets Manager Integration
14 |
15 |
16 |
17 | org.springframework
18 | spring-core
19 |
20 |
21 | io.awspring.cloud
22 | spring-cloud-aws-core
23 |
24 |
25 |
26 | software.amazon.awssdk
27 | secretsmanager
28 |
29 |
30 | com.fasterxml.jackson.core
31 | jackson-databind
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-secrets-manager/src/main/java/io/awspring/cloud/secretsmanager/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Integration with AWS Secrets Manager.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.secretsmanager;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-ses/src/main/java/io/awspring/cloud/ses/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Integration with AWS SES (Simple Email Service).
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.ses;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/annotation/endpoint/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Convenience annotations serving as a replacement for {@link org.springframework.web.bind.annotation.RequestMapping}
19 | * for SNS HTTP endpoints.
20 | */
21 | @org.springframework.lang.NonNullApi
22 | @org.springframework.lang.NonNullFields
23 | package io.awspring.cloud.sns.annotation.endpoint;
24 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/annotation/handlers/NotificationMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sns.annotation.handlers;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | /**
24 | * Annotation that is used to map SNS notification value to a variable that is annotated. Used in Controllers method for
25 | * handling/receiving SNS notifications.
26 | *
27 | * @author Alain Sahli
28 | */
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Target(ElementType.PARAMETER)
31 | public @interface NotificationMessage {
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/annotation/handlers/NotificationSubject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sns.annotation.handlers;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | /**
24 | *
25 | * Annotation that is used to map SNS subject value to a variable that is annotated. Used in Controllers method for
26 | * handling/receiving SNS notifications.
27 | *
28 | * @author Alain Sahli
29 | */
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Target(ElementType.PARAMETER)
32 | public @interface NotificationSubject {
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/annotation/handlers/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Spring Web method argument handlers for Sns integration.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sns.annotation.handlers;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/configuration/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Sns integration configuration helpers.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sns.configuration;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/core/SnsOperations.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sns.core;
17 |
18 | /**
19 | * High level SNS operations.
20 | *
21 | * @author Maciej Walkowiak
22 | * @author Hardik Singh Behl
23 | * @since 3.0
24 | */
25 | public interface SnsOperations {
26 |
27 | /**
28 | * Sends a notification to a topic.
29 | *
30 | * @param topic - the topic
31 | * @param notification - the notification
32 | */
33 | void sendNotification(String topic, SnsNotification> notification);
34 |
35 | /**
36 | * Checks if topic with given ARN exists.
37 | *
38 | * @param topicArn - ARN of the topic
39 | * @return true if topic exists, false otherwise
40 | */
41 | boolean topicExists(String topicArn);
42 | }
43 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/core/TopicArnResolver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sns.core;
17 |
18 | import software.amazon.awssdk.arns.Arn;
19 |
20 | /**
21 | * Resolves topic ARN by name.
22 | *
23 | * @author Matej Nedic
24 | */
25 | public interface TopicArnResolver {
26 |
27 | Arn resolveTopicArn(String topicName);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/core/TopicNotFoundException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2023 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sns.core;
17 |
18 | /**
19 | * Thrown when {@link TopicsListingTopicArnResolver} cannot determine ARN based on topicName.
20 | *
21 | * @author Matej Nedic
22 | * @since 3.0.0
23 | */
24 | public class TopicNotFoundException extends RuntimeException {
25 |
26 | public TopicNotFoundException(String message) {
27 | super(message);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/core/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Sns integration core.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sns.core;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/handlers/NotificationStatus.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sns.handlers;
17 |
18 | import io.awspring.cloud.sns.annotation.endpoint.NotificationSubscriptionMapping;
19 | import io.awspring.cloud.sns.annotation.endpoint.NotificationUnsubscribeConfirmationMapping;
20 |
21 | /**
22 | * Interface used for confirming Subscription/Unsubscription. Implementation of interface can be used in Controllers
23 | * methods that are annotated with {@link NotificationSubscriptionMapping} and
24 | * {@link NotificationUnsubscribeConfirmationMapping}.
25 | *
26 | * @author Agim Emruli
27 | */
28 | public interface NotificationStatus {
29 |
30 | void confirmSubscription();
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/handlers/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Method argument handlers for SNS integration annotations from {@link io.awspring.cloud.sns.annotation.handlers}
19 | * package.
20 | */
21 | @org.springframework.lang.NonNullApi
22 | @org.springframework.lang.NonNullFields
23 | package io.awspring.cloud.sns.handlers;
24 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Integration with AWS SNS (Simple Notification Service).
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sns;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/sms/SmsType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sns.sms;
17 |
18 | /**
19 | * The type of message that you're sending.
20 | *
21 | * @author Matej Nedic
22 | * @since 3.0.0
23 | */
24 | public enum SmsType {
25 | /**
26 | * Non-critical messages, such as marketing messages.
27 | */
28 | PROMOTIONAL("Promotional"),
29 | /**
30 | * Critical messages that support customer transactions.
31 | */
32 | TRANSACTIONAL("Transactional");
33 |
34 | private final String type;
35 |
36 | SmsType(String type) {
37 | this.type = type;
38 | }
39 |
40 | String getType() {
41 | return type;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/java/io/awspring/cloud/sns/sms/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Sending SMS via SNS integration.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sns.sms;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/main/resources/META-INF/spring/aot.factories:
--------------------------------------------------------------------------------
1 | org.springframework.aot.hint.RuntimeHintsRegistrar=\
2 | io.awspring.cloud.sns.SnsRuntimeHints
3 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/test/java/io/awspring/cloud/sns/Matchers.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sns;
17 |
18 | import static org.mockito.ArgumentMatchers.argThat;
19 |
20 | import java.util.function.Consumer;
21 | import software.amazon.awssdk.services.sns.model.PublishRequest;
22 |
23 | public class Matchers {
24 | public static PublishRequest requestMatches(Consumer consumer) {
25 | return argThat(it -> {
26 | consumer.accept(it);
27 | return true;
28 | });
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/test/java/io/awspring/cloud/sns/Person.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sns;
17 |
18 | public class Person {
19 | private String name;
20 |
21 | public Person() {
22 | }
23 |
24 | public Person(String name) {
25 | this.name = name;
26 | }
27 |
28 | public String getName() {
29 | return name;
30 | }
31 |
32 | public void setName(String name) {
33 | this.name = name;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/test/resources/notificationMessage-complexObject-UTF-8-Check.json:
--------------------------------------------------------------------------------
1 | {
2 | "Type": "Notification",
3 | "MessageId": "7aae457b-2894-56fe-8fe4-0bd5c32b9d60",
4 | "TopicArn": "arn:aws:sns:eu-west-1:123453123:IntegrationTestStack-SqsReceivingSnsTopic",
5 | "Subject": "Notification Subject",
6 | "Message": "{\"firstName\":\"الْحُرُوف\",\"lastName\":\"口廿竹十火\"}",
7 | "Timestamp": "2015-10-31T16:17:03.713Z",
8 | "SignatureVersion": "1",
9 | "Signature": "NJ62TPLaeXeiecIc==",
10 | "SigningCertURL": "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-bb750dd426d95ee9390147a5624348ee.pem",
11 | "UnsubscribeURL": "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=a",
12 | "MessageAttributes": {
13 | "NOTIFICATION_SUBJECT_HEADER": {
14 | "Type": "String",
15 | "Value": "Hello default destination"
16 | },
17 | "id": {
18 | "Type": "String",
19 | "Value": "5c450be3-1eab-8f4d-abcc-48772cce6f5d"
20 | },
21 | "contentType": {
22 | "Type": "String",
23 | "Value": "application/json;"
24 | },
25 | "timestamp": {
26 | "Type": "Number.java.lang.Long",
27 | "Value": "1446308223696"
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/test/resources/notificationMessage-complexObject.json:
--------------------------------------------------------------------------------
1 | {
2 | "Type": "Notification",
3 | "MessageId": "7aae457b-2894-56fe-8fe4-0bd5c32b9d60",
4 | "TopicArn": "arn:aws:sns:eu-west-1:123453123:IntegrationTestStack-SqsReceivingSnsTopic",
5 | "Subject": "Notification Subject",
6 | "Message": "{\"firstName\":\"Agim\",\"lastName\":\"Emruli\"}",
7 | "Timestamp": "2015-10-31T16:17:03.713Z",
8 | "SignatureVersion": "1",
9 | "Signature": "NJ62TPLaeXeiecIc==",
10 | "SigningCertURL": "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-bb750dd426d95ee9390147a5624348ee.pem",
11 | "UnsubscribeURL": "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=a",
12 | "MessageAttributes": {
13 | "NOTIFICATION_SUBJECT_HEADER": {
14 | "Type": "String",
15 | "Value": "Hello default destination"
16 | },
17 | "id": {
18 | "Type": "String",
19 | "Value": "5c450be3-1eab-8f4d-abcc-48772cce6f5d"
20 | },
21 | "contentType": {
22 | "Type": "String",
23 | "Value": "application/json;charset=UTF-8"
24 | },
25 | "timestamp": {
26 | "Type": "Number.java.lang.Long",
27 | "Value": "1446308223696"
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sns/src/test/resources/notificationMessage.json:
--------------------------------------------------------------------------------
1 | {
2 | "Type": "Notification",
3 | "MessageId": "f2c15fec-c617-5b08-b54d-13c4099fec60",
4 | "TopicArn": "arn:aws:sns:eu-west-1:111111111111:mySampleTopic",
5 | "Subject": "asdasd",
6 | "Message": "asdasd",
7 | "Timestamp": "2014-06-28T14:12:24.418Z",
8 | "SignatureVersion": "1",
9 | "Signature": "XDvKSAnhxECrAmyIrs0Dsfbp/tnKD1IvoOOYTU28FtbUoxr/CgziuW87yZwTuSNNbHJbdD3BEjHS0vKewm0xBeQ0PToDkgtoORXo5RWnmShDQ2nhkthFhZnNulKtmFtRogjBtCwbz8sPnbOCSk21ruyXNdV2RUbdDalndAW002CWEQmYMxFSN6OXUtMueuT610aX+tqeYP4Z6+8WTWLWjAuVyy7rOI6KHYBcVDhKtskvTOPZ4tiVohtQdQbO2Gjuh1vblRzzwMkfaoFTSWImd4pFXxEsv/fq9aGIlqq9xEryJ0w2huFwI5gxyhvGt0RnTd9YvmAEC+WzdJDOqaDNxg==",
10 | "SigningCertURL": "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-e372f8ca30337fdb084e8ac449342c77.pem",
11 | "UnsubscribeURL": "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:721324560415:mySampleTopic:9859a6c9-6083-4690-ab02-d1aead3442df",
12 | "MessageAttributes": {
13 | "AWS.SNS.MOBILE.MPNS.Type": {
14 | "Type": "String",
15 | "Value": "token"
16 | },
17 | "AWS.SNS.MOBILE.WNS.Type": {
18 | "Type": "String",
19 | "Value": "wns/badge"
20 | },
21 | "AWS.SNS.MOBILE.MPNS.NotificationClass": {
22 | "Type": "String",
23 | "Value": "realtime"
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/MessagingHeaders.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2023 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs;
17 |
18 | /**
19 | * {@link org.springframework.messaging.MessageHeaders} associated with messaging operations.
20 | * @author Tomaz Fernandes
21 | * @since 3.0
22 | */
23 | public class MessagingHeaders {
24 |
25 | /**
26 | * Header for a {@link io.awspring.cloud.sqs.listener.acknowledgement.AcknowledgementCallback} for this message.
27 | */
28 | public static final String ACKNOWLEDGMENT_CALLBACK_HEADER = "AcknowledgementCallback";
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/QueueAttributesResolvingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs;
17 |
18 | /**
19 | * Exception thrown when a {@link QueueAttributesResolver} fails.
20 | *
21 | * @author Tomaz Fernandes
22 | * @since 3.0
23 | * @see io.awspring.cloud.sqs.listener.QueueNotFoundStrategy
24 | */
25 | public class QueueAttributesResolvingException extends RuntimeException {
26 |
27 | /**
28 | * Create an instance with the message and throwable cause.
29 | * @param message the error message.
30 | * @param cause the cause.
31 | */
32 | public QueueAttributesResolvingException(String message, Throwable cause) {
33 | super(message, cause);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/SqsException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs;
17 |
18 | import org.springframework.core.NestedRuntimeException;
19 | import org.springframework.lang.Nullable;
20 |
21 | /**
22 | * Top-level exception for Sqs {@link RuntimeException} instances.
23 | *
24 | * @author Tomaz Fernandes
25 | * @since 3.0
26 | */
27 | public class SqsException extends NestedRuntimeException {
28 |
29 | /**
30 | * Construct an instance with the supplied message and cause.
31 | * @param msg the message.
32 | * @param cause the cause.
33 | */
34 | public SqsException(String msg, @Nullable Throwable cause) {
35 | super(msg, cause);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/annotation/SnsNotificationMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.annotation;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | /**
24 | * Annotation that is used to map SNS notification value on an SQS Queue to a variable that is annotated. Used in
25 | * Controllers method for handling/receiving SQS notifications.
26 | *
27 | * @author Michael Sosa
28 | * @since 3.1.1
29 | */
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Target(ElementType.PARAMETER)
32 | public @interface SnsNotificationMessage {
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/annotation/SnsNotificationSubject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.annotation;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | /**
24 | * Annotation that is used to map SNS notification subject on an SQS Queue to a variable that is annotated. Used in
25 | * Controllers method for handling/receiving SQS notifications.
26 | *
27 | * @author Alexander Nebel
28 | * @since 3.3.1
29 | */
30 | @Retention(RetentionPolicy.RUNTIME)
31 | @Target(ElementType.PARAMETER)
32 | public @interface SnsNotificationSubject {
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/annotation/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * SqsListener annotation and classes to process it.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.annotation;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/config/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Assembly-time components for SQS.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.config;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/AsyncAdapterBlockingExecutionFailedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener;
17 |
18 | /**
19 | * Exception representing a failure on an execution attempted by a blocking adapter.
20 | * @author Tomaz Fernandes
21 | * @since 3.0
22 | * @see io.awspring.cloud.sqs.listener.AsyncComponentAdapters
23 | */
24 | public class AsyncAdapterBlockingExecutionFailedException extends RuntimeException {
25 |
26 | /**
27 | * Create an instance with the provided error message and cause.
28 | * @param errorMessage the error message.
29 | * @param cause the cause.
30 | */
31 | public AsyncAdapterBlockingExecutionFailedException(String errorMessage, Throwable cause) {
32 | super(errorMessage, cause);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/ConfigurableContainerComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener;
17 |
18 | /**
19 | * Representation of a {@link MessageListenerContainer} component that can be configured using a
20 | * {@link ContainerOptions} instance.
21 | *
22 | * @author Tomaz Fernandes
23 | * @since 3.0
24 | */
25 | public interface ConfigurableContainerComponent {
26 |
27 | /**
28 | * Configure the component with the provided {@link ContainerOptions} instance
29 | * @param containerOptions
30 | */
31 | default void configure(ContainerOptions, ?> containerOptions) {
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/IdentifiableContainerComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener;
17 |
18 | /**
19 | * Representation of a component that can be assigned an id.
20 | *
21 | * @author Tomaz Fernandes
22 | * @since 3.0
23 | */
24 | public interface IdentifiableContainerComponent {
25 |
26 | /**
27 | * Set the component id.
28 | * @param id the id.
29 | */
30 | void setId(String id);
31 |
32 | /**
33 | * Get the component id.
34 | * @return the id.
35 | */
36 | String getId();
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/ListenerMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener;
17 |
18 | /**
19 | * Configure the delivery strategy to be used by a {@link MessageListenerContainer}.
20 | *
21 | * @author Tomaz Fernandes
22 | * @since 3.0
23 | * @see io.awspring.cloud.sqs.listener.sink.FanOutMessageSink
24 | * @see io.awspring.cloud.sqs.listener.sink.OrderedMessageSink
25 | * @see io.awspring.cloud.sqs.listener.sink.BatchMessageSink
26 | */
27 | public enum ListenerMode {
28 |
29 | /**
30 | * Configure the container to receive one message at a time in its components.
31 | */
32 | SINGLE_MESSAGE,
33 |
34 | /**
35 | * Configure the container to receive the whole batch of messages in its components.
36 | */
37 | BATCH
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/MessageListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener;
17 |
18 | import java.util.Collection;
19 | import org.springframework.messaging.Message;
20 |
21 | /**
22 | * Interface to process incoming {@link Message}s.
23 | *
24 | * @param the {@link Message} payload type.
25 | *
26 | * @author Tomaz Fernandes
27 | * @since 3.0
28 | */
29 | @FunctionalInterface
30 | public interface MessageListener {
31 |
32 | void onMessage(Message message);
33 |
34 | default void onMessage(Collection> messages) {
35 | throw new UnsupportedOperationException("Batch not implemented by this MessageListener");
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/ObservableComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2025 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener;
17 |
18 | import io.awspring.cloud.sqs.support.observation.AbstractListenerObservation;
19 |
20 | /**
21 | * Represents a {@link AbstractPipelineMessageListenerContainer} component that can be observed.
22 | *
23 | * @author Tomaz Fernandes
24 | * @since 3.4
25 | */
26 | public interface ObservableComponent {
27 |
28 | /**
29 | * Set the Observation-related instances that are specific to a messaging system.
30 | * @param observationSpecifics the observation-related instances.
31 | */
32 | void setObservationSpecifics(AbstractListenerObservation.Specifics> observationSpecifics);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/QueueAttributesAware.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener;
17 |
18 | /**
19 | * Implementations are enabled to receive a {@link QueueAttributes} instance.
20 | *
21 | * @author Tomaz Fernandes
22 | * @since 3.0
23 | */
24 | public interface QueueAttributesAware {
25 |
26 | /**
27 | * Set the {@link QueueAttributes} instance.
28 | * @param queueAttributes the instance.
29 | */
30 | void setQueueAttributes(QueueAttributes queueAttributes);
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/QueueNotFoundStrategy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener;
17 |
18 | /**
19 | * Configure the strategy to be used when a specified queue is not found at container startup.
20 | * @author Tomaz Fernandes
21 | * @since 3.0
22 | * @see SqsContainerOptions#getQueueNotFoundStrategy()
23 | */
24 | public enum QueueNotFoundStrategy {
25 |
26 | /**
27 | * Throw an exception and stop application startup if a queue is not found.
28 | */
29 | FAIL,
30 |
31 | /**
32 | * Create queues that are not found at startup. Mind that in production environments the application might not have
33 | * permissions to create the queue and throw an exception.
34 | */
35 | CREATE
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/SqsAsyncClientAware.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener;
17 |
18 | import software.amazon.awssdk.services.sqs.SqsAsyncClient;
19 |
20 | /**
21 | * Implementations are enabled to receive a {@link SqsAsyncClient} instance.
22 | *
23 | * @author Tomaz Fernandes
24 | * @since 3.0
25 | */
26 | public interface SqsAsyncClientAware {
27 |
28 | /**
29 | * Set the {@link SqsAsyncClient} instance.
30 | * @param sqsAsyncClient the instance.
31 | */
32 | void setSqsAsyncClient(SqsAsyncClient sqsAsyncClient);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/TaskExecutorAware.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener;
17 |
18 | import org.springframework.core.task.TaskExecutor;
19 |
20 | /**
21 | * Enables a class to receive a container managed {@link TaskExecutor}.
22 | *
23 | * @author Tomaz Fernandes
24 | * @since 3.0
25 | */
26 | public interface TaskExecutorAware {
27 |
28 | /**
29 | * Set the task executor.
30 | * @param taskExecutor the task executor.
31 | */
32 | void setTaskExecutor(TaskExecutor taskExecutor);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/acknowledgement/AcknowledgementExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener.acknowledgement;
17 |
18 | import java.util.Collection;
19 | import java.util.concurrent.CompletableFuture;
20 | import org.springframework.messaging.Message;
21 |
22 | /**
23 | * Allows executing acknowledgements for a batch of messages.
24 | *
25 | * @author Tomaz Fernandes
26 | * @since 3.0
27 | * @see ExecutingAcknowledgementProcessor
28 | */
29 | @FunctionalInterface
30 | public interface AcknowledgementExecutor {
31 |
32 | /**
33 | * Executes acknowledgements for the provided batch of messages.
34 | * @param messages the messages.
35 | * @return a completable future.
36 | */
37 | CompletableFuture execute(Collection> messages);
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/acknowledgement/AcknowledgementResultCallbackException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener.acknowledgement;
17 |
18 | /**
19 | * Exception representing a failure to execute a {@link AcknowledgementResultCallback}.
20 | *
21 | * @author Tomaz Fernandes
22 | * @since 3.0
23 | */
24 | public class AcknowledgementResultCallbackException extends RuntimeException {
25 |
26 | /**
27 | * Create an instance with the supplied message and cause.
28 | * @param errorMessage the error message.
29 | * @param cause the cause.
30 | */
31 | public AcknowledgementResultCallbackException(String errorMessage, Throwable cause) {
32 | super(errorMessage, cause);
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/acknowledgement/handler/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Strategies for handling acknowledgements after successful and / or failed message processing.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.listener.acknowledgement.handler;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/acknowledgement/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Components to process message acknowledgements.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.listener.acknowledgement;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/adapter/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Adapters for invoking a message listener registered by a listener annotation.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.listener.adapter;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/errorhandler/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Components for handling errors and potentially recovering messages.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.listener.errorhandler;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/interceptor/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Components for intercepting messages before or after processing.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.listener.interceptor;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Components for executing the flow of messages to and from a message listener.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.listener;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/pipeline/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Pipeline abstraction to process messages in a container.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.listener.pipeline;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/sink/adapter/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Composable message sink adapters to add behavior to sinks via a decorator pattern.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.listener.sink.adapter;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/sink/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Components to handle the flow of messages from a Source to a Pipeline.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.listener.sink;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/source/FifoSqsMessageSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener.source;
17 |
18 | import java.util.UUID;
19 | import software.amazon.awssdk.services.sqs.model.ReceiveMessageRequest;
20 |
21 | /**
22 | * {@link AbstractSqsMessageSource} implementation for FIFO queues.
23 | * @author Tomaz Fernandes
24 | * @since 3.0
25 | */
26 | public class FifoSqsMessageSource extends AbstractSqsMessageSource {
27 |
28 | @Override
29 | protected void customizeRequest(ReceiveMessageRequest.Builder builder) {
30 | builder.receiveRequestAttemptId(UUID.randomUUID().toString());
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/source/StandardSqsMessageSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.listener.source;
17 |
18 | /**
19 | * {@link AbstractSqsMessageSource} implementation for standard queues.
20 | * @author Tomaz Fernandes
21 | * @since 3.0
22 | */
23 | public class StandardSqsMessageSource extends AbstractSqsMessageSource {
24 | }
25 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/listener/source/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Components that provide message instances to be processed.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.listener.source;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/operations/SendBatchFailureHandlingStrategy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2023 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.operations;
17 |
18 | /**
19 | * The strategy to use when handling a send batch operation that has at least one failed message.
20 | *
21 | * @author Tomaz Fernandes
22 | * @since 3.0
23 | */
24 | public enum SendBatchFailureHandlingStrategy {
25 |
26 | /**
27 | * Throw a {@link SendBatchOperationFailedException} containing a {@link SendResult.Batch} object. This is the
28 | * default strategy.
29 | */
30 | THROW,
31 |
32 | /**
33 | * Do not throw an exception and return the {@link SendResult.Batch} object directly.
34 | */
35 | DO_NOT_THROW
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/operations/TemplateContentBasedDeduplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2023 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.operations;
17 |
18 | /**
19 | * The ContentBasedDeduplication queue attribute value to be used by the {@link SqsTemplate} when sending messages to a
20 | * FIFO queue.
21 | *
22 | * @author Zhong Xi Lu
23 | * @since 3.0.4
24 | */
25 | public enum TemplateContentBasedDeduplication {
26 |
27 | /**
28 | * The ContentBasedDeduplication queue attribute value will be resolved automatically at runtime.
29 | */
30 | AUTO,
31 |
32 | /**
33 | * ContentBasedDeduplication is enabled on all FIFO SQS queues.
34 | */
35 | ENABLED,
36 |
37 | /**
38 | * ContentBasedDeduplication is disabled on all FIFO SQS queues.
39 | */
40 | DISABLED
41 | }
42 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/operations/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Components for converting source messages to Spring messaging messages.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.operations;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * SQS integration for Spring Cloud AWS.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/support/converter/ContextAwareHeaderMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.support.converter;
17 |
18 | import org.springframework.messaging.MessageHeaders;
19 |
20 | /**
21 | * A {@link HeaderMapper} specialization that supports receiving a {@link MessageConversionContext} for mapping context
22 | * dependent headers.
23 | * @author Tomaz Fernandes
24 | * @since 3.0
25 | * @see ContextAwareMessagingMessageConverter
26 | */
27 | public interface ContextAwareHeaderMapper extends HeaderMapper {
28 |
29 | MessageHeaders createContextHeaders(S source, MessageConversionContext context);
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/support/converter/MessageConversionContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.sqs.support.converter;
17 |
18 | import org.springframework.lang.Nullable;
19 |
20 | /**
21 | * Marker interface for a message conversion context.
22 | * @author Tomaz Fernandes
23 | * @since 3.0
24 | * @see ContextAwareMessagingMessageConverter
25 | * @see ContextAwareHeaderMapper
26 | */
27 | public interface MessageConversionContext {
28 |
29 | /**
30 | * An optional parameter with the payload class to be used by the conversion process.
31 | * @return the payload class.
32 | */
33 | @Nullable
34 | Class> getPayloadClass();
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/support/converter/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Components for converting source messages to Spring messaging messages.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.support.converter;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/support/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Auto-configuration for Amazon SQS (Simple Queue Service) integrations.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.support;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/main/java/io/awspring/cloud/sqs/support/resolver/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Components for resolving method arguments in listener methods.
19 | */
20 | @org.springframework.lang.NonNullApi
21 | @org.springframework.lang.NonNullFields
22 | package io.awspring.cloud.sqs.support.resolver;
23 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/test/resources/junit-platform.properties:
--------------------------------------------------------------------------------
1 | junit.jupiter.execution.parallel.enabled = true
2 | junit.jupiter.execution.parallel.mode.classes.default = concurrent
3 | junit.jupiter.execution.parallel.mode.default = concurrent
4 |
--------------------------------------------------------------------------------
/spring-cloud-aws-sqs/src/test/resources/notificationMessage.json:
--------------------------------------------------------------------------------
1 | {
2 | "Type": "Notification",
3 | "Subject": "IntegrationTestSubject",
4 | "MessageId": "f2c15fec-c617-5b08-b54d-13c4099fec60",
5 | "TopicArn": "arn:aws:sns:eu-west-1:111111111111:mySampleTopic",
6 | "Message": "{\"specversion\": \"1.0.2\", \"data\": {\"firstField\":\"pojoNotificationMessage\",\"secondField\":\"secondValue\"}}",
7 | "Timestamp": "2014-06-28T14:12:24.418Z",
8 | "SignatureVersion": "1",
9 | "Signature": "XDvKSAnhxECrAmyIrs0Dsfbp/tnKD1IvoOOYTU28FtbUoxr/CgziuW87yZwTuSNNbHJbdD3BEjHS0vKewm0xBeQ0PToDkgtoORXo5RWnmShDQ2nhkthFhZnNulKtmFtRogjBtCwbz8sPnbOCSk21ruyXNdV2RUbdDalndAW002CWEQmYMxFSN6OXUtMueuT610aX+tqeYP4Z6+8WTWLWjAuVyy7rOI6KHYBcVDhKtskvTOPZ4tiVohtQdQbO2Gjuh1vblRzzwMkfaoFTSWImd4pFXxEsv/fq9aGIlqq9xEryJ0w2huFwI5gxyhvGt0RnTd9YvmAEC+WzdJDOqaDNxg==",
10 | "SigningCertURL": "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-e372f8ca30337fdb084e8ac449342c77.pem",
11 | "UnsubscribeURL": "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:721324560415:mySampleTopic:9859a6c9-6083-4690-ab02-d1aead3442df"
12 | }
13 |
--------------------------------------------------------------------------------
/spring-cloud-aws-starters/spring-cloud-aws-starter-dynamodb/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | Spring Cloud AWS DynamoDb Starter
14 | spring-cloud-aws-starter-dynamodb
15 |
16 |
17 |
18 | io.awspring.cloud
19 | spring-cloud-aws-dynamodb
20 |
21 |
22 | io.awspring.cloud
23 | spring-cloud-aws-starter
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/spring-cloud-aws-starters/spring-cloud-aws-starter-imds/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws
7 | io.awspring.cloud
8 | 3.1.0-SNAPSHOT
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | Spring Cloud IMDS Starter
14 | spring-cloud-aws-starter-imds
15 |
16 |
17 |
18 | io.awspring.cloud
19 | spring-cloud-aws-starter
20 |
21 |
22 | software.amazon.awssdk
23 | imds
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/spring-cloud-aws-starters/spring-cloud-aws-starter-parameter-store/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | spring-cloud-aws-starter-parameter-store
14 | Spring Cloud AWS Parameter Store Starter
15 |
16 |
17 |
18 | io.awspring.cloud
19 | spring-cloud-aws-parameter-store
20 |
21 |
22 | io.awspring.cloud
23 | spring-cloud-aws-starter
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/spring-cloud-aws-starters/spring-cloud-aws-starter-s3/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | spring-cloud-aws-starter-s3
14 | Spring Cloud AWS S3 Starter
15 |
16 |
17 |
18 | io.awspring.cloud
19 | spring-cloud-aws-s3
20 |
21 |
22 | io.awspring.cloud
23 | spring-cloud-aws-starter
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/spring-cloud-aws-starters/spring-cloud-aws-starter-secrets-manager/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | spring-cloud-aws-starter-secrets-manager
14 | Spring Cloud AWS Secrets Manager Starter
15 |
16 |
17 |
18 | io.awspring.cloud
19 | spring-cloud-aws-secrets-manager
20 |
21 |
22 | io.awspring.cloud
23 | spring-cloud-aws-starter
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/spring-cloud-aws-starters/spring-cloud-aws-starter-ses/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | spring-cloud-aws-starter-ses
14 | Spring Cloud AWS SES Starter
15 | Spring Cloud AWS SES Starter
16 |
17 |
18 |
19 | io.awspring.cloud
20 | spring-cloud-aws-ses
21 |
22 |
23 | io.awspring.cloud
24 | spring-cloud-aws-starter
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/spring-cloud-aws-starters/spring-cloud-aws-starter-sns/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | spring-cloud-aws
8 | io.awspring.cloud
9 | 3.4.0-SNAPSHOT
10 | ../../pom.xml
11 |
12 |
13 | 4.0.0
14 |
15 | spring-cloud-aws-starter-sns
16 | Spring Cloud AWS SNS Starter
17 | Spring Cloud AWS Simple Notification Service Starter
18 |
19 |
20 |
21 | io.awspring.cloud
22 | spring-cloud-aws-starter
23 |
24 |
25 |
26 | io.awspring.cloud
27 | spring-cloud-aws-sns
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/spring-cloud-aws-starters/spring-cloud-aws-starter-sqs/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | spring-cloud-aws
8 | io.awspring.cloud
9 | 3.4.0-SNAPSHOT
10 | ../../pom.xml
11 |
12 |
13 | 4.0.0
14 |
15 | spring-cloud-aws-starter-sqs
16 | Spring Cloud AWS SQS Starter
17 | Spring Cloud AWS Simple Queue Service Starter
18 |
19 |
20 |
21 | io.awspring.cloud
22 | spring-cloud-aws-starter
23 |
24 |
25 | io.awspring.cloud
26 | spring-cloud-aws-sqs
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/spring-cloud-aws-starters/spring-cloud-aws-starter/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | spring-cloud-aws
7 | io.awspring.cloud
8 | 3.4.0-SNAPSHOT
9 | ../../pom.xml
10 |
11 | 4.0.0
12 |
13 | spring-cloud-aws-starter
14 | Spring Cloud AWS Starter
15 |
16 |
17 |
18 | io.awspring.cloud
19 | spring-cloud-aws-autoconfigure
20 |
21 |
22 | io.awspring.cloud
23 | spring-cloud-aws-core
24 |
25 |
26 | org.springframework.boot
27 | spring-boot-starter
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/spring-cloud-aws-test/src/main/resources/META-INF/spring/io.awspring.cloud.test.sqs.AutoConfigureSqs.imports:
--------------------------------------------------------------------------------
1 | org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
2 | io.awspring.cloud.autoconfigure.sqs.SqsAutoConfiguration
3 | io.awspring.cloud.autoconfigure.core.AwsAutoConfiguration
4 | io.awspring.cloud.autoconfigure.core.RegionProviderAutoConfiguration
5 | io.awspring.cloud.autoconfigure.core.CredentialsProviderAutoConfiguration
6 |
--------------------------------------------------------------------------------
/spring-cloud-aws-test/src/test/java/io/awspring/cloud/test/sqs/SampleComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.test.sqs;
17 |
18 | import org.springframework.stereotype.Component;
19 |
20 | @Component
21 | class SampleComponent {
22 |
23 | void save(String message) {
24 |
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/spring-cloud-aws-test/src/test/java/io/awspring/cloud/test/sqs/SqsSampleListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.test.sqs;
17 |
18 | import io.awspring.cloud.sqs.annotation.SqsListener;
19 | import org.springframework.stereotype.Component;
20 |
21 | @Component
22 | class SqsSampleListener {
23 |
24 | static final String QUEUE_NAME = "my-queue";
25 |
26 | private final SampleComponent sampleComponent;
27 |
28 | SqsSampleListener(SampleComponent sampleComponent) {
29 | this.sampleComponent = sampleComponent;
30 | }
31 |
32 | @SqsListener(QUEUE_NAME)
33 | void handle(String message) {
34 | sampleComponent.save(message);
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/spring-cloud-aws-test/src/test/java/io/awspring/cloud/test/sqs/SqsTestApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2022 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.test.sqs;
17 |
18 | import org.springframework.boot.SpringApplication;
19 | import org.springframework.boot.autoconfigure.SpringBootApplication;
20 |
21 | @SpringBootApplication
22 | public class SqsTestApplication {
23 |
24 | public static void main(String[] args) {
25 | SpringApplication.run(SqsTestApplication.class, args);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/spring-cloud-aws-test/src/test/resources/logback-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/spring-cloud-aws-testcontainers/src/main/java/io/awspring/cloud/testcontainers/AwsClientFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013-2024 the original author or authors.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * https://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.awspring.cloud.testcontainers;
17 |
18 | import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder;
19 |
20 | /**
21 | * Provides convenient way to construct AWS SDK clients.
22 | *
23 | * @author Maciej Walkowiak
24 | * @since 3.2.0
25 | */
26 | public interface AwsClientFactory {
27 | > CLIENT create(BUILDER builder);
28 | }
29 |
--------------------------------------------------------------------------------
/spring-cloud-aws-testcontainers/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
2 | io.awspring.cloud.testcontainers.AwsContainerConnectionDetailsFactory
3 |
--------------------------------------------------------------------------------
/spring-cloud-aws-testcontainers/src/test/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------