Creating a New Custom BusinessEvents Channel
You can use the custom channel API to create a custom channel according to your requirement for your project.
The Java API for custom channel (com.tibco.be.custom.channel package) is bundled with TIBCO BusinessEvents. For more information about the classes in the
com.tibco.be.custom.channel package see
Java API Reference.
Procedure
Define the drivers.xml file
Create a JAR file
Include the JAR file in BusinessEvents classpath
Sample Kafka Channel Drivers.xml File
The following sample code is of the
drivers.xml file for the Kafka channel example:
<?xml version="1.0" encoding="UTF-8"?> <drivers> <driver> <type>Kafka(API Example)</type> <label>Kafka(API Example)</label> <class>com.tibco.be.custom.channel.kafka.KafkaDriver</class> <description>Apache Kafka is an open-source message broker project developed by the Apache Software Foundation written in Scala. The project aims to provide a unified, high-throughput, low-latency platform for handling real-time data feeds.</description> <version>1.0.0.0</version> <properties> <property name="kafka.broker.urls" displayName="Kafka Broker Urls" type="String" default="localhost:9092"/> </properties> <destinations> <property name="group.id" displayName="GroupID" type="String" default="kafka_group"/> <property name="client.id" displayName="ClientID" type="String" default="BEClient"/> <property name="topic" displayName="Topic" type="String" default="ktopic"/> <property name="consumer.threads" displayName="Consumer Threads" type="Integer" default="1"/> <property name="poll.interval" displayName="Poll Interval" type="Integer" default="100"/> <property name="compression.type" displayName="Compression Type" type="String" default="none"/> </destinations> <serializers userdefined="true"> <serializer type="Map" class="com.tibco.be.custom.channel.kafka.serializer.KafkaMapSerializer"/> </serializers> <!-- Define combo-boxes that are referred to in destination properties. --> <configuration> <property> <name>compression.type</name> <parent>destination</parent> <type>combo-box</type> <choices> <choice value="none" displayed="none"/> <choice value="gzip" displayed="gzip"/> <choice value="snappy" displayed="snappy"/> <choice value="lz4" displayed="lz4"/> </choices> </property> </configuration> </driver> </drivers>
Copyright © TIBCO Software Inc. All rights reserved.