0

I have trouble in applying Java Spring boots with some rules: - If parameters values do not match the specifics possible values you should return HTTP status code 400("Bad Request") - Responses should have Content-Type header with approriate value(application/json) - If you need to create multiple classes - You can use only the following libraries:

  • Spring web MVC (v.5.0.7.Release)

  • Faster XML Jackson, Jackson datatype JSR310

I need detailed method read healtcheck with message: {"currentTime" : "2020-06-01T20:45:35Z,"application":"OK"}

fan
  • 3
  • 3

1 Answers1

0

You can customise the health check endpoint by implementing HealthIndicator and providing custom logic.

For example, you can check out simple implementation here (https://www.amitph.com/custom-health-check-spring-boot-actuator/).

  • I've tried, with a couple of scenarios. Could you please come in @Restcontroller – fan Jun 02 '20 at 00:54
  • I've tried, with a couple of scenarios. Could you please come in @Restcontroller class HealthcheckController {@Getmapping(value = "/healthcheck", produces=MediaType.XML.Value) Public Void() { return "healtcheck" + new date format(); }} – fan Jun 02 '20 at 01:07
  • That's a different understanding of your question. If you want to create a controller with 'healthcheck' as a request URI, then probably yes. You need to create one wrapper for ({"currentTime" : "2020-06-01T20:45:35Z,"application":"OK"}) with simple class with containing fields as data member . You can feed the values and supply as a response. – Dharmendra Vishwakarma Jun 02 '20 at 21:59