Re: [jpos-dev] Jpos q2 listener Issue

96 views
Skip to first unread message

chhil

unread,
Jun 20, 2017, 11:09:46 AM6/20/17
to jpos...@yahoogroups.com, jpos-...@googlegroups.com
What is your listener code doing?

Usually the good practice is for the listener to get the message and put it on a transaction manager queue i.e. the listener takes no time to do this.
If your listener is processing iso messages then you are going to get into trouble.

-chhil

On Mon, Jun 19, 2017 at 8:21 PM, Sridhar Jena sj...@aurusinc.com [jpos-dev] <jpos...@yahoogroups.com> wrote:
 

Hi Alejandro,

We are facing an issue with q2 server listener as when we increase load on mux we can see q2 listening time will increase gradually. This is an production issue where when the transaction volume get increased it took time by q2 server to listen the request/to create the context.

Currently two multiplexer are in used and below are the configuration files for your reference. Could you please help us on this to confirm if we are using right configuration or we missed anything here. Please let us know if any additional information is required.

Below are the statistics that we have tried on our test environment.

No of threads (Users)
Time taken by q2 listener (mili Sec)
10
2
100
150
500
3000
1000
11000
Note : each user hitting 100 samples continuously.

07_mux_channel_primary.xml
<channel-adaptor name='mux-channel-primary-adaptor' class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2-Mux">
    <channel class="org.jpos.iso.channel.XMLChannel" logger="Q2-Mux"
        packager="org.jpos.iso.packager.XMLPackager">
        <property name="host" value="127.0.0.1" />
        <property name="port" value="8081" />
        <property name="debug" value="false" />
    </channel>
    <in>mux-channel-primary-send</in>
    <out>mux-channel-primary-receive</out>
    <reconnect-delay>10000</reconnect-delay>
    <ignore-iso-exceptions>yes</ignore-iso-exceptions>
</channel-adaptor>


07_mux_channel_secondary.xml
<channel-adaptor name='mux-channel-secondary-adaptor' class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2-Mux">
    <channel class="org.jpos.iso.channel.XMLChannel" logger="Q2-Mux"
        packager="org.jpos.iso.packager.XMLPackager">
        <property name="host" value="127.0.0.1" />
        <property name="port" value="8081" />
        <property name="debug" value="false" />
    </channel>
    <in>mux-channel-secondary-send</in>
    <out>mux-channel-secondary-receive</out>
    <reconnect-delay>10000</reconnect-delay>
    <ignore-iso-exceptions>yes</ignore-iso-exceptions>
</channel-adaptor>


08_client_mux_primary.xml
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="client-primary-mux">
    <in>mux-channel-primary-receive</in>
    <out>mux-channel-primary-send</out>
    <key>11.1,11.2</key>
    <unhandled>mux-channel-primary-unhandled</unhandled>
</mux>


08_client_mux_secondary.xml
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="client-secondary-mux">
    <in>mux-channel-secondary-receive</in>
    <out>mux-channel-secondary-send</out>
      <key>11.1,11.2</key>
    <unhandled>mux-channel-secondary-unhandled</unhandled>
</mux>

09_mux_pool.xml
<mux class="org.jpos.q2.iso.MUXPool" logger="Q2" name="aurus-mux-pool">
<muxes>client-primary-mux client-secondary-mux</muxes>
<strategy>round-robin</strategy>
</mux>

10_aurus_mux.xml
<qbean name="aurus-mux" logger="Q2" realm="aurus-mux" class="com.test.AurusISOMux">
    <property name="mux" value="aurus-mux-pool" />
    <property name="timeout" value="20000" />
</qbean>

AurusISOMux.java
public class AurusISOMux extends org.jpos.q2.QBeanSupport {
    private static MUXPool aurusMuxPool;
    private static long timeOut;
    private static String muxName;

    public AurusISOMux() {
        super();
    }

    protected void initService() throws ISOException {
        muxName = "mux." + cfg.get("mux");
        timeOut = cfg.getLong("timeout");
    }


    protected void startService() {
            aurusMuxPool = (MUXPool) NameRegistrar.get(muxName);
    }

    public ISOMsg sendMsg(ISOMsg isoMsg) throws ISOException {
        return aurusMuxPool.request(isoMsg, timeOut);
    }

}

--

________________________________________________________________________________________________________________________________________________________________

Thanks and Regards,

Sridhar Jena, Sr. Techincal Lead, Products

+91 - 20 - 27655062 | +91 - 9226345267 | sjena345 | www.aurusinc.com
Plot G-2, Sector 26, Pradhikaran, Pune, Maharashtra-411044

Please consider the environment before printing this e-mail

Disclaimers: This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.

__._,_.___

Posted by: Sridhar Jena <sj...@aurusinc.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

chhil

unread,
Jun 23, 2017, 3:04:03 AM6/23/17
to jpos...@yahoogroups.com, jpos-...@googlegroups.com
You have 2 client channels (primary ad secondary) that connect server listening on 8081.
You have a mux for each of these and a muxpool that wraps the 2 muxes into the pool.
You dont need ( 10_aurus_mux.xml) as the muxpool and mux implement the same interface and you can use the muxpool to send the request.

So what you are saying is, you send a request at 15:59:41 and the server only receives it at 15:59:53 (based on your logging).
Please can you provide q2 logger data, thats more meaningful to debug.
I suggest try this, instead of a jpos server, simply run netcat in server mode and tell us if the timing is any different.

-chhil


On Wed, Jun 21, 2017 at 10:38 AM, Sridhar Jena sj...@aurusinc.com [jpos-dev] <jpos...@yahoogroups.com> wrote:
 

Chhil,

The listener is just only putting the context into transaction manager space and that's it.

There is no business logic or processing part defined in the listener.

We have logged a single line at the entry of the process method , it is logged in delay as copied here a request sending and listening time.

At the time of sending request to Q2 server

2017-06-20 15:59:41,577 INFO  [AurusISOMux.sendMsg(89)] - Sending Request To Q2 Server(c051b67a-eba4-4d03-86b0-c8347bb73547)...

At the time of listening the request through Request Listener

2017-06-20 15:59:53,703 INFO  [ISOMsgRequestDispatcher.process(59)] - Listening Request ID : c051b67a-eba4-4d03-86b0-c8347bb73547


Copied here the RequestListener code

public class ISOMsgRequestDispatcher implements ISORequestListener, Configurable {
    private static final Logger LOG = Logger.getLogger(ISOMsgRequestDispatcher.class);
    private long timeout = 120000;
    private String managerQueue = "";
    private static Space txnManagerSpace = SpaceFactory.getSpace("tspace:inflight_txn_circular_queue");
 
    public boolean process(ISOSource isoSource, ISOMsg isoMsg) {
        try {
            LOG.info("Listening Request ID : "+isoMsg.getString("11.1"))
            ContextMapper contextMapper = new ContextMapper(isoSource, isoMsg);
            Context context = contextMapper.createContext();
            txnManagerSpace.out(managerQueue, context, timeOut);
            return true;
        } catch (ExceptionHandler exceptionHandler) {
            LOG.error("Exception : " + "Failed To Process The Request :", exceptionHandler);
        } catch (Exception exception) {
            LOG.error("Exception : " + "Failed To Process The Request :", exception);
        }
        return false;
    }

    @Override
    public void setConfiguration(Configuration cfg) throws ConfigurationException {
        timeout = cfg.getLong("timeout", timeout);
        managerQueue = cfg.get("queue");
    }

}


________________________________________________________________________________________________________________________________________________________________

Thanks and Regards,

Sridhar Jena, Sr. Techincal Lead, Products

+91 - 20 - 27655062 | +91 - 9226345267 | sjena345 | www.aurusinc.com
Plot G-2, Sector 26, Pradhikaran, Pune, Maharashtra-411044

Please consider the environment before printing this e-mail

Disclaimers: This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.

On 6/20/2017 8:39 PM, chhil Chi...@gmail.com [jpos-dev] wrote:

What is your listener code doing?

Usually the good practice is for the listener to get the message and put it
on a transaction manager queue i.e. the listener takes no time to do this.
If your listener is processing iso messages then you are going to get into
trouble.

-chhil

On Mon, Jun 19, 2017 at 8:21 PM, Sridhar Jena sj...@aurusinc.com [jpos-dev]
<jpos...@yahoogroups.com> wrote:

>
>
> Hi Alejandro,
>
> We are facing an issue with q2 server listener as when we increase load on
> mux we can see q2 listening time will increase gradually. This is an
> production issue where when the transaction volume get increased it took
> time by q2 server to listen the request/to create the context.
>
> Currently two multiplexer are in used and below are the configuration
> files for your reference. Could you please help us on this to confirm if we
> are using right configuration or we missed anything here. Please let us
> know if any additional information is required.
>
> Below are the statistics that we have tried on our test environment.

> *No of threads (Users)*
> *Time taken by q2 listener (mili Sec)*


> 10
> 2
> 100
> 150
> 500
> 3000
> 1000
> 11000

> *Note *: each user hitting 100 samples continuously.
>
> *07_mux_channel_primary.xml*


> <channel-adaptor name='mux-channel-primary-adaptor'
> class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2-Mux">
> <channel class="org.jpos.iso.channel.XMLChannel" logger="Q2-Mux"
> packager="org.jpos.iso.packager.XMLPackager">
> <property name="host" value="127.0.0.1" />
> <property name="port" value="8081" />
> <property name="debug" value="false" />
> </channel>
> <in>mux-channel-primary-send</in>
> <out>mux-channel-primary-receive</out>
> <reconnect-delay>10000</reconnect-delay>
> <ignore-iso-exceptions>yes</ignore-iso-exceptions>
> </channel-adaptor>
>
>

> *07_mux_channel_secondary.xml*


> <channel-adaptor name='mux-channel-secondary-adaptor'
> class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2-Mux">
> <channel class="org.jpos.iso.channel.XMLChannel" logger="Q2-Mux"
> packager="org.jpos.iso.packager.XMLPackager">
> <property name="host" value="127.0.0.1" />
> <property name="port" value="8081" />
> <property name="debug" value="false" />
> </channel>
> <in>mux-channel-secondary-send</in>
> <out>mux-channel-secondary-receive</out>
> <reconnect-delay>10000</reconnect-delay>
> <ignore-iso-exceptions>yes</ignore-iso-exceptions>
> </channel-adaptor>
>
>

> *08_client_mux_primary.xml*


> <mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="client-primary-mux">
> <in>mux-channel-primary-receive</in>
> <out>mux-channel-primary-send</out>
> <key>11.1,11.2</key>
> <unhandled>mux-channel-primary-unhandled</unhandled>
> </mux>
>
>

> *08_client_mux_secondary.xml*


> <mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="client-secondary-mux">
> <in>mux-channel-secondary-receive</in>
> <out>mux-channel-secondary-send</out>
> <key>11.1,11.2</key>
> <unhandled>mux-channel-secondary-unhandled</unhandled>
> </mux>
>

> *09_mux_pool.xml*


> <mux class="org.jpos.q2.iso.MUXPool" logger="Q2" name="aurus-mux-pool">
> <muxes>client-primary-mux client-secondary-mux</muxes>
> <strategy>round-robin</strategy>
> </mux>
>
>

> *10_aurus_mux.xml *<qbean name="aurus-mux" logger="Q2" realm="aurus-mux"


> class="com.test.AurusISOMux">
> <property name="mux" value="aurus-mux-pool" />
> <property name="timeout" value="20000" />
> </qbean>
>
>

> *AurusISOMux.java *public class AurusISOMux extends


> org.jpos.q2.QBeanSupport {
> private static MUXPool aurusMuxPool;
> private static long timeOut;
> private static String muxName;
>
> public AurusISOMux() {
> super();
> }
>
> protected void initService() throws ISOException {
> muxName = "mux." + cfg.get("mux");
> timeOut = cfg.getLong("timeout");
> }
>
>
> protected void startService() {
> aurusMuxPool = (MUXPool) NameRegistrar.get(muxName);
> }
>
> public ISOMsg sendMsg(ISOMsg isoMsg) throws ISOException {

> return *aurusMuxPool.request(isoMsg, timeOut);*
> }
>
> }
>
> --
>
>
> *__________________________________________________________*
>
> *Thanks and Regards,*
>
> *Sridhar Jena,* Sr. Techincal Lead, Products
>
> * +91 - 20 - 27655062* | * +91 - 9226345267* | * sjena345* |
> *www.aurusinc.com* <http://www.aurusinc.com/>
> * Plot G-2, Sector 26, Pradhikaran, Pune, Maharashtra-411044*
>
> <http://www.aurusinc.com/>
>
>
> <https://www.facebook.com/pages/Aurus-Inc-Solution-and-Services-Provider/168611626510639>
> <https://twitter.com/aurustech> <http://linkedin.com/company/aurustech>
> <https://plus.google.com/100924847781939597025>
>
> *Please consider the environment before printing this e-mail *


>
> Disclaimers: This message contains confidential information and is
> intended only for the individual named. If you are not the named addressee
> you should not disseminate, distribute or copy this e-mail. Please notify
> the sender immediately by e-mail if you have received this e-mail by
> mistake and delete this e-mail from your system. E-mail transmission cannot
> be guaranteed to be secure or error-free as information could be
> intercepted, corrupted, lost, destroyed, arrive late or incomplete, or
> contain viruses. The sender therefore does not accept liability for any
> errors or omissions in the contents of this message, which arise as a
> result of e-mail transmission. If verification is required please request a
> hard-copy version.
>
>
>

[Non-text portions of this message have been removed]


__._,_.___

Posted by: Sridhar Jena <sj...@aurusinc.com>

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

.

__,_._,___

Reply all
Reply to author
Forward
0 new messages