ReRouteOnError

ReRouteOnError SearchSearch
Author Message
Mathew Mathachan
Frequent Contributor
Username: Mathewm

Post Number: 157
Registered: 04-2011
Posted on Thursday, July 01, 2021 - 01:02 pm:   

We have two SMSC link which have been configured to use ReRouteOnError for each other
LinkA has ReRouteOnError as LinkB and
LinkB has ReRouteOnError as LinkA

We also have BackupForRouteLive configured the same way
LinkA has BackupForRouteLive as LinkB and
LinkB has BackupForRouteLive as LinkA

As we understand, for a message sent through LinkA that results in error (other than those treated as permanent errors), it will be routed to LinkB with this configuration. However, if LinkB is down, will this message be routed back to LinkA because of BackupForRouteLive configuration thus causing a circular loop?

There is similar use case where LinkA is down and messages are routed to LinkB because of BackupForRouteLive configuration. However, if the there is an error condition (other than those treated as permanent errors) in LinkB will the message to be routed back to LinkA as a result of ReRouteOnError configuration?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 6298
Registered: 08-2008
Posted on Thursday, July 01, 2021 - 08:14 pm:   

Hi Mathew,

This scenario makes my brain hurt.

I would be hesitant to combine these settings in this way.

Before I try to work through this scenario ... how are you deciding whether a message goes to LinkA or LinkB in the first place? Do you use accounting callbacks, or are there some prefixes preferred for LinkA and some for LinkB?


quote:

As we understand, for a message sent through LinkA that results in error (other than those treated as permanent errors), it will be routed to LinkB with this configuration.




So called submit-time permanent errors (ESME_RINVDSTADR, ESME_RINVSRCADR, ESME_RX_R_APPN) are what trigger a reroute. Temporary errors do not trigger a reroute until retries are exhausted.

There is a "route history" associated with the message. When the ReRouteOnError condition is triggered, the "route history" is checked to make sure LinkB was not previously attempted. LinkA is added to the "route history", so that a subsequent ReRouteOnError back to LinkA does not cause a circular loop.


quote:

However, if LinkB is down, will this message be routed back to LinkA because of BackupForRouteLive configuration thus causing a circular loop?




Good question.

This does appear to cause a loop.

If LinkB is down, LinkA is processing any messages eligible for routing by either LinkA or LinkB. If a submit-time error occurs, this will trigger LinkA's ReRouteOnError to route the message to LinkB and add LinkA to the previous "route history". Because LinkB is down, LinkA will try to process the message again. If another submit-time error occurs, the logic is going to trigger LinkA's ReRouteOnError again, not realizing that it has already done this.

I'm referring this back to our engineering team for analysis and to determine if there is a way to fix or prevent this loop.

Regards,

Des
NowSMS Support
Mathew Mathachan
Frequent Contributor
Username: Mathewm

Post Number: 158
Registered: 04-2011
Posted on Sunday, July 04, 2021 - 07:45 am:   

Hello Des,

quote:
"Before I try to work through this scenario ... how are you deciding whether a message goes to LinkA or LinkB in the first place? Do you use accounting callbacks, or are there some prefixes preferred for LinkA and some for LinkB?"

We are directly addressing the links using "SMSCRoute" while submitting the messages.

Regards,
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 6300
Registered: 08-2008
Posted on Wednesday, July 07, 2021 - 08:03 pm:   

Hi Mathew,

A follow-up on this issue ...

We were not able to identify a work-around for this issue.

But we did fix the problem, so that there is not a circular loop in this scenario. An updated version of NowSMS that corrects this problem can be downloaded at https://nowsms.com/download/nowsms20210707.zip

Regards,

Des
NowSMS Support
Mathew Mathachan
Frequent Contributor
Username: Mathewm

Post Number: 159
Registered: 04-2011
Posted on Thursday, July 08, 2021 - 01:54 pm:   

Thanks Des for the support.
Could you please explain how this works.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 6301
Registered: 08-2008
Posted on Thursday, July 08, 2021 - 06:06 pm:   

Hi Mathew,

This scenario is extremely difficult to explain.

But let's take your initial scenario:


quote:

We have two SMSC link which have been configured to use ReRouteOnError for each other
LinkA has ReRouteOnError as LinkB and
LinkB has ReRouteOnError as LinkA

We also have BackupForRouteLive configured the same way
LinkA has BackupForRouteLive as LinkB and
LinkB has BackupForRouteLive as LinkA




In the SMSGW.INI, the above scenario looks like this:

[SMPP - a.b.c.d:nnnn]
RouteName=LinkA
ReRouteOnError=LinkB
BackupForRouteLive=LinkB

...

[SMPP - w.x.y.z:mmmm]
RouteName=LinkB
ReRouteOnError=LinkA
BackupForRouteLive=LinkA

The problem in this scenario starts like this.

Assume LinkB is down.

LinkA will begin processing any messages eligible for routing by either LinkA or LinkB. If a submit-time error occurs, this will trigger LinkA's ReRouteOnError setting to route the message to LinkB. The message has a "route history" associated with it, but it this history is confused because the message is being processed by LinkA. LinkB is not in the "route history", so NowSMS does not recognize that it keeps trying to route the message to LinkB.

The update improves the "route history".

Previously, when LinkA's ReRouteOnError=LinkB setting is processed after the first error, LinkA is added to the "route history". So, NowSMS would be able to detect a circular loop, because it will ignore ReRouteOnError if the route is already in the "route history".

With the update, when LinkA's ReRouteOnError=LinkB setting is processed after the first error, LinkA and LinkB are added to the "route history". After this first reroute, if another error occurs, NowSMS will see that LinkB is in the "route history" and will not reroute the message again, but mark it as failed.

Regards,

Des
NowSMS Support
Mathew Mathachan
Frequent Contributor
Username: Mathewm

Post Number: 160
Registered: 04-2011
Posted on Sunday, July 11, 2021 - 07:15 am:   

Thanks for the explanation

Add Your Message Here, or click here to start a new topic.
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image
Options: Automatically activate URLs in message
Action: