Liferay Microservices Communication Guide (Enterprise Architecture)
Modern portals are no longer monolithic.
Today, Liferay acts as a digital experience layer while business logic lives in independent microservices.
This means the most important design decision becomes:
👉 How Liferay communicates with microservices
In this guide you’ll learn all production communication patterns.
📌 Why Microservices with Liferay?
Old architecture:
Portal → Database → Business Logic inside portal
Modern architecture:
Portal → APIs → Microservices → Databases
Benefits:
Independent deployment
Better scalability
Easier upgrades
Domain separation
🖼️ High Level Architecture
🧠 Communication Patterns Overview
There are 4 enterprise patterns:
REST APIs (most common)
Event-driven messaging
GraphQL gateway
Async job workers
Each has different purpose.
🔹 1️⃣ REST API Communication (Synchronous)
Best for real-time UI responses.
Example:
User updates profile → Call customer service
Liferay Java Client
Use when user waits for response.
🖼️ REST Flow
🔹 2️⃣ Event-Driven Messaging (Asynchronous)
Best for background processing.
Example:
Document upload → processing → notification
Portal publishes event → services react.
Technologies:
Kafka
RabbitMQ
Portal never waits.
🖼️ Event Driven Flow
🔹 3️⃣ GraphQL Gateway
Best for aggregating multiple services.
Instead of 5 REST calls → single query.
Benefits:
Faster frontend
Reduced network calls
🖼️ GraphQL Aggregation
🔹 4️⃣ Background Job Workers
Used for long processing tasks.
Example:
Generate PDF report
Bulk import users
Portal triggers job → worker processes later.
🖼️ Background Worker Flow
⚖️ When to Use What
| Scenario | Best Pattern |
|---|---|
| User waiting | REST |
| Heavy processing | Async events |
| Multiple services | GraphQL |
| Long tasks | Workers |
🔐 Security Considerations
Use:
OAuth2 / OIDC
API Gateway
Token forwarding
Rate limiting
Never expose services directly to internet.
🏆 Best Practices
✔ Keep portal thin
✔ No business logic in Liferay
✔ Use gateway layer
✔ Prefer async when possible
✔ Design domain-based services
⚠️ Common Mistakes
❌ Database sharing
❌ Large synchronous chains
❌ Portal orchestrating everything
❌ Tight coupling APIs
🎯 Conclusion
Liferay should act as:
👉 Experience layer only
Microservices handle business logic.
Correct communication pattern ensures scalable enterprise architecture.
Recommended Reading
Spring Boot + Camunda External Task Pattern
https://shikhanirankari.blogspot.com/2026/02/spring-boot-camunda-external-task.htmlBPMN Event Subprocess Explained
https://shikhanirankari.blogspot.com/2026/02/bpmn-event-subprocess-explained-with.htmlKafka Integration with Liferay
https://shikhanirankari.blogspot.com/2026/02/kafka-integration-with-liferay-complete.html
💼 Professional Support Available
If you are facing issues in real projects related to enterprise backend development or workflow automation, I provide paid consulting, production debugging, project support, and focused trainings.
Technologies covered include Java, Spring Boot, PL/SQL, Azure, CMS and workflow automation (jBPM, Camunda BPM, RHPAM).
📧 Contact: ishikhanirankari@gmail.com | info@realtechnologiesindia.com
🌐 Website: IT Trainings | Digital metal podium
Comments
Post a Comment