Using multiple instances of graphhopper with Spring

Is it possible to work with multiple graphopper instances for each map?
I am writing a spring application and created a bean graphopper to implement api.
Is it possible to add graphopper beans dynamically, and if so, how best to do it?
Thanks in advance!

It is possible.
The question is, want you to switch between in a runtime or you want to use them as a couple services working in the same time (i.e. round robin strategy).
The solution which is familiar to me is to deploy each graphhopper as a docker container with exposing different ports and connect to them from java application with [url]:[port]. If you want to change port value during runtime, you can export that value to the configuration .yml file, than read that value with @Value annotations and mark that class with @RefreshScope annotation -> than you could change your port dynamically.
Let me know if that somehow help you.

Hey, Hi!
Thank you so much. This is good idea!
At the moment, I have combined the maps that I need into one. But somehow I will implement it in the way you described.
Thanks again) Have a nice day

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.