Hi,
We have set up a load balancing SMPP server using nginx with least_conn method.
Currently, we have observed an issue of concatenation once our client using multiple binds to send.
We have deployed 3 nodes for SMPP servers. Once the client establishes the connection, it's bind to different servers.
Our client submits the concatenated, each parts was sent from a different bind and we were unable to combine them into a single message.
I am looking for the solution of the load balancing deployment.
Could you please help on this?
Concatenated in SMPP Server Load Balancing with multiple binds.
Re: Concatenated in SMPP Server Load Balancing with multiple binds.
Hi,
You may need to store SubmitSm in central storage (RDBMS or Redis) and concatenate the message parts when they are received from all binds.
Another solution is to publish all received SubmitSm to message broker and handle the concatenation in another subscriber process.
You may need to store SubmitSm in central storage (RDBMS or Redis) and concatenate the message parts when they are received from all binds.
Another solution is to publish all received SubmitSm to message broker and handle the concatenation in another subscriber process.
Re: Concatenated in SMPP Server Load Balancing with multiple binds.
I have pushed to the Redis storage for each part, but it needs to define what is the last segment of the messages.
Composer is not a good idea in this case.
I have run testS with my manual to check the last segment as following but it seems not to work properly.
Composer is not a good idea in this case.
I have run testS with my manual to check the last segment as following but it seems not to work properly.
Code: Select all
private bool IsLastSegment(SubmitSm submitSm)
{
try
{
var totalParts = submitSm.Concatenation.Total;
var retVal = new Tuple<bool, long>(false, 0);
int retry = 2;
string key = $"{submitSm.SourceAddress}_{submitSm.DestinationAddress}_{submitSm.Concatenation.ReferenceNumber}";
do
{
++retry;
retVal = RedisUtils.Instance.HashCount(7, key);
} while (!retVal.Item1 && retry <= 2);
return retVal.Item2 == totalParts;
}
catch (Exception e)
{
return false;
}
}