A
A
Alexander Batula2019-12-23 15:09:38
Java
Alexander Batula, 2019-12-23 15:09:38

There is a restriction on the launch of the application. How to disable the endpoint - y request that accesses the API. But in the case of accessing the database, the query should work?

Hello!
There is a task. I'm blocking the application from starting by listening on a port on a ServerSocket . But by doing so, I block any request from the client until the update process is in progress.
Solution: Can I achieve a situation where only certain endpoints are blocked from restarting, such as an endpoint that accesses a third party API. But I could access the database to get data, as for example.
Could you please advise, does anyone have any ideas?
Thank you all very much.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2019-12-23
@firedragon

Create a blocking task until it is completed, a pending status message is sent.
How to implement? Think for yourself. You can hang up a dictionary, you can save it in the database, you can use the queue

M
mayton2019, 2019-12-25
@mayton2019

Using Java Security Manager, you can selectively block the ability of an application to listen on listener ports, or create connections on its own. But this manager does not distinguish between endpoint and base. He needs numbers like host:port or their combinations and permission rules for the corresponding actions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question