Hi, i just want to finish my j2ee application that have to receive many sms from mobile users of network operator and store these on database. I try to google it but i found nothing about this. Please, i just need an orientation step by step (Excuse me for my bad english i speek currently french). Thanks

Dani AI

Generated

A concise, practical orientation for (building on the jSMPP approach you mentioned and the advice from and ): the usual production pattern is (1) connect to the operator’s SMSC via SMPP, (2) accept incoming PDUs (DELIVER_SM) in a tiny callback, (3) offload full processing to a worker pool and persist the message, and (4) handle encoding/concatenation, DLRs and connection health. SMPP is the industry protocol for this and jSMPP is a mature Java library that exposes SMPPSession and MessageReceiverListener for incoming messages; if the operator cannot give an SMPP bind, use an SMS gateway that delivers inbound SMS via HTTP webhooks. (smpp.org)

Minimal step-by-step (developer-friendly):

  • Get operator credentials: system_id/password, allowed bind mode (RX/TRX), IP whitelist and TLS/port details — operators usually require these. Test locally with an SMSC simulator (SMPPSim) or a gateway (Kannel). (bumblebee.redoc.ly)
  • In code: open an SMPPSession, bind (BIND_TRX or BIND_RX as agreed), register a MessageReceiverListener and inside its onAcceptDeliverSm quickly capture the raw bytes (short_message or optional Message_payload) then submit a Runnable to an ExecutorService to decode and save to DB. Don’t do DB work inside the listener — jSMPP explicitly warns the listener work should be short. (harshadura.github.io)

Example (illustrative) — keep this logic tiny and robust:

// register listener (pseudocode)
session.setMessageReceiverListener(new MessageReceiverListener() {
  public void onAcceptDeliverSm(DeliverSm d) throws ProcessRequestException {
    byte[] userData = Optional.ofNullable(
        d.getOptionalParameter(OptionalParameter.Message_payload.class))
        .map(p -> p.getValue())
        .orElse(d.getShortMessage());
    executor.submit(() -> storeInbound(d.getSourceAddr(), userData, d.getDataCoding()));
  }
});

Persist a simple table (example): inbound_sms(id, source_addr, dest_addr, data_coding, sar_ref, sar_seq, sar_total, payload, received_at) — store SAR/UDH fields so you can reassemble long messages. Be careful with encodings: data_coding / UDH determine GSM-7 vs UCS-2 and whether payload lives in short_message or the message_payload optional parameter. Also implement Enquire_Link, reconnection/backoff, DLR handling and monitoring/alerts. (harshadura.github.io)

Runtime note: don’t worry about the old “J2EE” name — choose a simple, maintainable runtime (a Spring Boot microservice or a Jakarta EE app) and focus effort on reliability (thread pools, transactional persistence, idempotence, logging, operator rules). Spring Boot and Jakarta EE provide good, current options for running a lightweight server process. (github.com)

Key cautions: confirm bind mode and rate limits with the operator, test with simulators before going live, decode according to data_coding/UDH and watch for messages placed in message_payload.

Recommended Answers

All 5 Replies

several things you should know: J2EE is out of date, update to the latest Java EE version.
it's very nice you want to finish your application. this hints me that you have already started on it. unfortunately, you forgot to mention what it is you have already done, and what exactly it is you are stuck on. that kind of makes it look like a "here's my assignment, make it for me" request.

so: please be more specific about what it is you are looking for, what it is you've already done and what is not woking the way you want.

Thank you for your answer, i start the application on standard edition where i was using the jsmpp librairy that give the way to connect application to the smsc. About j2ee i am only a beginner, so i have no idea to implement a thread that can receive sms and store on database. Trust to me, I don't want somebody make my assignment at my place

as I already pointed out: don't begin with J2EE. it's legacy. it's "retired".

what can you suggest to me, because the best solution of my application is to accomodate on a server

what can you suggest to me, because the best solution of my application is to accomodate on a server

Go through some Enterprise Edition tutorials before jumping right into the battefield.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.