Using Common Simulator To Create Any Simulator

Common Simulator is a library to create any simulator which use field based message such as ISO-8583 message, or properties like message.

Once you download common-simulator package, you can start creating a simulator. The main methods in the library are:

  1. BaseProcessor.process(Map incomingMsg, List resTemplates, Sender responseSender) which is called to handle incoming message so that it can react when a matched message comes
  2. BaseProcessor.processRequest(RequestTemplate template, Sender requestSender) which is manually called, e.g. if you want to send a request to remote host

Please look at this example. Supposed you have a class which interact to ISO-8583 remote host via socket, just like the following:

public class Handler {
	// Called once a message arrived
	public void messageReceived(Iso8583Message msg, Socket socket) {
		// find a matched request message then response back to socket
	}

	// Called when you start your application
	public void start() {
		TimerTask task = new TimerTask() {

			@Override
			public void run() {
				// Send an echo message
			}

		};
		periodicTasks.add(task);
		new Timer().schedule(task, 0, 1000); // Send echo each 1 second
	}
}

To complete this code, please look at the Wiki

For more question, you can comment here. Thanks!

Comments

Aditya : Complete code for handling ISO 8583 simulaor

can anybody please provide implementation classes for ISO 8583 simulator

Adit, I think the example is clear enough. If you're not satisfied, please decompile ISO-8583 simulator implementation to see how it works