How to use SAF modul

291 views
Skip to first unread message

adhi nugroho

unread,
Nov 11, 2014, 3:56:49 AM11/11/14
to jpos-...@googlegroups.com
hello,

i just reading from andy's blog about SAF


i just added 2 file for implement SAF  with values of 2 file is

<saf name='saf' logger='Q2' realm='saf'class='org.jpos.saf.SAF'>
 
<property name='space' value='jdbm:saf' />
 
<property name='mux' value='jpos-client-mux' />
 
<property name='flag-retransmissions' value='no'>
 if MTI is in list, messages would be retransmitted as xxx1
 
</property>
 
<property name='initial-delay' value='60000' />
 
<property name='inter-message-delay' value='1000' />
 
<property name='wait-for-response' value='60000' />
 
<property name='max-retransmissions' value='1000' />
 
<property name='expire-after' value='86400'>
 in seconds
 
</property>
 
<property name='valid-response-codes' value='*' />
 
<property name='retry-response-codes' value='91,NL,NM,N8,CE'/>
</saf>


and 

<saf-monitor class='org.jpos.ee.status.Monitor' logger='Q2'>
 
<monitor id="saf1 FDR SAF 01 Status" delay='10000'period='30000'>
 
<class>org.jpos.saf.SAFMonitor</class>
 
<property name='saf' value='saf' />
 
</monitor>
</saf-monitor>


my mux is

<?xml version="1.0" ?>


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

my client is

<?xml version="1.0" ?>


<channel-adaptor name="chnsamsat" class="org.jpos.q2.iso.ChannelAdaptor"
   
logger="Q2">
 
<channel class="org.jpos.iso.channel.ASCIIChannel" logger="Q2" packager="org.jpos.iso.packager.GenericPackager" >
     
<property name="packager-config" value="cfg/packager/iso87ascii.xml" />
 
<property name="packager-logger" value="Q2"/>
   
<property name="host" value="10.63.10.200" />
   
<property name="port" value="54325" />
   
<property name="timeout" value="300000" />  
   
<property name="keep-alive" value="true" />
 
</channel>
<in>jpos-client-send</in>
 
<out>jpos-client-receive</out>
 
<reconnect-delay>10000</reconnect-delay>
 
</channel-adaptor>


in my case is when i've posting 0200, then it`s reach timeout. how do saf works with it? it`s will be work automatically or i must added some code ?

chhil

unread,
Nov 11, 2014, 6:21:21 AM11/11/14
to jpos-...@googlegroups.com
Just as you find your mux and do a mux.request to send the request to the host/network, you need to find your saf  using SAF.getSAF(safName) and do a saf.send(saf_isomsg) to hand off the message to the store and forward processing.

Your saf_isomsg  would be something you would create from the original message that timed out, it could be a repeat or a reversal or whatever message you want to send.

Ideally you want to configure the safname in the participant that sends the request to the host/network and saf based on financial imppact of the original e.g. if its a balance inquiry there is no need to reverse else revers the transaction. The business logic depends on your use case.


The saf configuration will take care of your retries based on your your retry response configured.


-chhil



--
--
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
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/76ed9374-2079-418c-89bf-04ef0e93c76a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

adhi nugroho

unread,
Nov 11, 2014, 9:42:36 PM11/11/14
to jpos-...@googlegroups.com
hi chill it`s work greats...

thank you very much.... 

 

chhil

unread,
Nov 11, 2014, 11:59:36 PM11/11/14
to jpos-...@googlegroups.com
You are welcome and thank you Andy for the blog ;-)

On Wed, Nov 12, 2014, 8:12 AM adhi nugroho <pheno...@gmail.com> wrote:
hi chill it`s work greats...

thank you very much.... 

 

--
--
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
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
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+...@googlegroups.com.

adhi nugroho

unread,
Nov 14, 2014, 6:55:59 AM11/14/14
to jpos-...@googlegroups.com
how to get mti message from saf?
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAPazefCwQU04sonQnQ7KmHosJNLzN_pjrBLADQf9ixd9oVb4aA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


--
Sent from Gmail Mobile for Iphone

Mark Salter

unread,
Nov 14, 2014, 7:40:04 AM11/14/14
to jpos-...@googlegroups.com
On 14/11/2014 11:55, adhi nugroho wrote:
> how to get mti message from saf?
The ISOMsg in the SAF queue will have an MTI, a 'saf' won't.


--
Mark

chhil

unread,
Nov 14, 2014, 7:41:46 AM11/14/14
to jpos-...@googlegroups.com

ISO Messages have an MTI so what do you mean by "get MTI message from SAF?"

If you look at the SAF code, you will notice its based off a persistent space. If you look at the saf code it places these Entry objects in it.

-chhil


adhi nugroho

unread,
Nov 14, 2014, 8:16:34 AM11/14/14
to jpos-...@googlegroups.com
I want to get MTi from saf response message after i send it, so if i send 0400 how do i get return value 0410?
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAPazefBu8hvaAaDEM_Hz2%3DGDsza4WN-xhs_pZLupi78O484XXw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

chhil

unread,
Nov 14, 2014, 9:07:56 AM11/14/14
to jpos-...@googlegroups.com
You will need to customize the Saf code, look at the send method that takes an Entry parameter, it there where the mux is used to send the request and receives the response.

You can do what you need to do with the response.

-chhil

Reply all
Reply to author
Forward
0 new messages