Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create property to disable the default behaviour of listening to a message bus in digiwf-s3-integration-starter #1702

Open
boal opened this issue May 22, 2024 · 3 comments

Comments

@boal
Copy link
Contributor

boal commented May 22, 2024

Is your feature request related to a problem? Please describe.
The digiwf digiwf-s3-integration-starter is listening as default via spring-cloud-stream to a message broker like kafka. With this feature it is possible to get a presigned-url over a message bus.

On the other hand, the digiwf-s3-integration-starter supports the creation of presigned urls via REST. If an application does not need the feature to connect to a message bus, the starter tries to connect to the bus anyway.

To solve this problem, the digiwf-s3-integration-starter should have a property to disable the default behaviour of listening to the message bus. As a result, an application can use the digiwf-s3-integration-starter without a message bus.

Describe the solution you'd like

Create a property to disable the default behaviour of listening to a message bus via spring-cloud-stream.

Describe alternatives you've considered

The exclusion of the spring-cloud-stream config classes has to be done by the application itself which is using the digiwf-s3-integration-starter. If this exclusion done by the user of the digiwf-s3-integration-starter itself is the prevered solution, the necessary procedure should be documented.

A hardcoded solution to disable the default behaviour with exclusion of specific auto-configuration classes on start up can be found down below.

...
import org.springframework.cloud.stream.config.BindingServiceConfiguration;
import org.springframework.cloud.stream.function.FunctionConfiguration;
...

/**
 * Application class for starting the micro-service.
 */
@SpringBootApplication(
        ...
        // Deactivating the Spring Cloud Stream functionality that is activated by default
        exclude = { BindingServiceConfiguration.class, FunctionConfiguration.class },
       ...
)

An alternative to the hard coded solution is to exclude the classes via the following spring property:

spring:
  autoconfigure:
    exclude:
      # Deactivating the Spring Cloud Stream functionality that is activated by default
      - org.springframework.cloud.stream.config.BindingServiceConfiguration
      - org.springframework.cloud.stream.function.FunctionConfiguration

Acceptance Criteria

  • Alternative 1: Provide an Property to disable the default behaviour of listening to a message bus.
  • Alternative 2: Provide a documentation to disable the default behaviour by the user of the s3 integration starter.

Additional context

n/a

Copy link
Contributor

👋 Thanks for reporting! The maintainers have been notified and will get back to you.

@darenegade
Copy link
Member

@boal We would be very happy to receive a code contribution if you have a need for this feature

@simonhir
Copy link
Member

In my opinion one integration starter should not behave any differently than all the others.
The behaviour with the automatic connection setup is probably caused by the digiwf-message lib.
A cleaner way might be to move the message-starter from the s3-core to the s3-starter and build a second s3-starter just for REST.

darenegade pushed a commit that referenced this issue May 23, 2024
* add additional config to readme

* add additional config to readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants