Skip to content

bassrehab/smpp-core

Repository files navigation

SMPP Gateway

Maven Central Build Status License Java javadoc GitHub stars GitHub issues Documentation

The modern replacement for Cloudhopper - A clean-room Java 21 implementation of the SMPP protocol.

Modern Java 21 implementation of the SMPP (Short Message Peer-to-Peer) protocol for high-performance SMS messaging.

Features

  • Java 21: Leverages virtual threads, records, sealed interfaces
  • Type-safe PDUs: Immutable records with builders
  • Complete protocol support: SMPP 3.3, 3.4, and 5.0
  • High performance: Netty 4.1.x based transport
  • Observable: Micrometer metrics integration

Performance

Benchmark results on Apple M4 (JMH, single thread):

Benchmark Throughput Description
PDU Encode 1.5M ops/s SubmitSm → ByteBuf
PDU Decode 1.8M ops/s ByteBuf → SubmitSm
Codec Round-trip 750K ops/s Encode + Decode
Network Round-trip 25K ops/s Full TCP client↔server
Benchmark                                    Mode  Cnt        Score   Units
PduCodecBenchmark.encodeSubmitSm            thrpt    5  1,534,219   ops/s
PduCodecBenchmark.decodeSubmitSm            thrpt    5  1,823,456   ops/s
PduCodecBenchmark.roundTripSubmitSm         thrpt    5    751,234   ops/s
NetworkThroughputBenchmark.submitSmSync     thrpt    2     25,090   ops/s

Run benchmarks yourself:

mvn package -pl smpp-benchmarks -am -DskipTests
java -jar smpp-benchmarks/target/smpp-benchmarks.jar

Modules

Module Description
smpp-core PDU definitions, codecs, types, state machine
smpp-netty Netty-based transport layer
smpp-server SMPP server with virtual threads
smpp-client SMPP client with auto-reconnect
smpp-metrics Micrometer metrics integration

Quick Start

Maven

<dependency>
    <groupId>io.smppgateway</groupId>
    <artifactId>smpp-core</artifactId>
    <version>1.0.8</version>
</dependency>

Creating a Server

SmppServer server = SmppServer.builder()
    .port(2775)
    .systemId("my-smsc")
    .handler(new MyServerHandler())
    .build();

server.start();

Creating a Client

SmppClient client = SmppClient.builder()
    .host("localhost")
    .port(2775)
    .systemId("my-esme")
    .password("secret")
    .bindType(SmppBindType.TRANSCEIVER)
    .build();

SmppClientSession session = client.connect();

SubmitSm submitSm = SubmitSm.builder()
    .sourceAddress(Address.alphanumeric("SENDER"))
    .destAddress(Address.international("+14155551234"))
    .shortMessage("Hello World!".getBytes())
    .requestDeliveryReceipt()
    .build();

SubmitSmResp response = session.send(submitSm, Duration.ofSeconds(10));

Requirements

  • Java 21 or later
  • Maven 3.8+

Building

mvn clean install

Author

Subhadip Mitra

License

Apache License 2.0

Links

About

The modern replacement for Cloudhopper - A clean-room Java 21 implementation of the SMPP protocol.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages