Original Java annotations implement a configurable thread pool

The introduction project requires multithreading to execute some tasks for the convenience of each service. < span style=”color:#CD000…

The 2019-01-15 19:12:56

Read the number 9181

Comments on 7

Original SpringBoot 2.0 integration with Ali Cloud OSS

Preface Many websites/applications are deployed with static and dynamic separation architecture. The host uses Ali Cloud ECS, using CDN to do static content distribution, but static files are still stored in ECS, using Nginx to do static and static separation. Ali Cloud OSS, a massive, secure, low-cost, highly reliable cloud storage service, providing 99.9999999999% of data can…

The 2019-10-24 14:03:53

Read the number 28

Comments on 0

Original Redis designed goods in seconds

Foreword: recently came a new demand, need to develop a commodity second kill module, and the demand is urgent to be on-line as soon as possible. Scheme 1: Database lock control, obtain the number of seconds kill goods and lock, if the number is greater than zero, the success, otherwise seconds kill failed. @Override @Transactional public Result startk…

The 2019-10-22 11:00:25

Read the number 33

Comments on 0

Original SpringBoot Nacos registry

In the previous Dubbo service development, We generally used Zookeeper as the registry, and also needed to deploy a Dubbo monitoring center and management background. Nacos is an open source project of Alibaba, full name Naming Configuration Service, specializing in the field of Service discovery and Configuration management. .

The 2019-08-29 11:42:08

Read the number 208

Comments on 0

Original Java concurrency AtomicInteger

AtomicInteger is a class specifically designed to update integer designs in a thread-safe manner. Why can’t we simply use volatile int? AtomicInteger // Counter volatile int public Class CounterNotThreadSafe {…

The 2019-07-30 19:21:05

Read the number 36

Comments on 0

Original Redis expiration policy

Redis Expiration Policy The redis expiration policy is either periodic deletion or lazy deletion. The so-called periodic deletion means that redis randomly selects some keys with expiration time every 100ms by default, checks whether they are expired, and deletes them if they are expired. Suppose there are 10W keys in Redis, all set to expire, and every few hundred milliseconds, you check 1…

The 2019-07-09 19:55:07

Read the number 246

Comments on 0

Reprint distributed transaction solutions

Distributed transactions are implemented in the following five schemes: XA Scheme TCC scheme Local message table Reliable message Final Consistency Scheme Maximum effort Notification scheme Two-phase commit scheme /XA scheme the XA scheme is called: Two-phase commit, with the concept of a transaction manager that coordinates transactions between multiple databases (resource managers), the transaction manager first asks each database are you ready…

The 2019-06-26 19:19:49

Read the number 457

Comments on 0

Original @SELECT annotated dynamic SQL questions

