alan
alan

Reputation: 131

Disabling a web service inbound gateway

I would like to be disable a web service inbound-gateway based on a database flag.

I have achieved this with other inbound adapters (e.g. file) by setting the auto-start attribute based on a SPEL expression which gets the database value.

Any advice on a good way to achieve this? I do not see an auto-start attribute on the ws:inbound-gateway.

Upvotes: 2

Views: 54

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121427

Well, looks like it is a bug there around Lifecycle and in case of stopped state we should return to the client something like HttpStatus.SERVICE_UNAVAILABLE.

Please, raise a JIRA ticket on the matter and we will take care about that soon. I see that <int-http:inbound-gateway> has similar problem, even if auto-startup is exposed there.

As a workaround I see something like ChannelInterceptor on the request-channel for you <int-ws:inbound-gateway>, which checks some variable and throws some exception (NoEndpointFoundException ?) from the preSend() implementation to notify WS client that the service isn't available.

Upvotes: 1

Related Questions