You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ServiceInstanceIdRegistry allows you to receive unique id from pool of generated ids on demand.
It is handy when you do not care about id numbers, acquired by your application instances:
Application A
fun main(){
// 7
val appId = registry.register("my-app")
}
Application B
fun main(){
//13
val appId = registry.register("my-app")
}
It is useful to have an opportunity to explicitly select which id which application instance will receive.
For example you have a cluster of applications of two types: red-apps and black-apps.
And to distinct them by id you can give them particular ids:
We can add new method to registry that allows user explicitly provide desirable identifier.
Then we can provide this id through command arguments during application startup.
java -jar red-app.jar --desirableId=10
fun main(args: String[]){
val desirableId = idFromArguments(args)
//10
val appId = registry.register("red-app", desirableId)
}
This way we can control what id will be received by application during startup.
It is very handy during problem investigations: by id of application it is easily to detect a node.
The text was updated successfully, but these errors were encountered:
ServiceInstanceIdRegistry allows you to receive unique id from pool of generated ids on demand.
It is handy when you do not care about id numbers, acquired by your application instances:
Application A
Application B
It is useful to have an opportunity to explicitly select which id which application instance will receive.
For example you have a cluster of applications of two types: red-apps and black-apps.
And to distinct them by id you can give them particular ids:
We can add new method to registry that allows user explicitly provide desirable identifier.
Then we can provide this id through command arguments during application startup.
This way we can control what id will be received by application during startup.
It is very handy during problem investigations: by id of application it is easily to detect a node.
The text was updated successfully, but these errors were encountered: