How to dynamically modify the spring configuration file

Updated on technology 2024-03-19
9 answers
  1. Anonymous users2024-02-07

    This is very easy to implement, save this expression in the database, and of course read the configuration file every time it starts up (when the server starts).

    Write a restart method: cronexpressionThis comes in from the outside.

    The update expression updates the fields in the database.

    string triggernames = ;

    string triggername = triggernames[0];

    crontrigger trigger = (crontrigger) to set a new expression for trigger.

    Restart the new trigger

    trigger);

  2. Anonymous users2024-02-06

    I've never heard of something that can be dynamic, so think of another solution!

  3. Anonymous users2024-02-05

    project,Need to access multiple databases,And need to be cautious when the server is running without restarting,Dynamically modify the data source configured in spring datasource,I found a lot of information on the Internet,Finally, I found a method that suits me,The following summary。 Spring's configuration file is loaded into memory when the container starts.

  4. Anonymous users2024-02-04

    We have a project that dynamically generates a database for different registered users. So you have to generate a new data source in the system, all without restarting the service. I am now adding the data source configuration in the spring configuration file according to the different registered users, but the corresponding content cannot be obtained after modifying the spring configuration file.

    How can I get the modified configuration file again? Or do you want to do it in some other way?

    Question added: Thank you for your help, according to your scheme, the problem has been solved. I generate the corresponding configuration file according to different users, and then generate an applicationcontext for the corresponding user and put it into the application pool for management.

  5. Anonymous users2024-02-03

    rootroot

    This is to get the slave library of this identifier according to the identifier in the program, so as to change the url, username, password in the XML and then make the modification work without restarting the service.

  6. Anonymous users2024-02-02

    Modify Spring's configuration file ? This is a feature of web containers, such as Jetty, which can be used to change the configuration profile of the configuration position segment state and wait for x seconds to reload the configuration file.

  7. Anonymous users2024-02-01

    What is a dynamic scheduled task: It is formulated and generated by the customer, and the server only knows what task to execute, but the timing of the task is uncertain (it is set by the customer). In this way, you can't modify the configuration file, and add a trigger for each customized scheduled task.

  8. Anonymous users2024-01-31

    Then there is only modification**. If you just use JDBC, it's fine, but if you use Spring, it's not easy. Because it's spring to read the configuration file, not you, if you use pure jdbc, you can read it regularly.

    I'm asking weakly, why can't you restart the service, your configuration file has been modified, and it doesn't restart, it doesn't make sense in theory.

  9. Anonymous users2024-01-30

    It's impossible. No way.

Related questions
5 answers2024-03-19

I think LZ you deserve it well.,The display 19-inch is already the mainstream.,It's not very big.,And if you want to play games.,I recommend going on4860.,Just around the budget.,It's basically no problem to play all the mainstream games.。

4 answers2024-03-19

How do motion comics design anime? The role of anime is to convey information through the senses of sight, hearing, and text, performance, emotion, etc. Animation is a kind of three-dimensional design art carried out in the two-dimensional plane space, which is more three-dimensional and dynamic, with a sense of three-dimensional collapse. >>>More

13 answers2024-03-19

Method 1: Dot and add blur effects!

Due to the lack of PR plugins, this section can be done with AAE! It's as simple as adding a special effect and watching the effect. >>>More

15 answers2024-03-19

Eh, subscript access struct members? Real people too;

If you define it: subjecttwo p; with'.'operator accesses its members, such as: >>>More

5 answers2024-03-19

Let's take drawing a bolt as an example. The first thing to do is to draw a basic figure of a bolt. >>>More