I am working on a bi-directional adapter which applies some transformations on ISO8583 messages and send it to another side. But one side of adapter sends the messages which don't have bitmap.
2019-01-26 13:38:27,774 ChannelServerEndpoint.run() Can't parse request 1804179121190126120635801
In real scenario after MIT(1804) I should had 8 or 16 hex digit as Bitmap. like this one:
Sending request: 163726, ISO Message: <br/>**18040030010000000000163726190123065952831**<br/>
TYPE: 1804<br/>
F 11(NUMERIC): 163726 -> '163726'<br/>
F 12(DATE12): 190123065952 -> '190123065952'<br/>
F 24(NUMERIC): 831 -> '831'<br/>
I am using J8583.
try {
log.debug(String.format("Parsing incoming: '%s'", new String(
data)));
// incoming message
IsoMessage incomingMessage = messageFactory.parseMessage(data, NetworkInterfaceConfiguration.MESSAGE_HEADER_LENGTH);
// System.out.printf("Message TYPE: %s", messageType);
MessageTransformer transformer = new MessageTransformer(incomingMessage);
transformer.run();
if (transformer.getIsoMessage() != null) {
System.out.println("We are before assigning transformations");
transformedMessage = transformer.getIsoMessage();
} else {
log.error("Transformation is failed.");
}
IsoMessageUtil.printIsoMessage(transformedMessage);
log.info("Firing Message to Dist....");
ChannelClientEndpint.fireMessage(transformedMessage);
} catch (ParseException ex) {
log.error(String.format("Can't parse request %s", new String(data)));
throw new UnknownError(ex.getMessage());
} catch (IOException ex) {
log.error("Writing response", ex);
throw new UncheckedIOException(ex.getMessage(), ex);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
throw new UnknownError(ex.getMessage());
}
Could you help me to solve this problem?
There's no way to parse an ISO8583 message without a bitmap AND a spec for the type of each field. If you know which fields you are supposed to receive and of what type they are, you need to configure the MessageFactory
that way, and manually insert a bitmap into your data so it can be parsed as a regular ISO8583 message.