[ 
https://issues.apache.org/jira/browse/OFBIZ-13177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gaetan Chaboussie updated OFBIZ-13177:
--------------------------------------
    Attachment: OFBIZ-13177.patch

> Add a Kafka Consumer to OFBiz
> -----------------------------
>
>                 Key: OFBIZ-13177
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13177
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: base
>    Affects Versions: Upcoming Branch
>            Reporter: Gaetan Chaboussie
>            Priority: Major
>         Attachments: OFBIZ-13177.patch
>
>
> We had to implement a Kafka consumer for a client and made a community 
> version of it to save some time for next community members that might need 
> it, like the JMS engine.
>  
> Kafka test and dev procedure
> ===
> Dev can be tested localy with the followind steps :
> 1) download apache kafka on official website :
> [https://www.apache.org/dyn/closer.cgi?path=/kafka/3.9.0/kafka_2.13-3.9.0.tgz]
> then extract and navigate in extracted folder
> 2) Run via zookeeper
> {code:java}
> bin/zookeeper-server-start.sh config/zookeeper.properties
> {code}
> 3) start kafka
> In an other shell start kafka producer :
> {code:java}
> bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server 
> localhost:9092{code}
> In this case, with a specific topic `quickstart-events` and an address 
> `localhost:9092`
> 4) configure ofbiz to connect to local Kafka
>  
> {code:java}
> # in kafka.properties 
> kafka.cluster.url=localhost:9092 {code}
>  
>  
> {code:java}
> <!-- in ofbiz-component -->
>     <container name="OfbizKafkaListener" loaders="main" 
> class="org.apache.ofbiz.service.kafka.KafkaListenerContainer">
>         <property name="enabled" value="Y"/>
>         <property name="consumer-class" 
> value="org.apache.ofbiz.service.kafka.DefaultKafkaConsumer"/>
>         <property name="kafkaConfigFile" value="kafka"/>
>         <property name="topics" value="quickstart-events"/>
>     </container> {code}
>  
>  
> And start ofbiz with seed data loaded.
> 5) in new shell, emit some kafka data :
>  
> {code:java}
> bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server 
> localhost:9092 {code}
> Just type some characters and hit enter to emit data.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to