Foreword: a junior partner feedback use org. Apache. Ibatis. Annotations. Select SQL dynamic joining together into the parameter is empty when the query failed. tag around @select (&q…

The 2019-06-25 18:12:52

Read the number 662

Comments on 0

Local variable a defined in an enclosing scope must be final or effectively final

Foreword: Some students feedback that the Stream loop processing set, may need to operate on an intermediate variable to copy or compare operations. Effectively final: when we add final to a variable (cannot assign…

The 2019-06-19 13:07:02

Read the number 1541

Comments on 0

Original Blockchain Wallet — BTC Java Edition offline signed transactions

Since I have not been engaged in blockchain-related projects, I will provide some help to puzzled partners ~~ I will not explain too much about offline transactions ~ to put it simply, I will take an unissued transaction record for private key signature and broadcast to the chain. It is mainly used for utXO linking of blockchain offline transactions. Nonsense not much to say, directly on the code: UnspentUtxo transaction inquiry reference: https://blog….

The 2019-06-14 18:36:47

Read the number 7256

Comments on 15

Original CountDownLatch multitask parallel processing

Recently, we are doing a function of raw data statistics. The user sets relevant parameters through the foreground, and returns data through the background real-time statistics. The best user experience is that every operation can display data in real time, within 3 seconds should be within the tolerance range of users. Therefore, to make a product, not only user interaction design should be considered, but also back-end optimization is indispensable. The main…

The 2019-06-13 16:49:26

Read the number 526

Comments on 0

Original Docker learning to build ActiveMQ message service

ActiveMQ is the most popular and powerful open source message bus produced by Apache. ActiveMQ is a JMS Provider implementation that fully supports JMS1.1 and J2EE 1.4 specifications. Although JMS specifications have been issued for a long time, JMS still plays a special role in today’s J2EE applications. In production projects, many…

The 2019-06-13 16:36:11

Read the number 524

Comments on 0

Original query BTC, USDT unspent transaction information

Foreword: Some students do not want to build a node to synchronize data, you can use the call tripartite interface for signature transactions, provide the following API address. There will be persistent updates. Test chain: 1. The blockchain – testnet (do not check node data will appear) : https://testnet.blockchain.info/unspent?activ…

The 2019-06-13 14:27:45

Read the number 1144

Comments on 0

Original use of BULL to convert Java beans

BULL (Bean Utils Light Library) is a Java-bean-to-java-bean converter that copies data recursively from one object to another. Features: Universal, flexible, reusable, configurable, extremely fast. To convert Mutable, Immutable, and Mixed without configuration.

The 2019-05-31 11:03:49

Read the number 733

Comments on 0

Driver’. This is deprecated. The new Driver class is’ com.mysql.cj.jdb

Make a note ~ SpringBoot project startup prompts a WARN message: Loading class `com.mysql.jdbc.Driver’. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver’. The…

The 2019-04-18 10:46:09

Read the number 1088

Comments on 0

Original MySQL master/slave replication configuration

MySQL master-slave replication uses a separate Alibaba Cloud ECS instance to provide a clustered environment for your database. Copy data to multiple computers in real time for backup services, analyze or extend, and create different nodes for multiple applications. Setting up and configuring MySQL Master on Ubuntu 16.04 server

The 2019-04-02 16:18:26

Read the number 1837

Comments on 0

Original Spring Retry Retry mechanism

In the microservices world, one method of communication is synchronous. The truth is that we cannot avoid network failures, temporary service outages (due to reboots or crashes). When the client needs real-time data and the downstream service is temporarily unresponsive, it can affect the user experience, so a retry mechanism should be created, and There are many solutions available in Java. Retries can block resources and prevent…

The 2019-03-29 15:33:34

Read the number 2146

Comments on 0

Original Java12 switch expression

Here is an example of the new Java 12 feature “Switch Expressions” and how it can be used in conjunction with the Stream operation and some other Stream operations to make the code more concise. Public String newSwitch(I…) public String newSwitch(I…

The 2019-03-28 14:35:46

Read the number 2879

Comments on 0

Exclusive lock/shared lock + fair/unfair lock + optimistic lock/pessimistic lock + thread lock

In Java concurrency scenarios, there are various types of locks involved such as fair locks, optimistic locks, pessimistic locks, and so on. This article introduces the types of locks: Fair lock/unfair lock Reentrant lock Exclusive lock/Shared lock Optimistic lock/Pessimistic lock Segmental lock spin lock Thread lock Optimistic lock VS Pessimistic lock Optimistic lock and pessimistic lock is a broad concept, reflecting the different perspectives of thread synchronization.

The 2019-03-28 10:57:58

Read the number 2332

Comments on 0

Several distributed queues from original Redisson

Preamble: message queue is very easy to understand, inconceivable is queue execution. Redisson queues are similar to implementing Java interfaces such as Queue and BlockingQueue to handle complex business logic based on the Redisson Api. 1. The RQueue object in Queue Redisson implements the java.util.Queue interface. The team…

The 2019-03-28 10:28:12

Read the number 3608

Comments on 0

  • The previous page
  • 1
  • 2
  • 3
  • .
  • 7
  • The next page