I have a transaction manager which i configured like this
<txnmgr name="txnmgr" logger="Q2" class="org.jpos.transaction.TransactionManager">
<property name="space" value="tspace:mySpace"/>
<property name="queue" value="TransactionQueue"/>
<property name="max-sessions" value="10"/>
<participant class="main.java.com.transaction.manager.Switch" logger="Q2">
<property name="0800" value="NetworkManagement" />
<property name="0200" value="FinancialTransaction" />
</participant>
<participant class="main.java.com.transaction.manager.FinancialTransactionResponse" logger="Q2"/>
<group name="NetworkManagement">
<participant class="main.java.com.transaction.manager.NetworkManagementResponse" logger="Q2" />
</group>
<group name="FinancialTransaction">
<participant class="main.java.com.transaction.manager.FinancialTransactionValidateMessage" logger="Q2" />
<participant class="main.java.com.transaction.manager.FinancialTransactionQueryRemoteHost1" logger="Q2" />
<participant class="main.java.com.transaction.manager.FinancialTransactionQueryRemoteHost2" logger="Q2" />
</group>
</txnmgr>
in my FinancialTransactionQueryRemoteHost1 i have
@Override
public int prepare(long l, Serializable srlzbl) {
try{
channelManager = ((ChannelManager) NameRegistrar.get("jpos-host1-adaptor"));
ISOMsg reqMsg = (ISOMsg) ((Context) srlzbl).get(Constants.REQUEST_KEY);
ISOMsg respMsg = channelManager.sendMsg(reqMsg);
((Context) srlzbl).put(Constants.RESPONSE_KEY, respMsg);
return PREPARED;
}catch(NameRegistrar.NotFoundException e){
e.printStackTrace();
return ABORTED;
}catch(Throwable t){
t.printStackTrace();
return ABORTED;
}
}
in my FinancialTransactionQueryRemoteHost2 i have
@Override
public int prepare(long l, Serializable srlzbl) {
try{
channelManager = ((ChannelManager) NameRegistrar.get("jpos-host2-adaptor"));
ISOMsg reqMsg = (ISOMsg) ((Context) srlzbl).get(Constants.REQUEST_KEY);
ISOMsg respMsg = channelManager.sendMsg(reqMsg);
((Context) srlzbl).put(Constants.RESPONSE_KEY, respMsg);
return PREPARED;
}catch(NameRegistrar.NotFoundException e){
e.printStackTrace();
return ABORTED;
}catch(Throwable t){
t.printStackTrace();
return ABORTED;
}
}
in my Financialtransactionresponse i have
@Override
public int prepare(long id, Serializable context) {
Context ctx = (Context)context;
ISOMsg respMsg = (ISOMsg)ctx.get(Constants.RESPONSE_KEY);
//Get IsoMsg from host1
//Get IsoMsg from host2
//compare field 39 response if both are 00
String bit39 = respMsg.getString(70);
if(bit39==null){
respMsg.set(39,"06");
}
ctx.put(Constants.RESPONSE_KEY,respMsg);
return PREPARED;
}
in my transactionresponse how do i get the response of the 2 participant so i can compare before responding i.e comment above on how i would like it to be achieved