At random times we get deadlocks. The jstack is showing this:
The SMPPSessionCustom is nothing fancy just an extension of the original Class that returns the SMPPResultResp and not only the Id.
private final ConnectionProperties connectionProperties;
private final int timeout;
private final long id;
public SMPPSessionCustom(ConnectionProperties connectionProperties) {
super();
this.connectionProperties = connectionProperties;
this.timeout = this.connectionProperties.get(ConnectionConstants.OPERATOR_SUMBIT_SM_TIMEOUT, 35000);
this.id = currentTime.accumulateAndGet(System.currentTimeMillis(),
(prev, next) -> next > prev ? next : prev + 1);
}
public SMPPSessionCustom(PDUSender pduSender, PDUReader pduReader, ConnectionFactory connFactory,
ConnectionProperties connectionProperties) {
super(pduSender, pduReader, connFactory);
this.connectionProperties = connectionProperties;
this.timeout = this.connectionProperties.get(ConnectionConstants.OPERATOR_SUMBIT_SM_TIMEOUT, 35000);
this.id = currentTime.accumulateAndGet(System.currentTimeMillis(),
(prev, next) -> next > prev ? next : prev + 1);
}
public SMPPSessionCustom(String host, int port, BindParameter bindParam, PDUSender pduSender, PDUReader pduReader,
ConnectionFactory connFactory, ConnectionProperties connectionProperties) throws IOException {
super(host, port, bindParam, pduSender, pduReader, connFactory);
this.connectionProperties = connectionProperties;
this.timeout = this.connectionProperties.get(ConnectionConstants.OPERATOR_SUMBIT_SM_TIMEOUT, 35000);
this.id = currentTime.accumulateAndGet(System.currentTimeMillis(),
(prev, next) -> next > prev ? next : prev + 1);
}
public SMPPSessionCustom(String host, int port, BindParameter bindParam, ConnectionProperties connectionProperties)
throws IOException {
super(host, port, bindParam);
this.connectionProperties = connectionProperties;
this.timeout = this.connectionProperties.get(ConnectionConstants.OPERATOR_SUMBIT_SM_TIMEOUT, 35000);
this.id = currentTime.accumulateAndGet(System.currentTimeMillis(),
(prev, next) -> next > prev ? next : prev + 1);
}
public SubmitSmResp submitShortMessageGetResp(String serviceType, TypeOfNumber sourceAddrTon,
NumberingPlanIndicator sourceAddrNpi, String sourceAddr, TypeOfNumber destAddrTon,
NumberingPlanIndicator destAddrNpi, String destinationAddr, ESMClass esmClass, byte protocolId,
byte priorityFlag, String scheduleDeliveryTime, String validityPeriod,
RegisteredDelivery registeredDelivery, byte replaceIfPresentFlag, DataCoding dataCoding,
byte smDefaultMsgId, byte[] shortMessage, OptionalParameter... optionalParameters) throws PDUException,
ResponseTimeoutException, InvalidResponseException, NegativeResponseException, IOException {
ensureTransmittable("submitShortMessage");
SubmitSmCommandTask submitSmTask = new SubmitSmCommandTask(pduSender(), serviceType, sourceAddrTon,
sourceAddrNpi, sourceAddr, destAddrTon, destAddrNpi, destinationAddr, esmClass, protocolId,
priorityFlag, scheduleDeliveryTime, validityPeriod, registeredDelivery, replaceIfPresentFlag,
dataCoding, smDefaultMsgId, shortMessage, optionalParameters);
SubmitSmResp resp = (SubmitSmResp) executeSendCommand(submitSmTask, timeout);
return resp;
}
public long getId() {
return id;
}
}`
It affected both the last and the previous releases of JSMPP. Have not tried with previous ones lately. When I was using the 0.2.2 did not have this but i have not confirmed lately.