bank atm tcp message load blancing and routing using java nio/netty and activemq -


i designing banks atm message processing/routing framework, , need in finalizing technologies , architecture. transactions comes multiple atm's of partner banks, serve 5 6 banks , not more 10 atms per bank.

  1. messages come atm via tcp socket , received multithreaded java process called atm controller. runs in blocking mode 1 thread per socket. every bank given unique port atm send messages.

  2. message converted iso8583 format sent hardware security module(hsm) decryption via tcp sockets, pin verification done using software module. these standard libraries working fine far.

  3. messages sent java program called transaction router, again via tcp sockets. transaction router route message either local system in-channel banks or npci gateway non-channel banks transaction.

the current system built using core java , blocking threads has following areas of pain

  1. messages gets lost in transit.

  2. timeouts happening results in offline reversal of transactions @ our database. need send response atm within 15 second max.

  3. no means of recovery if there system shutdown or power outage.

  4. no load balancing @ either controller or router program.

to eliminate these pain areas redesigning system , considering following technologies

  1. java nio2 non blocking threads , or maybe netty or mina since in future anticipate more banks , atms serviced our system. or blocking io sufficient our needs ??

  2. activemq queuing messages make persistent during transit.

  3. nginx or haproxy tcp load balancing.

questions have are

  1. if used java nio2 @ atm controller , transaction router need mechanism insert correlation id inserted in messages can sent response correct socket, since non-blocking async mode 1 thread might servicing multiple sockets.

edit

got further clarifications on requirements,

1) our tcp connections once established banks atms,are never supposed terminate, unless there network issue. every request, need first keep alive check before send response bcoz long running connection.

2) expecting 500 800 concurrent non-terminating tcp connections. when atm first starts due reboot or maintenance, needs exchange config data server, , further requests should hit same server has cached config data.

q1) if go experts suggestions use jms based approach blocking threads per connection, how can keep alive check before sending response.

q2) if need run tcp server in high-availability mode should approach. ?

considering use case atm , financial transactions should not start looking @ complex low level non blocking solutions.

go transactional jms messaging way , blocking i/o. won't overrun messages should able calculate max load (all atm machines used @ same minute). can't high if have thousands of connected atm machines. typical case reliability , less code complexity (less bugs) comes before scaling. hardware cheap , won't hit high peak loads.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -