Formatting Messages in Java to Communicate with Legacy Systems, Part 1

A lot of new applications are being written today in Java. Companies also have a vested interest in maintaining their legacy systems. So there is a need for Java applications to communicate with legacy systems through messages that those systems can interpret properly.

provided by: 
Originally published at Internet.com


Introduction



A lot of new applications are being written today in Java. Companies also have a vested interest in maintaining their legacy systems. So there is a need for Java applications to communicate with legacy systems through messages that those systems can interpret properly.

This article discusses some of the issues involved in formatting messages to be sent to a legacy system. The legacy system usually expects its messages in a rigid format. We will illustrate how such a message can be built in Java. And we will also show how to construct a byte stream in EBCDIC (Extended Binary Coded Decimal Interchange Code) format in a Java application.

I work on a Java application that uses sockets to communicate with the legacy system. Two threads exist, one to write to the legacy system and another to read messages from it. This document is not intended to discuss the architecture. The focus is on building the message that needs to be sent.
The message format:


Here is a sample message format that we will use in this document. Note that this is just a hypothetical message and the goal here is to study how to construct the message.

Bitmap (16 bytes) : 11110000 00000000 Data Item 1 : 6 digit integer Data Item 2 : ... ... ... Data Item 15 : .... Data Item 16 : ......

Read article at Internet.com site
Regional Articles
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Alabama
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Alaska
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Arizona
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Arkansas
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 California
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Colorado
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Connecticut
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 DC
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Delaware
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Florida
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Georgia
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Hawaii
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Idaho
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Illinois
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Indiana
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Iowa
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Kansas
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Kentucky
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Louisiana
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Maine
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Maryland
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Massachusetts
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Michigan
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Minnesota
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Mississippi
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Missouri
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Montana
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Nebraska
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Nevada
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 New Hampshire
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 New Jersey
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 New Mexico
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 New York
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 North Carolina
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 North Dakota
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Ohio
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Oklahoma
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Oregon
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Pennsylvania
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Rhode Island
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 South Carolina
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 South Dakota
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Tennessee
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Texas
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Utah
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Vermont
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Virginia
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Washington
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 West Virginia
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Wisconsin
- Formatting Messages in Java to Communicate with Legacy Systems, Part 1 Wyoming

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML