Read about microservices best practices for java, The latest news, videos, and discussion topics about microservices best practices for java from alibabacloud.com
will reveal the internal work and failure of the application, which can be used by attackers to further attack the application. Therefore, we need to treat the logs with care and keep them safe. Information that should not be logged is as follows:
Credit card number
Social Security Number
Password
However, the following types of information should not be written to the log:
Session identifiers
Authorizing tokens
Personal name
Phone number
Informati
In fact, work so long has not been clear how to deal with the exception, by chance to see a foreign language feeling is good, then translated it down, the original link is located at the end of this article.Handling Exceptions in Java is not an easy thing to do, and not only do beginners find it difficult to understand that even experienced developers spend hours discussing whether an exception should be thrown or disposed of.That's why most developme
[Java] itoo project practices: optimized collection of millions of data queries and itoo data queries
1. To optimize the query, you should consider creating an index on the columns involved in where and order.
2. Try to avoid null value determination on the field in the where clause, for example, select id from t wherenum is null.
You can set the default value 0 on num to make sure that the num column in t
String j = stringutils.join (new string[] {"A", "B", "C"}, ","); System.out.println (j); // A, B, C 8. Converting an array list to arrays String[] Stringarray = {"A", "B", "C", "D", "E" }; ArrayListNew arraylist(arrays.aslist (Stringarray)); New string[arraylist.size ()]; Arraylist.toarray (Stringarr); for (String S:stringarr) System.out.println (s); 9. Converting an array to set (set) New Hashset(Arrays.aslist (Stringarray)); SYSTEM.
Whether you're a novice or a senior programmer, it's always a good thing to review the practice of exception handling, because it ensures that you and your team can handle it when you're having problems. Handling Exceptions in Java is not an easy thing to do. Beginners find handling anomalies difficult to understand, and even senior developers spend hours discussing whether throwing exceptions or exceptions should be thrown.That's why most development
Preface
To learn any technology that is a little difficult, you must make a rational analysis of it, and then make a decisive decision-> that is, what people often say is "Seeking for profit "; although this series involves socket-related knowledge, it is a kind of state of mind that I want to share with the programmers before learning: learning is a step-by-step process, and the mentality should be adjusted at any time, keep your defense against arrogance and rashness. For example, I recen
This article is the third of the GC expert series. In the first understanding of Java garbage Collection, we learned several different GC algorithm processing processes, the way GC works, the difference between the new generation and the old age. So, you should have known about the 5 GC types in JDK 7, and the performance impact of each GC.The second monitoring of Java garbage collection describes how the J
1. Preface
Java application is a very common problem, how to read the Jar/war package and the path of the configuration file, different people according to different practices summed up the different scenarios, but others application will be due to the environment and other differences to find a variety of problems, this article from the principle of interpretation of best practice.
2. Referen
StringBuilder instead of string objects at the right time, single-threaded using StringBuilder, stringbuffer in multithreaded situations.
Allocate StringBuffer, arrays, array,vector and other capacities in advanceFor objects that need to be allocated continuously, it is better to allocate the capacity ahead of time, generally the default initial capacity is relatively small, such as the capacity of StringBuffer is only 16, if the default capacity is easy to reallocate after the full capacity
factor, ebay refers to the existing application porting and training developers in the implementation of YA Xu carefully considered.?? The characteristics of the SOA platform for a basic large-scale application mentioned above, and for a more complete SOA platform, the author believes that there are also the following points:
Support cluster environment: Software load Balancing, service interface or method level routing strategy, etc.
Perfect service governance: including dependenc
(); } The above task contains an application for an external class instance, which will cause the reference to not be reclaimed by the GC immediately. Because the timer will remain TimerTask is released after a specified time. Therefore, the external class instance corresponding to the task will be reclaimed after 5 minutes. The correct wording: Timertasktask=newjob (this); timer.schedule (task,300000l); Try{dosomething (); }finally {task.cancel ();} staticclassJobextendsTimerTask{ privateMyCla
list loaded into memory, accidentally checked 100w data, and check more frequently, the memory burst. There is this risk of changing the composition page query.Eight: Consider avoiding long connections or long transactions inside a transaction, which can affect performance if a large number of this situation takes up a data connection. Some unnecessary logic can be placed outside of the transaction execution.IX: A normal indexb Uniqueness index with unique parameter, primary key.C Single-colum
class does not lineThe order of the process to obtain the license to do any guarantee. In particular, intrusion is allowed, meaning that it can be in front of the waiting threadacquire()assigns a license to the calling thread, which logically means that the new thread puts itself in the waiting thread queue's head. When fair is set to true, the semaphore is guaranteed for any 获取 thread that invokes the method, asThe order in which they call these methods (i.e., FIFO) to select a thread and obta
of the busy cycleA looping statement designed to consume time22. The method that lets one thread wait for another thread to dieJoin ()23. The thread method that lets you sleepSleep ()24. Write an application called Intsleep, which creates a background thread, continuously prints out Hello, and then sleeps 100ms. After sleeping 2s, the default main thread should interrupt the background thread, which jumps out of the loop after printing out the interruptedpublic class Intsleep {public static voi
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.