An OLTP message-driven bean must implement exactly one of the following interfaces:
AsyncOltpMessageListener
OltpMessageListener
An
OltpMessage
object may consist of one or moreOltpMessagePart
objects and/or one or moreOltpMessageRecord
objects. Whereas anOltpMessageRecord
is of arbitrary length, anOltpMessagePart
object must not exceed a length of 32767 bytes.You can retrieve the message content from
OltpMessagePart
andOltpMessageRecord
objects as an object of one of the following types:byte[]
String
ByteContainer
An OLTP message-driven bean may implement the
ByteContainer
interface if it wants to exchange structured objects containing text and binary information with an EIS application. Here, code conversion needs to be performed for the text information of the structured object. For objects of typeString
, code conversion is performed by BeanConnect. For details, see the JavaDoc of BeanConnect.The sequence in which
OltpMessagePart
- and/orOlpMessageRecord objects
are added to anOltpMessage
or are returned by anOltpMessage
corresponds to the sequence in which the message was sent or received.The interface
OltpMessageContext
serves two purposes:It provides a method for generating a reply message.
It allows status information to be retrieved.
An OLTP message-driven bean may call the methods of the interface
OltpMessageContext
only from within theonMessage()
method.When calling the method
addMessagePart()
or the methodaddMessageRecord()
within the methodonMessage()
, you must use the sameOltpMessage
that was used to call one of the methodscreateMessagePart()
orcreateMessageRecord()
respectively.Asynchronous OLTP message-driven beans receive asynchronous messages, which arrive independently of the initiator's availability. Therefore, neither a reply message nor an exception thrown by an asynchronous OLTP message-driven bean can be returned to the initiator of the asynchronous message.
If transactional communication via the OSI-TP protocol is used between the EIS application and BeanConnect, the method
onMessage(OltpMessage)
of a dialog based OLTPmessage-driven bean participates in a distributed transaction, if the transaction attributeRequired
has been assigned to this method.Asynchronous OLTP message-driven beans can never be part of a transaction that is distributed between the EIS application and the application server.
The method
onMessage()
of an asynchronous OLTP message-driven bean which has been deployed with the transaction attributeRequired
is called in the transaction, which has been started by the proxy (never by the EIS). If the transaction is rolled back, the asynchronous message is redelivered to the OLTP message-driven bean if necessary.The OLTP message-driven bean can detect such a situation by evaluating the delivery count value of an asynchronous
OltpMessage
object. TheredeliveryThreshold
activation-config property, which is specified at deployment of the OLTP messagedriven bean, defines the number of additional attempts to deliver the message if an error occurs (see "reconnectThreshold" in Setting the configuration properties for UPIC ).The support methods of the interface
EncodingDef
are available through the interfaceOltpMessageContext
for exchanging messages in codes other than ASCII.
For detailed information, refer to the JavaDoc of BeanConnect.