0

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

efe
  • 41
  • 1
  • 4

2 Answers2

1

The first downside is processing time. With a ChannelAdaptor in Q2 you 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 Q2 and 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.

Andrés Alcarraz
  • 1,570
  • 1
  • 12
  • 21
0

I suggest you try the Gateway Tutorial described here, and you'll see that everything is quite easier with Q2.

http://jpos.org/tutorials

And BTW, you can run Q2 from your SB application with just a few lines of code, take a look at this Gist:

https://gist.github.com/ar/86a4a24384d029c35f784079007393b0#file-q2boot-java

apr
  • 1,288
  • 7
  • 8