Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.kpavlov:jreactive-8583:1.3.4'
}
dependencies {
implementation("com.github.kpavlov:jreactive-8583:1.3.4")
}
<dependency>
<groupId>com.github.kpavlov</groupId>
<artifactId>jreactive-8583</artifactId>
<version>1.3.4</version>
</dependency>
libraryDependencies += "com.github.kpavlov" % "jreactive-8583" % "1.3.4"
:dependencies [[com.github.kpavlov/jreactive-8583 "1.3.4"]]
Free ISO8583 Connector for JDK (Netty)
Solution: "J-Reactive-8583" ISO8583 Client and Server built on top of excellent Netty asynchronous messaging framework with the help of j8583 for encoding/decoding. It is distributed under Apache License 2.0.
For data transmission TCP/IP uses sessions. Each session is a bi-directional data stream. The protocol uses a single TCP/IP session to transfer data between hosts in both directions.
The continuous TCP/IP data stream is split into frames. Each ISO8583 message is sent in a separate frame.
A Frame consists of an N-byte length header and message body. Usually, N==2. The header contains the length of the following message. The high byte of value is transmitted first, and the low byte of value is transmitted second.
| N bytes | M bytes | | ------------------ | ------------------ | | Message Length = M | ISO–8583 Message |
Add dependency to your project:
<dependencies>
<dependency>
<groupId>com.github.kpavlov.jreactive8583</groupId>
<artifactId>netty-iso8583</artifactId>
<version>${LATEST_VERSION}</version>
</dependency>
</dependencies>
Now you may use ISO8583 client or server in your code.
The minimal client workflow includes:
var messageFactory = new J8583MessageFactory<>(ISO8583Version.V1987, MessageOrigin.OTHER);// [1]
Iso8583Client<IsoMessage> client = new Iso8583Client<>(messageFactory);// [2]
client.addMessageListener(new IsoMessageListener<IsoMessage>() { // [3]
...
});
client.getConfiguration().replyOnError(true);// [4]
client.init();// [5]
client.connect(host, port);// [6]
if (client.isConnected()) { // [7]
IsoMessage message = messageFactory.newMessage(...);
...
client.sendAsync(message);// [8]
// or
client.send(message);// [9]
// or
client.send(message, 1, TimeUnit.SECONDS);// [10]
}
...
client.shutdown();// [11]
MessageFactory
. You MUST specify a role of your client for
originated messages, e.g. ACQUIRER
, ISSUER
or OTHER
.Iso8583Client
providing MessageFactory
and,
optionally, SocketAddress
IsoMessageListener
s to handle IsoMessage
s.IsoMessage
asynchronouslyIsoMessage
synchronouslyIsoMessage
synchronously with timeout supportTypical server workflow includes:
var messageFactory = new J8583MessageFactory<>(ConfigParser.createDefault(), ISO8583Version.V1987, MessageOrigin.ACQUIRER);// [1]
Iso8583Server<IsoMessage> server = new Iso8583Server<>(port, messageFactory);// [2]
server.addMessageListener(new IsoMessageListener<IsoMessage>() { // [3]
...
});
server.getConfiguration().replyOnError(true);// [4]
server.init();// [5]
server.start();// [6]
if (server.isStarted()) { // [7]
...
}
...
server.shutdown();// [8]
MessageFactory
. You MUST specify a role of your server for
originated messages, e.g. ACQUIRER
, ISSUER
or OTHER
.Iso8583Server
providing MessageFactory
and port to bind toIsoMessageListener
s to handle IsoMessage
s.Default IsoMessageLoggingHandler
may produce output like:
312 [nioEventLoopGroup-5-1] DEBUG IsoMessageLoggingHandler - [id: 0xa72cc005, /127.0.0.1:50853 => /127.0.0.1:9876] MTI: 0x0200
2: [Primary account number (PAN):NUMERIC(19)] = '000400*********0002'
3: [Processing code:NUMERIC(6)] = '650000'
7: [Transmission date & time:DATE10(10)] = '0720233443'
11: [System trace audit number:NUMERIC(6)] = '483248'
32: [Acquiring institution identification code:LLVAR(3)] = '456'
35: [Track 2 data:LLVAR(17)] = '***'
43: [Card acceptor name/location (1-23 address 24-36 city 37-38 state 39-40 country):ALPHA(40)] = 'SOLABTEST TEST-3 DF MX '
49: [Currency code, transaction:ALPHA(3)] = '484'
60: [Reserved national:LLLVAR(3)] = 'foo'
61: [Reserved private:LLLVAR(5)] = '1234P'
100: [Receiving institution identification code:LLVAR(3)] = '999'
102: [Account identification 1:LLVAR(4)] = 'ABCD'
Using client or server configuration
You may:
See ConnectorConfiguration , ServerConfiguration and ClientConfiguration .
For frequently asked questions check the FAQ page.
Message processing is described in the following diagram:
<small >Made with contrib.rocks.</small>