Entering content frame

This graphic is explained in the accompanying text Unpacking the Received Messages Locate the document in its SAP Library structure

This graphic is explained in the accompanying text

When a new message is received, you have to unpack it first. The procedure is the same for both the point-to-point and publish-subscribe messages types, but depends on the type of message you receive.

Unpacking Bytes Message

This graphic is explained in the accompanying text

// create a byte array with the received data

byte [] receivedBytes;

// create an integer object to receive the data with that specified length:

int dataLength;

// get the data from the Bytes Message:

dataLength = bytesMessage.readBytes(receivedBytes);

Unpacking Map Message

The data received by the map message can be read in any order.

This graphic is explained in the accompanying text

String stringData;

long longData;

stringData = mapMessage.getString(“message”);

longData = mapMessage.getLong(“long”);

Unpacking Object Message

To unpack an object message, you must make methods in the Serializable class that can transmit this data to your message. Then you have to create objects to take the data from this object:

This graphic is explained in the accompanying text

String stringValue;

long longValue;

Class_Implementing_Serialaizable cis = new Class_Implementing_Serialaizable();

cis =  objectMessage.getObject();

stringValue = cis.getString();

longValue = cis.getLong();

Unpacking Stream Message

To unpack the stream message you have to get its data in the order it was sent.

This graphic is explained in the accompanying text

String stringValue;

long longValue;

stringValue = streamMessage.readString();

longValue = streamMessage.readLong();

Unpacking Text Message

This graphic is explained in the accompanying text

String text;

text = textMessage.getText();

 

 

Leaving content frame