Using a practical example, explore a crucial issue in Rust's BTreeSet: the impact of implementing Ord and PartialOrd traits differently for the same type.
Clarify why we need to transfer data from one point to another, look at traditional approaches, and describe how to build a real-time streaming ETL process.
Not many people talk about how to create a Spring Boot configuration server with a database as opposed to a file system or git repository. But here's how to do it.
you are right, as we already discussed with @Cayo Souza, and @Ivan Karamazov, Optional would be a better solution. Besides I do not think that the solution without Optional is a terrible one.
Firstly, I am not a person who hates exceptions. I think when there is an exceptional case we should use exception, but we should not use exception for control flow, otherwise, the exception becomes like the goto keyword.
When it comes to readability, every function should have one kind of return type, but if we use exception (regardless checked or not), our function will have more than one return type, either an exception or a data type. Besides I agree with your comment about using checked exceptions over unchecked ones.
on the clientside you don't need to care about the failover, besides on the serverside if any of the child process dies, then the cluster module will forward requests to the existing ones; also it will emit the 'exit' event, so you can catch up this event re-start the died process again, watch the following code.
cluster.on('exit', function(worker, code, signal) { console.log('worker %d died (%s). restarting...', worker.process.pid, signal || code); cluster.fork(); });
Comments
Nov 05, 2019 · Dursun Koç
Nov 04, 2019 · Dursun Koç
Thanks for your comment :).
Firstly, I am not a person who hates exceptions. I think when there is an exceptional case we should use exception, but we should not use exception for control flow, otherwise, the exception becomes like the goto keyword.
When it comes to readability, every function should have one kind of return type, but if we use exception (regardless checked or not), our function will have more than one return type, either an exception or a data type. Besides I agree with your comment about using checked exceptions over unchecked ones.
Nov 04, 2019 · Dursun Koç
I see you, you mean the `findUserNoEx` method is problematic. how about this one, or do you have something else in your mind?
private static String findUserNoEx(String name) {
return name == null ? "" : name;
}
Oct 29, 2019 · Dursun Koç
As stated in the article, if it is an exceptional case then use exception, if it is not, then check your design.
Oct 29, 2019 · Dursun Koç
returning null would cause another null check on the client. Think "" as a default value. Afterall I think "Optional" would be a better solution.
Apr 12, 2019 · Dursun Koç
sorry for late response:
here you can find a sample project
https://github.com/dursunkoc/samplespringbootdbconfigserver
Nov 13, 2015 · Dursun Koç
Thanks for your advices, I have just edited sample codes for indentation.
I think i missed to mention that my OS is windows and RR is not the default scheduling policy.
This article is a gentle introduction, so I did not mention about the setupMaster. Maybe in a detailed article we can discuss setupMaster as well.
Nov 10, 2015 · Dursun Koç
on the clientside you don't need to care about the failover, besides on the serverside if any of the child process dies, then the cluster module will forward requests to the existing ones; also it will emit the 'exit' event, so you can catch up this event re-start the died process again, watch the following code.