What are the downsides to using Jpos with just creating IsoMsg objects and using channels, connect, send, and receive methods instead of deploying a Q2?
I use Jpos in my spring application to process financial transactions from pos terminals to different transaction processors.
My current setup involves just creating an IsoMsg object, setting the required fields, then creating the appropriate channel calling the channel send and receive method to process the transaction like.
Below is an example of me sending a network management request:
ISOMsg m = new ISOMsg ();
m.setMTI ("0800");
m.set (3, "000000");
m.set (41, "00000001");
m.set (70, "301");
.......................................
.......................................
(other parts of iso message omitted)
ISOChannel channel = new ASCIIChannel ("<processor_ip>", <processor_port>, new GenericPackager());
channel.connect();
channel.send(m);
IsoMsg response = channel.receieve();
However the jpos programmers' guide recommends using a Q2 instead of the above method, but I find the Q2 deployment quite complex and configuration-heavy.
Reading the Q2 section of the programmers guide quickly introduces a lot of complex components with names that are not so easy to understand such as channel adaptors, participants, space, filters, query hosts, etc.
I prefer the simple implementation of creating an IsoMsg object, opening a connection through a channel, sending the IsoMsg, and receiving a response.
My question is, what are the downsides to using the simpler implementation over Q2, what advantages does the Q2 deployment offer over just communicating through plain channels
The first downside is processing time. With a
ChannelAdaptorinQ2you have the channel connected all the time, so you don't have the overhead of establishing the TCP/IP connection, which involves a few extra steps in each request.Also, without
Q2and transaction managers, you have to implement all the timeout logic. For instance, in your code snippet, you don't handle a timeout if the other end doesn't respond. Your code would be frozen until the connection is reset by some other means.Your code will be complex enough soon trying to overcome the challenges that are already sorted out in decades of experience of ISO8583 transaction processing implementation gathered by the jPOS team.