Kafka Consumer Service

The Kafka Consumer service uses the session created in Kafka begin session service and pulls messages from the Kafka queue.

The following table provides an overview of the Kafka Consumer service:

System name Kafka Producer Service
Description This service is used to pull documents from external trading partner Kafka queue.
Business usage Use this service to pull documents from 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 Consumer Service uses this session to pull a document from specific Kafka topic. The Consumer 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:
  • Kafka Client Adapter
  • Kafka Producer Service
  • Kafka Begin Session Service
  • Kafka End Session Service
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 Consumer Service

To configure the Kafka Consumer 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:
  • None (default) – You do not want to include this configuration in a group at this time.
  • Create New Group – You can enter a name for a new group in this field, which will then be created along with this configuration.
  • Select Group – If you have already created one or more groups for this service type, they are displayed in the list. Select a group from the list.
Note: For more information about groups, see Managing Services and Adapters.
Action Get - To get a document from 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 pulled from.

Output from Service to Business Process

The following table contains the parameters passed from the Kafka Consumer Service to the business process:

Parameter Description
Document The documents pulled are visible in the instance data. Each document is added as an entry in the message from the service section. If only one document is pulled, it appears as the primary document.

Business Process Example

The following example business process illustrates using the Kafka Consumer service:

<process name="KafkaExample">
[[Begin session here]] 
<!-- Kafka Consumer Service -->
	<operation name="Kafka Client Consumer Service">
	<participant name="KafkaConsumerService"/>
	<output message="xout">
		<assign to="SessionID" from="SessionID/text()"/>
		<assign to="KafkaClientAdapter" from="KafkaClientAdapter/text()"/>
		<assign to='Topic'>//Topic to consumer messages from</assign>
	<input message="xin">
		<assign to="." from="*"/>
</operation> [[End session here]]