Reversal exponential backoff

33 views
Skip to first unread message

James Loveday

unread,
Jul 21, 2022, 4:06:16 AMJul 21
to jPOS Users
Hi 

I'm after advice on handling an exponential backoff with a reversal. 

I have a requirement to send a reversal for a max number of attempts but each attempt needs to make use of an exponential backoff. 

Is there any facility within the jpos library to handle this or do we need to implement our own. Currently when a reversal is initiated, timeout etc, we send the reversal to the transaction manager and onwards to the mux. 

Is there anything already in place to set a number of retries with a backoff. 

Alejandro Revilla

unread,
Jul 21, 2022, 3:45:29 PMJul 21
to jpos-...@googlegroups.com
The closest you can get is jPOS-EE's 'SAF' module (https://github.com/jpos/jPOS-EE/tree/master/modules/saf). Unfortunately, I see it's not documented in http://jpos.org/doc/jPOS-EE.pdf but it's super easy to use, you just get a reference to it using the NameRegistrar and call 'send(ISOMsg)' to queue messages. You can configure the number of retries.

While you can slow down the retransmission, and set the number of retransmissions, the SAF sends the transactions in order, so it doesn't go to the next transaction until a former one gets answered. The reason is changing the order may have financial impact. Important messages such as cutovers, etc. are required to be transmitted in order.

Hope it works for you. Feel free to reach out on Slack if you have questions, and if you get to use it, perhaps you can contribute a PR for the documentation :)

--


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/6113e471-d83f-4285-aa01-4910f8191760n%40googlegroups.com.

James Loveday

unread,
Jul 22, 2022, 7:43:20 AMJul 22
to jPOS Users
Many thanks for your advice, I'll look into that now. 

murtuza chhil

unread,
Jul 24, 2022, 10:46:49 PMJul 24
to jPOS Users
Some things to be aware of 
1. SAF module uses a local space so if you have multiple servers you run into an out of order processing.
2. You need to add an additional encryption layer on top of the space that encrypts and decrypts the data as its puts the isomsg in the space and retrieves it. jPOS does allow to you to do this by writing spacelets. Needed for compliance.

You can take this further by storing your saf entries in the DB you use instead of a space.
Process the entries in order of insertion making sure you pick the ISOMsg based on pans (either its available or linked to an original that has a pan). If a pan is being processed/inflight do not process any other message with the same pan to maintain order, basically retrieve a list of unique pans based on insertion and process them and mark them with a state. Retrieve more rows and process based on pans and state.

You can have this custom participant configured with exponential backoff using a formula or simply hard coded delay values based on retry counts (based on your requirement).

-chhil

James Loveday

unread,
Aug 3, 2022, 4:52:08 AMAug 3
to jPOS Users
Thanks Chhil, I've implemented the SAF as you suggested and it works well enough for this requirement. Great advice there thanks
Reply all
Reply to author
Forward
0 new messages