Kafka Producer Service
The Kafka Producer service uses the session created in Kafka Begin Session Service and pushes a message to the Kafka queue.
The following table provides an overview of the Kafka Producer service:
System name | Kafka Producer Service |
---|---|
Description | This service is used to push documents to external trading partner Kafka queue. |
Business usage | Use this service to push documents to a trading partner Kafka queue. |
Usage example | Sterling B2B Integrator uses the Kafka Client Begin Session service to establish a session with the trading partner's Kafka queue. The Kafka Producer Service uses this session to push a document to specific Kafka topic. The Producer service works through a configuration of the Kafka Client adapter. |
Preconfigured? | No |
Requires third-party files? | No |
Platform availability | All Sterling B2B Integrator supported platforms. |
Related services | Related services:
|
Application requirements | A Kafka server. |
Initiates business processes? | This service does not initiate business processes. |
Invocation | This service is invoked from a business process. |
Returned status values | N/A |
Restrictions | N/A |
Persistence level | Default |
Testing considerations | Test this service by running the KafkaClientDemoAllServices business process provided with Sterling B2B Integrator. This business process tests the Kafka Client adapter and all its related services. |
Configuring the Kafka Producer Service
To configure the Kafka Producer service, you must specify settings for the following fields in the GPM:
Field | Description |
---|---|
Name | Name this service will have in Sterling B2B Integrator. Required. |
Description | Description of service. Required. |
Select a Group | Select one of the options:
Note: For more information about groups, see Managing Services and Adapters.
|
Action | Put - To push a document to the Kafka queue. |
KafkaClientAdapter | Select the Kafka Client adapter for this service to use when beginning sessions with a Kafka server. |
Session ID | Session ID is a unique identifier created from the Kafka Begin Session Service. |
Topic | The Kafka topic where the document is pushed. |
Output from Service to Business Process
The following table contains the parameters passed from the Kafka Producer Service to the business process:
Parameter | Description |
---|---|
Primary Document | The document pushed is stored as primary document and visible in the instance data. |
Business Process Example
The following example business process illustrates using the Kafka Producer service:
<process name="KafkaExample">
<sequence>
[[Begin session here]]
<operation name="Kafka Client Producer Service">
<participant name="KafkaProducerService"/>
<output message="xout">
<assign to="SessionID" from="SessionID/text()"/>
<assign to="KafkaClientAdapter" from="KafkaClientAdapter/text()"/>
<assign to='Topic'>// Topic to produce the message to</assign>
<assign to='.' from='PrimaryDocument'/>
</output>
<input message="xin">
<assign to="." from="*"/>
</input>
</operation>
[[End session here]]
</process>