Protect Debug Info Transaction Participant

jPOS-EE has a very handy transaction participant called “Debug” its main purpose is to dump the contents of the jPOS’s Context. While this is very helpful in test modes and during development – The context remains “un-protected” and all of the data remains in the clear. Even the ProtectedLogListener and FSDProtectedLogListener will not protect data in the context.

Enter the ProtectDebugInfo Transaction Participant a configurable implementation I wrote based on some of Alejandro’s ideas, and one that lives in most of OLS’s payment products in various specific iterations.

It’s configuration looks like:


Protecting your q2.log in this truncated example:

<entry key=‘FSDMESSAGE’>
<fsdmsg schema=‘file:cfg/fsd-base’>
account-number: ‘599999______0001’
<entry key=‘PAN’>599999______0001</entry>
<entry key=‘RESPONSE’>
<isomsg direction=“incoming”>
<field id=“0” value=“2110”/>
<field id=“2” value=“599999______0001”/>
<field id=“35” value=“599999______0001=____________________”/>
<entry key=‘REQUEST’>
<isomsg direction=“incoming”>
<field id=“0” value=“2100”/>
<field id=“2” value=“599999______0001”/>
<field id=“35” value=“599999______0001=____________________”/>

jPOS Twitter Integration

For fun I decided to develop a TwitterLogListener class for the jPOS Framework. It leverages JTwitter – the Java library for the Twitter API from Daniel Winterstein. With this, you can send alerts and/or messages to a twitter account for monitoring from a jPOS application.

You need to configure a TwitterLogListener in your logger:

<log-listener class="org.jpos.util.TwitterLogListener">
 <property name="twitterUsername" value="paymentsystems" />
 <property name="twitterPassword" value="SuperSecretPassword" />
 <property name="tags" value="twitter" />
 <property name="prefix" value="[jPOS]"/>

And you need to Log an event with a ‘twitter’ tag:

<script name="test" logger="Q2">
     import org.jpos.util.*;
         for (int i=0; qbean.running(); i++) {
              LogEvent evt = log.createLogEvent ("twitter");
              evt.addMessage ("This is a Twitter message test from jPOS! " +   i);
              Logger.log (evt);
	           Thread.sleep (10000L);

Look at the messages in a twitter account: 🙂

For more details on this see this post: