Concatenated in SMPP Server Load Balancing with multiple binds.

Post Reply
owlboo98
Posts: 15
Joined: Tue Apr 20, 2021 8:11 am

Concatenated in SMPP Server Load Balancing with multiple binds.

Post by owlboo98 » Mon Oct 11, 2021 6:47 am

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?
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Concatenated in SMPP Server Load Balancing with multiple binds.

Post by alt » Mon Oct 11, 2021 12:16 pm

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.
owlboo98
Posts: 15
Joined: Tue Apr 20, 2021 8:11 am

Re: Concatenated in SMPP Server Load Balancing with multiple binds.

Post by owlboo98 » Tue Oct 12, 2021 2:43 am

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.

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;
            }
        }
Post Reply