Skip to content

Commit

Permalink
Update reference docs with changes introduced in 2.3.0
Browse files Browse the repository at this point in the history
Closes #39

Co-authored-by: MatejNedic <matejnedic1@gmail.com>
  • Loading branch information
MatejNedic authored and maciejwalkowiak committed Feb 7, 2021
1 parent 2958a11 commit 19a4a54
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/src/main/asciidoc/cognito.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
== OAuth2 with Cognito

Spring Cloud AWS Cognito integration auto-configures `DelegatingOAuth2TokenValidator` and `NimbusJwtDecoder` which are used by Spring Security for OAuth2 integration.

Following configuration properties are available to configure Cognito integration:

[cols="3*", options="header"]
|===
|property
|default
|description

|spring.cloud.aws.security.cognito.app-client-id
|
|You need app client id in order to make api calls towards AWS Cognito

|spring.cloud.aws.security.cognito.user-pool-id
|
|Id of your user pool in AWS Cognito

|spring.cloud.aws.security.algorithm
|RS256
|Specifies which algorithm should JWTDecoder use

|spring.cloud.aws.security.region
|
|Region where user pool is located

|spring.cloud.aws.security.enable
|true
|Enables Cognito integration

|===

2 changes: 2 additions & 0 deletions docs/src/main/asciidoc/elasticache.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ Spring Cloud AWS also support the cache configuration with Java configuration cl
the caching can be configured using the `io.awspring.cloud.cache.config.annotation.EnableElastiCache`
annotation provided by Spring Cloud AWS. The next example shows a configuration of two cache clusters.

CAUTION: Since 2.3.0 `@EnableElastiCache` annotation has been deprecated. We suggest using Spring Boot auto-configuration instead.

[source,java,indent=0]
----
Expand Down
2 changes: 2 additions & 0 deletions docs/src/main/asciidoc/rds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ Spring Cloud AWS also supports the configuration of the data source within an `@
source. Multiple ones can be used to configure more then one data source. Each annotation will generate exactly one
data source bean.

CAUTION: Since 2.3.0 `@EnableRdsInstance` annotation has been deprecated. We suggest using configuration Spring Boot auto-configuration instead.

The class below shows a data source configuration inside a configuration class

[source,java,indent=0]
Expand Down
33 changes: 33 additions & 0 deletions docs/src/main/asciidoc/spring-cloud-aws.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,39 @@ The properties to configure the region are shown below
|Configures a static region for the application. Possible regions are (currently) us-east-1, us-west-1, us-west-2,
eu-west-1, eu-central-1, ap-southeast-1, ap-southeast-1, ap-northeast-1, sa-east-1, cn-north-1 and any custom region
configured with own region meta data

|===

Each integration can now be configured to have a specific region. If region is specified this way it takes priority over default or static region. For example:

[cols="3*", options="header"]
|===
|property
|example
|description

|cloud.aws.sqs.region
|eu-west-1
|Configures a region that SQS integration will use.

|===

===== Enabling integrations

Each integration can be enabled or disabled through a property. By default, all integrations are enabled except `ContextInstanceDataAutoConfiguration`:

[cols="3*", options="header"]
|===
|property
|example
|description

|cloud.aws.sqs.enabled
|false
|Disables SQS integration autoconfiguration.
|===


===== Configuring endpoints
For each integrated AWS service you can configure Spring Cloud AWS to use a custom endpoint using configuration properties. For example:

Expand Down Expand Up @@ -723,6 +754,8 @@ include::s3.adoc[]

include::cloudwatch.adoc[]

include::cognito.adoc[]

== Configuration properties

To see the list of all Spring Cloud AWS related configuration properties please check link:appendix.html[the Appendix page].
37 changes: 37 additions & 0 deletions docs/src/main/asciidoc/sqs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,43 @@ the application, a custom task executor can be set with the `task-executor` attr
<aws-messaging:annotation-driven-queue-listener task-executor="simpleTaskExecutor" />
----

===== Deletion policies
SQS integration supports deletion policies that are used when processing messages.
Note that SQS messages that were not deleted successfully are logged as an error.

[cols="2"]
|===
| `ALWAYS`
| Always deletes a message in case of success (no exception thrown) or failure (exception thrown)

| `NEVER`
| When using this policy method listening must take care of deleting messages.

| `NO_REDRIVE`
| Deletes a message if no redrive policy is defined

| `ON_SUCCESS`
| Deletes a message only when successfully executed by listener method (no exception thrown)

| `DEFAULT`
| Default if not changed is set to `NO_REDRIVE`.
|===

Deletion policy can be specified inside of `@SqsListener`. When policy is explicitly used in `@SqsListener` it takes priority over the global deletion policy.

[source,java,indent=0]
----
@SqsListener(value = "queueName", deletionPolicy = SqsMessageDeletionPolicy.ON_SUCCESS)
----

Global deletion policy which will be used by all `@SqsListener` can be set by using a property:

[source,properties,indent=0]
----
cloud.aws.sqs.handler.default-deletion-policy=ON_SUCCESS
----


===== Message reply
Message listener methods can be annotated with `@SendTo` to send their return value to another channel. The
`SendToHandlerMethodReturnValueHandler` uses the defined messaging template set on the
Expand Down

0 comments on commit 19a4a54

Please sign in to comment.