Skip to content

Allow setting the queue not found strategy via an auto-configuration property #1175

Closed
@electronic-dk

Description

@electronic-dk

Type: Feature

Is your feature request related to a problem? Please describe.
Setting the queue not found strategy is only possible either by creating a container bean or a container factory. It's not a big deal, but I would like to be able to set it via an auto-configuration property and keep relying on spring-sqs module's autoconfiguration to create all the necessary beans.

Describe the solution you'd like
Expose a new auto-configuration property, e.g. spring.cloud.aws.sqs.queue-not-found-strategy

Describe alternatives you've considered
It's possible to set this strategy when creating a listener container or container factory bean, e.g.:

@Bean
public SqsMessageListenerContainerFactory<Object> defaultSqsListenerContainerFactory(SqsAsyncClient sqsAsyncClient) {
    return SqsMessageListenerContainerFactory
            .builder()
            .configure(builder -> builder.queueNotFoundStrategy(QueueNotFoundStrategy.FAIL))
            .sqsAsyncClient(sqsAsyncClient)
            .build();
    }

It's a viable solution, but I feel like it would be more convenient to set the strategy via a property and keep my configuration classes cleaner by relying on auto-configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: sqsSQS integration related issuetype: enhancementSmaller enhancement in existing integration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions