Switch implementation in Q2

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Switch implementation in Q2

hakeem

Dear Jpos-Users and Alejandro Revilla


     I want to figure out how to implement switch
function in jpos (in Q2), maybe like Router class in
qsp, correct me if i'm wrong.

     if i had 2 or more QMux correspondent to spesific
ISOChannel, can Q2 act as Router, to perform switching
where ISOMsg will be send to spesific (QMux) depends
on a field, let say field 50 as switch key.

thanks


Best Regards


Lukmanul Hakim


               
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs 
 


------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hm7ijj9/M=362131.6882499.7825260.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1122642516/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life -?brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/jpos-dev/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switch implementation in Q2

Alejandro Revilla
>
>      I want to figure out how to implement switch
> function in jpos (in Q2), maybe like Router class in
> qsp, correct me if i'm wrong.
>
>      if i had 2 or more QMux correspondent to spesific
> ISOChannel, can Q2 act as Router, to perform switching
> where ISOMsg will be send to spesific (QMux) depends
> on a field, let say field 50 as switch key.
>
You can either modify org.jpos.apps.qsp.Router to use a QMUX
instead of an ISOMUX or modify org.jpos.iso.Connector in order
to key off your field 50. I think the latter could be even easier.

If you look at org.jpos.iso.Connector you have:

   MUX destMux = (MUX) NameRegistrar.get (muxName);

If you manage to build a 'muxName' based on some custom logic that takes
into account your field 50 you'd be all set.




------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h0kttb5/M=362131.6882499.7825260.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1122643238/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/jpos-dev/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switch implementation in Q2

hakeem
Thanks Alejandro for a vary fast response..

   
  Let say i modified org.jpos.apps.qsp.Router, how i
configure it in Q2 ???

i'm not that good in modifying. if i modify
org.jpos.iso.Connector, how i configure it in Q2??
please give me example..

Thx, Best Regards

Lukmanul Hakim

--- Alejandro Revilla <[hidden email]> wrote:

> >
> >      I want to figure out how to implement switch
> > function in jpos (in Q2), maybe like Router class
> in
> > qsp, correct me if i'm wrong.
> >
> >      if i had 2 or more QMux correspondent to
> spesific
> > ISOChannel, can Q2 act as Router, to perform
> switching
> > where ISOMsg will be send to spesific (QMux)
> depends
> > on a field, let say field 50 as switch key.
> >
> You can either modify org.jpos.apps.qsp.Router to
> use a QMUX
> instead of an ISOMUX or modify
> org.jpos.iso.Connector in order
> to key off your field 50. I think the latter could
> be even easier.
>
> If you look at org.jpos.iso.Connector you have:
>
>    MUX destMux = (MUX) NameRegistrar.get (muxName);
>
> If you manage to build a 'muxName' based on some
> custom logic that takes
> into account your field 50 you'd be all set.
>
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hb9315r/M=362131.6882499.7825260.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1122645938/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life -?brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/jpos-dev/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switch implementation in Q2

Alejandro Revilla
>    
>   Let say i modified org.jpos.apps.qsp.Router, how i
> configure it in Q2 ???
>
It would be something like:

<server class="org.jpos.q2.iso.QServer" logger="Q2" name="simulator_10000">
 <attr name="port" type="java.lang.Integer">10000</attr>
 <channel class="org.jpos.iso.channel.XMLChannel"
        logger="Q2" packager="org.jpos.iso.packager.XMLPackager">
 </channel>
 <request-listener class="com.your.company.ModifiedRouter" logger="Q2">
  <property name="xxx" value="xxx" />
   ...
   ...
   ...
 </request-listener>
</server>




------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hsl8gi1/M=362329.6886308.7839368.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1122647757/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/jpos-dev/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switch implementation in Q2

hakeem


--- Alejandro Revilla <[hidden email]> wrote:

> >    
> >   Let say i modified org.jpos.apps.qsp.Router, how
> i
> > configure it in Q2 ???
> >
> It would be something like:
>
> <server class="org.jpos.q2.iso.QServer" logger="Q2"
> name="simulator_10000">
>  <attr name="port"
> type="java.lang.Integer">10000</attr>
>  <channel class="org.jpos.iso.channel.XMLChannel"
>         logger="Q2"
> packager="org.jpos.iso.packager.XMLPackager">
>  </channel>
>  <request-listener
> class="com.your.company.ModifiedRouter" logger="Q2">
>   <property name="xxx" value="xxx" />
>    ...
>    ...
>    ...
>  </request-listener>
> </server>

I try to modified org.jpos.apps.qsp.Router, i change
ISOMUX, to QMUX, name org.jpos.q2.Q2Router in Q2, xml
like this :

<?xml version="1.0" encoding="UTF-8"?>
<server class="org.jpos.q2.iso.QServer" logger="Q2"
name="simulator_on_10000">
  <attr name="port"
type="java.lang.Integer">10000</attr>
  <channel class="org.jpos.iso.channel.ASCIIChannel"
logger="Q2"
packager="org.jpos.iso.packager.GenericPackager">
    <property name="packager-config"
value="cfg/myascii.xml" />
  </channel>
  <in>my-proxy-send</in>
  <out>my-proxy-receive</out>
  <reconnect-delay>10000</reconnect-delay>

  <request-listener class="org.jpos.q2.Q2Router"
logger="Q2">
    <router switch="${50}==11" type="mux"
bounce="true" bounce-code="11" destination="toSimA"
timeout="30000" />
    <router switch="${50}==22" type="mux"
bounce="true" bounce-code="22" destination="toSimB"
timeout="30000" />
  </request-listener>
</server>

if i send message with with field 50==11, the message
never sent to mux.toSimA. i already define mux in
another xml, can anybody help me AGAIN how to use
switch function in Q2 ??


Thanks, Best Regards,


Lukmanul Hakim


               
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs 
 


------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hsr2g3g/M=362329.6886308.7839368.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1122895263/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/jpos-dev/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switch implementation in Q2

Alejandro Revilla
>
>   <request-listener class="org.jpos.q2.Q2Router"
> logger="Q2">
>     <router switch="${50}==11" type="mux"
> bounce="true" bounce-code="11" destination="toSimA"
> timeout="30000" />
>     <router switch="${50}==22" type="mux"
> bounce="true" bounce-code="22" destination="toSimB"
> timeout="30000" />
>   </request-listener>
> </server>
>
If you want to use XML like that (<router...) you'll have to
have your Q2Router implement org.jpos.core.XmlConfigurable and
fetch those <router> elements at setConfiguration time.




------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hcrlol7/M=362335.6886445.7839731.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1122941965/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/jpos-dev/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switch implementation in Q2

hakeem


--- Alejandro Revilla <[hidden email]> wrote:

> >
> >   <request-listener class="org.jpos.q2.Q2Router"
> > logger="Q2">
> >     <router switch="${50}==11" type="mux"
> > bounce="true" bounce-code="11"
> destination="toSimA"
> > timeout="30000" />
> >     <router switch="${50}==22" type="mux"
> > bounce="true" bounce-code="22"
> destination="toSimB"
> > timeout="30000" />
> >   </request-listener>
> > </server>
> >
> If you want to use XML like that (<router...) you'll
> have to
> have your Q2Router implement
> org.jpos.core.XmlConfigurable and
> fetch those <router> elements at setConfiguration
> time.

ok, i already implement org.jpos.cor.XmlConfigurable,
does setConfiguration(Element e) automatically called
by Q2 Server?? or i have to modified
org.jpos.q2.QServer at private void addListeners ()
        throws Q2ConfigurationException
{
...
} ??

because when i check with at method
public void setConfiguration(Element e) {
 System.out.println("inside SetConfiguration") ;
},

text doesnt print to console, do i have invoke this
method at Q2Server (modified it with request-listener
element) ??

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hsd6l7n/M=362329.6886308.7839368.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1122962041/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/jpos-dev/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Switch implementation in Q2

Alejandro Revilla
>
> ok, i already implement org.jpos.cor.XmlConfigurable,
> does setConfiguration(Element e) automatically called
> by Q2 Server?? or i have to modified
>
Yes, it should get called.



------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h34nq8r/M=362329.6886308.7839368.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1122992019/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/jpos-dev/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Loading...