MUXPool Failed to send Message

251 views
Skip to first unread message

Meldri Asan

unread,
Dec 8, 2017, 7:18:08 AM12/8/17
to jPOS Users
Hi All,

I face problem that i cannot send my message. I was using muxpool to send data but muxpool is not connected. 

MUXPool pool = (MUXPool)NameRegistrar.get("mux.client-mux");

While i change my configuration using mux, the message was succesfully delivered.

MUX mux = (MUX) NameRegistrar.getIfExists("mux.client-mux-0992");

Can anyone give me some advice to solve this case..I will attach my deploy and java code below.

java
public boolean process(ISOSource isoSrc, ISOMsg isoMsg) {
ISOMsg reply;
try {
System.out.println(isoMsg.getMTI());
//MUXPool pool = (MUXPool)NameRegistrar.get("mux.client-mux");
MUX mux = (MUX) NameRegistrar.get("mux.client-mux");
//MUXPool pool = (MUXPool) NameRegistrar.get("mux.client-mux");
//MUX mux = (MUX) NameRegistrar.getIfExists("mux.client-mux-0992");
System.out.println(mux.isConnected());
reply = mux.request(isoMsg, 10000L);
if (reply != null) {
isoSrc.send(reply);
} else {
System.out.println("null");
}
    } catch (Exception e) {
e.printStackTrace();
}
return true;
}

Server.xml
<server class="org.jpos.q2.iso.QServer" logger="Q2" name="XXXServer">
    <attr name="port" type="java.lang.Integer">1600</attr>
    <attr name="minSessions" type="java.lang.Integer">10</attr>
<attr name="maxSessions" type="java.lang.Integer">250</attr>

    <channel name="ClientChannel" class="org.jpos.iso.channel.NACChannel" logger="Q2"
             packager="org.jpos.iso.packager.ISO87BPackager"
             header="0000000000">
        <property name="timeout" value="300000" />
<property name="keep-alive" value="true" />
    </channel>

    <request-listener class="com.xxx.host.HostServer" logger="Q2">
        <property name="space" value="tspace:bcaSpace" />
        <property name="queue" value="TransactionQueue" />
        <property name="timeout" value="15000" />
    </request-listener>
</server>

first channel
<channel-adaptor name="client-channel_0992" class="org.jpos.q2.iso.ChannelAdaptor"
logger="Q2">
<channel logger="Q2" 
class="org.jpos.iso.channel.NACChannel"
packager="org.jpos.iso.packager.ISO87BPackager"
header="0000000000">
    <property name="host" value="localhost" />
<property name="port" value="1700" />
    </channel>
<in>client-channel-0992.send</in >
    <out>client-channel-0992.receive</out >
<reconnect-delay>10000</reconnect-delay>
</channel-adaptor>

second channel
<channel-adaptor name="client-channel_0996" class="org.jpos.q2.iso.ChannelAdaptor"
logger="Q2">
<channel logger="Q2" 
class="org.jpos.iso.channel.NACChannel"
packager="org.jpos.iso.packager.ISO87BPackager"
header="0000000000">
    <property name="host" value="localhost" />
<property name="port" value="1800" />
    </channel>
<in>client-channel-0996.send</in >
    <out>client-channel-0996.receive</out >
<reconnect-delay>10000</reconnect-delay>
</channel-adaptor>

first mux
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="client-mux-0992">
<in>client-channel-0992.receive</in >
    <out>client-channel-0992.send</out >
    <ready>client-channel-0992.ready</ready >
</mux>

second mux
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="client-mux-0996">
<in>client-channel-0996.receive</in >
    <out>client-channel-0996.send</out >
    <ready>client-channel-0996.ready</ready >
</mux>


muxpool
<?xml version="1.0" encoding="UTF-8"?>
<mux class="org.jpos.q2.iso.MUXPool" logger="Q2" name="client-mux">
<muxes>client-mux-0992 client-mux-0996</muxes>
<strategy>round-robin</strategy>
</mux>

Thank you.



chhil

unread,
Dec 8, 2017, 7:45:58 AM12/8/17
to jpos-...@googlegroups.com
​Check your <ready> element, the name is incorrect.

 <ready>
​​
client-channel-0992.ready</ready >
    <ready>client-channel-0996.ready</ready >

Your channel names are    client-channel_0996 and 
client-channel_0992 (underscores), so it never finds the channels connected.

-chhil

Meldri Asan

unread,
Dec 8, 2017, 8:48:28 AM12/8/17
to jPOS Users
Hi Chhil,

Thank you for the answer..If you don't mind can you explain why i can send message using spesific mux (client-mux-0992) instead of muxpool..

Regards,
Meldri

Andrés Alcarraz

unread,
Dec 8, 2017, 8:58:12 AM12/8/17
to jpos-...@googlegroups.com
Hi Meldri, that's because the QMUX does not chek for connection, since
it only has one way to go.

MUXPOOL uses de MUX.isConnected to check which MUX is able to handle the
message.

Hope this answer your doubt.

Andrés


El 08/12/17 a las 10:48, Meldri Asan escribió:

Meldri Asan

unread,
Dec 8, 2017, 9:03:08 AM12/8/17
to jPOS Users
Hi All,

Noted..Thank you for great explain..
Both of you chhil and andres..

Regards,
Meldri

chhil

unread,
Dec 8, 2017, 9:45:12 AM12/8/17
to jpos-...@googlegroups.com
Ideally you always want to check if the mux is connected before you send a message.
Muxpool does the connect check as it needs to make sure it can send the message on the available connection in the list of muxes configured in the pool.

-chhil


Regards,
Meldri

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage.  Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/f9d26544-74ca-44a1-a8ee-7a70a9cccf6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages