What Is Mica? A Lightweight Java Microservice Core for Spring Boot & Cloud

Discover Mica, a lightweight Java microservice core built on Spring Boot and Spring Cloud, its dependencies, versioning scheme, ip2region integration, configuration tips, and usage examples, providing a streamlined foundation for cloud-native applications.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
What Is Mica? A Lightweight Java Microservice Core for Spring Boot & Cloud

Mica (Cloud Mother)

Mica originated from the internal lutool project of Dream Technology, created in 2017 inspired by JHipster and evolved into a core set of microservices. It was renamed to Mica in 2019 when open‑sourced, symbolizing a cornerstone for cloud services.

Core Dependencies of Mica 2.x

Mica is built on Java 8, supports both traditional Servlet and Reactive (WebFlux). It uses mica‑auto to generate spring.factories and spring‑devtools.properties, and depends only on Spring Boot and the Spring Cloud suite, without third‑party libraries.

Spring Boot 2.2.x

Mica 2.0.1 Release Notes

Open‑source mica‑ip2region component.

Optimized mica‑core: renamed R.isNotSuccess to isFail.

Fixed jackson class info issue in mica‑redis.

Fixed jackson findAndRegisterModules issue in mica‑redis.

Replaced Travis CI with GitHub Actions for building and automatic snapshot releases.

Updated Spring Boot to 2.2.7.RELEASE.

Version Number Conventions

The release version follows the pattern x.x.x.YYYYMMDD to avoid conflicts with internal numbering. Snapshot versions use the pattern x.x.x‑SNAPSHOT and are built automatically on each commit.

Reference: mica‑bom

Using mica-bom simplifies dependency and version management, preventing JAR conflicts.

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>net.dreamlu</groupId>
      <artifactId>mica-bom</artifactId>
      <version>2.0.1.20200510</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

Note: Maven resolves dependencies in the order they are declared, so add mica, then spring boot, then spring cloud sequentially.

Best ip2region Spring Starter

Maven

<dependency>
  <groupId>net.dreamlu</groupId>
  <artifactId>mica-ip2region</artifactId>
  <version>${version}</version>
</dependency>

Gradle

compile("net.dreamlu:mica-ip2region:${version}")

Configuration (Built‑in, ignore)

mica.ip2region.db-file-location (default: classpath:ip2region/ip2region.db) – location of the ip2region database file.

Maven custom ip2region.db considerations: The default resources filter may alter the DB file. Add the following plugin configuration to prevent filtering:

<plugin>
  <artifactId>maven-resources-plugin</artifactId>
  <configuration>
    <nonFilteredFileExtensions>
      <nonFilteredFileExtension>db</nonFilteredFileExtension>
    </nonFilteredFileExtensions>
  </configuration>
</plugin>

About ip2region

The ip2region source code is hosted at https://gitee.com/lionsoul/ip2region. The ip2region.db file is synchronized automatically, usually requiring no manual configuration.

Usage Documentation

Inject Bean

@Autowired
private Ip2regionSearcher regionSearcher;

Method Overview

@Nullable
IpInfo memorySearch(long ip);
@Nullable
IpInfo memorySearch(String ip);
@Nullable
IpInfo getByIndexPtr(long ptr);
@Nullable
IpInfo btreeSearch(long ip);
@Nullable
IpInfo btreeSearch(String ip);
@Nullable
IpInfo binarySearch(long ip);
@Nullable
IpInfo binarySearch(String ip);

Documentation Links

Documentation site: https://www.yuque.com/dreamlu

Example project: https://github.com/lets-mica/mica-example

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Javadependency managementSpring BootSpring Cloudip2regionmica
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.