I want to create dummy backend for ISO 8583 messages. The necessary condition for this problem is "to run the jPos/other ATM test-suite against this backend".
Asked
Active
Viewed 2,335 times
2
-
1So, what's your problem? – v.karbovnichy Aug 13 '14 at 12:24
-
I want to know the possible methods for doing this task – user3886591 Aug 13 '14 at 12:31
-
Did you do any investigation? – v.karbovnichy Aug 13 '14 at 12:40
-
1I did but not able to get any proper direction . Like i got this site and a blog, link: http://j8583.sourceforge.net/index.html and http://paparadit.blogspot.in/2012_07_01_archive.html . – user3886591 Aug 13 '14 at 12:44
-
1Can anyone provide me some sort of implementation methodology for doing this task.? – user3886591 Aug 13 '14 at 12:46
-
I assume there is some sort of "dummy" ISO 8583 server emulators. from this answer: http://stackoverflow.com/questions/22362501/how-should-jpos-be-configured-used-in-a-prod-environment?rq=1 – v.karbovnichy Aug 13 '14 at 12:53
1 Answers
2
You may try simple jReactive-iso8583 server.
Have a look at client-server integration test.
Usage example:
Spring config:
@Configuration
public class Iso8583ServerConfig {
@Value("${iso8583.connection.port}")
int port;
@Bean
public org.jreactive.iso8583.server.Iso8583Server iso8583Server() throws IOException {
return new org.jreactive.iso8583.server.Iso8583Server(port, serverMessageFactory());
}
@Bean
MessageFactory serverMessageFactory() throws IOException {
MessageFactory messageFactory = ConfigParser.createDefault();
messageFactory.setCharacterEncoding(StandardCharsets.US_ASCII.name());
messageFactory.setUseBinaryMessages(false);
messageFactory.setAssignDate(true);
return messageFactory;
}
}
Add custom message listener somewhere:
server.addMessageListener(new IsoMessageListener() {
@Override
public boolean applies(IsoMessage isoMessage) {
return isoMessage.getType() == 0x200;
}
@Override
public boolean onMessage(ChannelHandlerContext ctx, IsoMessage isoMessage) {
capturedRequest = isoMessage;
final IsoMessage response = server.getIsoMessageFactory().createResponse(isoMessage);
response.setField(39, IsoType.ALPHA.value("00", 2));
response.setField(60, IsoType.LLLVAR.value("XXX", 3));
ctx.writeAndFlush(response);
return false;
}
});
Then run a server:
server.init();
server.start();
Shutdown server:
server.shutdown();

Konstantin Pavlov
- 956
- 1
- 10
- 24