IBM Sterling B2B: Configuring SB2Bi to use Kafka

From Wiki

1) Deploy Kafka: Deploy Kafka as Container

2) Using Kwol create topics

  • sb2b-kfk-inbound
  • sb2b-kfk-outbound


Put and Get Files from Kafka

Create a Custom Protocol in SFG to use with Kafka


Configure Kafka Consumer Streams Adapter

The Kafka Consumer Streams Adapter connects with a Kafka queue to pull messages continuously.

  • Important: key must be the filename of file.


Configuring the Adapter

1) To Create a new Adapter, open Dashboard > Deployment > Configuration

2) Search for Kafka Consumer Stream Service, and click Next

3) Define a name and description, and click Next

4) Define Bootstrap Server and Topic, and click Next

5) In Deserializer, click Next

6) In properties, click Next

7) Choose to write the file to a Mailbox, and click Next

8) Define a Mailbox to write the file , and click Next

9) Click Next and Finish

Now this adapter will use BP KafkaStreamServiceMailbox to monitor topics and write to mailboxes.

<process name="KafkaStreamServiceMailbox">
 <sequence>
   <operation name="SetUserContext">
     <participant name="SetUserTokenServiceKafka"/>
     <output message="xin">
       <assign to="USER_TOKEN" from="//MAILBOXUSER/text()"/>
     </output>
     <input message="xout">
       <assign to="." from="*"/>
     </input>
   </operation>
   <operation name="Mailbox Add Service">
     <participant name="MailboxAdd"/>
     <output message="MailboxAddServiceTypeInputMessage">
       <assign to="." from="*"/>
       <assign to="Extractable">Yes</assign>
       <assign to="MailboxPath" from="//MAILBOXPATH/text()"/>
       <assign to="DocumentId" from="/PrimaryDocument/@SCIObjectID"/>
       <assign to="MessageName" from="//Files/Documents/Document/Name/text()"/>
       <assign to="UseGlobalMailboxes" from="//GLOBALMAILBOX/text()"/>
     </output>
     <input message="inmsg">
       <assign to="MailboxAddResult" from="*"/>
     </input>
   </operation>
 </sequence>
</process>

Check Topics and messages

To check Topics and messages i using Kowl

Ver também