I am new in JPOS. I need some help. Please find below my requirement.
In TCP connection terms, the IST Switch is configured to be a Server and the MPOS server is configured to be a Client. MPOS server and IST Switch should communicate via a single TCP connection. Also there should be provision to have multiple TCP connections between MPOS server and IST Switch for scalability, load-sharing and handling fail-over. Once established a TCP connection is maintained continuously.
I have gone through jpos developer guide and get to know QMUX can be used for my requirement. Request to you kindly help me on this.
I couldn't understand your question exactly but QMUX has nothing to do with load-balancing or with fail-over. QMUX get bind with only one Channel Adaptor
Let me tell you what QMUX does so we can clear the understanding of when QMUX would be usefull. For example you have a channel connected to a server and server supports concurrent requests(i.e. second request on the same tcp link while client is waiting for response of the first request). Now here comes a problem to relate requests-response pairs (because its quite possible that second response arrives even before the response of first request) this is what exactly QMUX does. mux part actually stands for multiplexer.
For laod-balancing or fail-over you can use org.jpos.q2.iso.MUXPool
class following is a sample q2 xml descriptor
<?xml version="1.0" encoding="UTF-8"?>
<muxpool name="MuxPool" class="org.jpos.q2.iso.MUXPool" logger="Q2">
<muxes>MuxPrimary MuxSecondary</muxes>
<strategy>PRIMARY_SECONDARY</strategy>
</muxpool>
MuxPool provides two strategies primary-secondary or round-robin depends whether you are looking for fail-over or load-balancing.
If you think that I understood your question correctly and I am pointing you toward right direction let me know I may be able to share you one sample application using QMux and Muxpool on coming weekend.