T4S4  18.1 C7177 A20283
Teamcenter Gateway for SAP S/4HANA API Reference
T4X::MESSAGING Namespace Reference

Functions

 acknowledgeMessage connectionID messageID
 Explicitly acknowledge a specific message via an open consumer connection. More...
 
 closeAll ?timeout?
 Close all opened connections including the pipe. More...
 
 closeConnection connectionID ?timeout?
 Close a specific producer or consumer connection. Clean up all stored messages for this connection. If no other connection exists, also close the pipe. More...
 
 receiveMessage connectionID receiveMode ?timeout?
 Receive binary or text messages via an open consumer connection. More...
 
 sendBinaryMessage connectionID properties payload ?headers?
 Send binary messages via an open producer connection. (wrapper to sendMessage) More...
 
 sendStringMessage connectionID properties payload ?headers?
 Send text messages via an open producer connection. (wrapper to sendMessage) More...
 
 startConnection connectionID connectionType config ?userName? ?password?
 Start a producer or consumer connection for a given configuration. More...
 

Function Documentation

◆ acknowledgeMessage()

T4X::MESSAGING::acknowledgeMessage   connectionID messageID  

Explicitly acknowledge a specific message via an open consumer connection.

Note: In order to explicitly acknowledge messages, the acknowledge mode needs to be set to CLIENT_ACKNOWLEDGE in the configuration dictionary passed to procedure startConnection (key t4x.acknowledgeMode)

Parameters
connectionID- Unique identifier of the consumer connection
messageID- ID of the message to be acknowledged (message ID returned by receiveMessage)
Returns
OK or list of ERROR and message

References T4X::CORE::getLogLineMessageType4rc(), T4X::CORE::getSessionLogChannel(), T4X::JAVASERVER::setDefaultLogChannel(), T4X::OBJECTS::tpwith(), and tpwrite().

◆ closeAll()

T4X::MESSAGING::closeAll   ?timeout?  

Close all opened connections including the pipe.

Parameters
timeout- Pipe shutdown timeout (Optional - Default: Empty)
Returns
OK or list of ERROR and message

References T4X::CORE::getLogLineMessageType4rc(), T4X::CORE::getSessionLogChannel(), T4X::JAVASERVER::setDefaultLogChannel(), T4X::JAVASERVER::tpcontrol(), T4X::OBJECTS::tplet(), T4X::OBJECTS::tprevertto(), and tpwrite().

◆ closeConnection()

T4X::MESSAGING::closeConnection   connectionID ?timeout?  

Close a specific producer or consumer connection. Clean up all stored messages for this connection. If no other connection exists, also close the pipe.

Parameters
connectionID- Unique identifier of the producer or consumer connection
timeout- Pipe shutdown timeout (Optional - Default: Empty)
Returns
OK or list of ERROR and message

References T4X::CORE::getLogLineMessageType4rc(), T4X::CORE::getSessionLogChannel(), T4X::JAVASERVER::setDefaultLogChannel(), T4X::JAVASERVER::tpcontrol(), T4X::OBJECTS::tprevertto(), T4X::OBJECTS::tpwith(), and tpwrite().

◆ receiveMessage()

T4X::MESSAGING::receiveMessage   connectionID receiveMode ?timeout?  

Receive binary or text messages via an open consumer connection.

Parameters
connectionID- Unique identifier of the consumer connection
receiveMode- Possible receive modes: BLOCK - Blocks indefinitely until a message is produced or until this message consumer is closed. BLOCK_TIMEOUT - Blocks until a message arrives, the timeout expires, or this message consumer is closed. NON_BLOCK - Receives the next message if one is immediately available.
timeout- The timeout for BLOCK_TIMEOUT mode (Optional - Default: 1000)
Returns
Success case: * List of OK, message ID, received message properties dictionary, received message body, received message headers dictionary and 0|1 if the received body is binary or not.
  • OK if no message was received in NON_BLOCK mode. The message ID can be passed to function acknowledgeMessage. Note that the message ID is equal to the JMSMessageID field of the returned headers. Error case: List of ERROR and message

References T4X::CORE::getLogLineMessageType4rc(), T4X::CORE::getSessionLogChannel(), T4X::JAVASERVER::setDefaultLogChannel(), T4X::OBJECTS::tplet(), T4X::OBJECTS::tpwith(), and tpwrite().

◆ sendBinaryMessage()

T4X::MESSAGING::sendBinaryMessage   connectionID properties payload ?headers?  

Send binary messages via an open producer connection. (wrapper to sendMessage)

Parameters
connectionID- Unique identifier of the producer connection
properties- Dictionary containing the message property fields
payload- Message body containing binary data. Note: The binary message body data passed to this parameter needs to be HEX16. Use interfaces tpco_H16Bin2File and tpco_readfileH16 in order to convert file data correctly.
headers- Dictionary containing the message header fields
Returns
OK or list of ERROR and message

References T4X::CORE::getSessionLogChannel(), and tpwrite().

◆ sendStringMessage()

T4X::MESSAGING::sendStringMessage   connectionID properties payload ?headers?  

Send text messages via an open producer connection. (wrapper to sendMessage)

Parameters
connectionID- Unique identifier of the producer connection
properties- Dictionary containing the message property fields
payload- Message body containing text data.
headers- Dictionary containing the message header fields
Returns
OK or list of ERROR and message

References T4X::CORE::getSessionLogChannel(), and tpwrite().

◆ startConnection()

T4X::MESSAGING::startConnection   connectionID connectionType config ?userName? ?password?  

Start a producer or consumer connection for a given configuration.

Note: If the connection for specified connectionID already exists in cache, nothing is done.

Parameters
connectionID- Unique identifier for the connection
connectionType- Connection type: PRODUCER for sending messages CONSUMER for receiving messages
config- Dictionary containing the following configuration parameters of the connection:
  • provider specific settings like the provider URL, initial context factory, connection factory...
  • T4x keys: t4x.acknowledgeMode - Possible acknowledge modes: AUTO_ACKNOWLEDGE | CLIENT_ACKNOWLEDGE t4x.queueName - Queue name: The JNDI queue name. t4x.queueValue - Queue value: The physical queue name. Note: It depends on the JMS provider whether the queueValue needs to be specified. E.g. for Active MQ it is required to set the queueValue whereas for IBM MQ it may be lef out.
userName- The caller's user name (Optional). If not specified, a connection with the default user identity will be establised.
password- The caller's password (Optional).
Returns
OK or list of ERROR and message

References T4X::CORE::getLogLineMessageType4rc(), T4X::CORE::getSessionLogChannel(), T4X::JAVASERVER::setDefaultLogChannel(), T4X::OBJECTS::tpmodule(), T4X::OBJECTS::tpsnapshot(), T4X::OBJECTS::tpwith(), and tpwrite().