GitHub Repository
https://github.com/SkafteDev/J-OCPP-201-Library
Project Description
A Java OCPP 2.0.1 library built for decoupled architectures operating with broker-based systems instead of WebSockets. It includes the full OCPP message model, strongly typed Java classes, and an RPC framework that keeps protocol logic separate from the transport layer. The library comes with a ready-to-use NATS.io integration, making it easy to plug charging stations and backend services into an event-driven architecture. This helps avoid managing WebSocket connections and makes it simpler for multiple services like billing, monitoring, and analytics, to listen to the same OCPP traffic. NATS brings scalability, flexible pub/sub routing, and optional persistence through JetStream. The main trade-offs are running NATS.io middleware and designing how OCPP sessions map to subjects, which WebSockets handle automatically. The transport method can be changed, for example between MQTT, WebSockets or in-memory (for testing) when needed.
Feature Highlights
- Full OCPP 2.0.1 message model with auto-generated, type-safe Java POJOs.
- Transport-agnostic core that cleanly separates protocol logic from networking.
- Built-in NATS.io transport showing how to run OCPP on a broker instead of WebSockets.
- Simple abstractions for calls, call results, and session handling.
- Example Charging Station and CSMS implementations for both offline and NATS-based setups.