2

We have a web application that we would like to run in 'batch' mode, in this mode we dont want any endpoints exposed (for security reasons).

Is this possible in SpringBoot ?

1

1 Answer 1

2

I'd recommend you use profiles on @Controller or @RestController classes:

@Profile("!batch") @RestController public class SomeController { ... } 

This means, SomeController will be created for the application, if the profile is anything but batch.

Then, you can run without batch profile and have the endpoints; or activate the profile via property, environment or from command line with the batch profile:

java -jar some-app.jar --spring.profiles.active=batch 

See Spring API docs for details on how to define and activate profiles

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.