Explore Mica 2.4.x: New Features, Logging, and QR Code Module for Backend Development
This article introduces the Mica microservice framework, covering its origin, version matrix, recent updates—including a QR‑code module and revamped logging configuration—along with usage examples, ecosystem components, and documentation links for developers.
1. Mica (Cloud Mica)
micaoriginated from the internal
lutoolof Dream Technology.
lutoolwas created in 2017, inspired by
jhipster, and gradually formed a core set of microservices. Because the name
lutooldid not match its functionality, it was renamed to
micain 2019, symbolizing a cornerstone of cloud services.
2. Version Information
Note: The mica‑v2.0 branch only receives bug fixes and no new features.
Latest Version
mica Version
Spring Boot Version
Spring Cloud Version
2.4.4-GA
mica 2.4.x
2.4.x
2020
2.1.1-GA
mica 2.0.x~2.1.x
2.2.x ~ 2.3.x
Hoxton
3. Update Log
v2.4.4‑GA – 2021‑03‑28
✨ Added
mica-qrcodemodule for friendly QR code generation and recognition.
✨ Redesigned
mica-logging;
logstash‑logback‑encoderis now optional, logstash and json require manual dependencies.
✨ Optimized
DesensitizationUtilin
mica-core.
✨ Added
ImageUtilto
mica-core.
✨ Updated
mica-ip2regiondatabase file.
🐛 Fixed null‑pointer in
mica-redisScanOptions count.
⬆️ Upgraded
mica-autoto 2.0.4.
⬆️ Upgraded
mica-weixinto 2.0.6.
⬆️ Upgraded Spring Cloud to 2020.0.2.
⬆️ Upgraded Spring Boot to 2.4.4.
4. mica‑logging
4.1 Rules
By default, logs are printed to
console,
all.log, and
error.log.
When set to
jsonformat,
consolelogs (non‑json) and
all.log(json) are printed, suitable for
filebeatcollection.
Enable
logstashto print
consolelogs and output them to
logstash(it is recommended to disable
fileoutput).
After startup, the
consolelog can be disabled via configuration.
Note: When
jsonfile or
logstashis enabled, you must add the
logstash‑logback‑encoderdependency.
4.2 Log Examples
File Log
<code>2021-03-25 21:03:55.275 INFO 2354 --- [XNIO-1 task-3] n.d.mica.mybatis.logger.SqlLogFilter :
======= Sql Logger ======================
select id, parent_id, title, name, seq , path, permission, component, icon, is_frame , type, cache, hidden, status, remark , created_by, created_at, updated_by, updated_at from sys_menu where type in (0, 1) and hidden = false and status = 0
======= Sql Execute Time: 3.438ms =======
</code>JSON Log
<code>{
"loggingLevelRoot":"info",
"appName":"mica-fast",
"profile":"dev",
"level":"INFO",
"logger_name":"o.s.b.w.e.u.UndertowWebServer",
"message":"Undertow started on port(s) 8080 (http)",
"thread_name":"main",
"@timestamp":"2021-03-25T13:10:34.371Z"
}
</code>Logstash Log (stdout)
<code>{
"port" => 57146,
"@version" => "1",
"profile" => "dev",
"logger_name" => "net.dreamlu.mica.mybatis.logger.SqlLogFilter",
"appName" => "mica-fast",
"thread_name" => "XNIO-1 task-3",
"level" => "INFO",
"level_value" => 20000,
"message" => "\n\n======= Sql Logger ======================\nselect id, parent_id, title, name, seq , path, permission, component, icon, is_frame , type, cache, hidden, status, remark , created_by, created_at, updated_by, updated_at from sys_menu where type in (0, 1) and hidden = false and status = 0\n======= Sql Execute Time: 3.438ms =======\n",
"loggingLevelRoot" => "info",
"host" => "localhost",
"requestId" => "d17d635f0a479f01f846199231008ec9",
"@timestamp" => "2021-03-25T13:03:55.275Z"
}
</code>5. mica‑qrcode
This module, heavily modified from nutzmore (nutz‑plugins‑qrcode), offers a simpler API, multiple stream and byte‑array interfaces, and is more microservice‑friendly.
Usage Example:
<code>// Generate QR code
QrCode.form("牛年大吉")
.size(512) // default 512
.backGroundColor(Color.WHITE) // default white
.foreGroundColor(Color.BLACK) // default black
.encode(Charsets.UTF_8) // default UTF_8
.imageFormat("png") // default png
.deleteMargin(true) // remove white margin
.logo("/Users/lcm/Desktop/mica-mqtt-01.png") // logo, supports URL, file, stream
.toFile("/Users/lcm/Desktop/xxx1.png"); // write out, also toImage, toStream, toBytes
// Read QR code
String text = QrCode.read("/Users/lcm/Desktop/xxx1.png");
System.out.println(text);
</code>6. Mica Ecosystem
mica-auto (Spring Boot starter): https://gitee.com/596392912/mica-auto
mica-weixin (JFinal Weixin Spring Boot starter): https://gitee.com/596392912/mica-weixin
mica-mqtt (MQTT component based on t‑io): https://gitee.com/596392912/mica-mqtt
Spring Cloud microservice HTTP/2 solution (h2c): https://gitee.com/596392912/spring-cloud-java11
7. Documentation
Mica source code Gitee: https://gitee.com/596392912/mica
Mica source code GitHub: https://github.com/lets-mica
Official docs: http://wiki.dreamlu.net
Yuque docs (subscribe): https://www.yuque.com/dreamlu
Example project: https://github.com/lets-mica/mica-example
Java Architecture Diary
Committed to sharing original, high‑quality technical articles; no fluff or promotional content.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.