This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import requests | |
| def _get_token(config): | |
| payload = {"grant_type": "client_credentials", "scope": "api.iam.service_accounts"} | |
| resp = requests.post( | |
| RHOAS_SERVICE_ACCOUNT_OAUTH_TOKEN_URL, | |
| auth=( | |
| RHOAS_SERVICE_ACCOUNT_CLIENT_ID, | |
| RHOAS_SERVICE_ACCOUNT_CLIENT_SECRET, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Arrays; | |
| import org.apache.kafka.clients.consumer.ConsumerConfig; | |
| import org.apache.kafka.clients.consumer.KafkaConsumer; | |
| import org.apache.kafka.common.serialization.StringDeserializer; | |
| import org.apache.kafka.clients.consumer.ConsumerRecord; | |
| import org.apache.kafka.clients.consumer.ConsumerRecords; | |
| import java.time.Duration; | |
| public class ConsumerExample { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.acme.kafka; | |
| import javax.enterprise.context.ApplicationScoped; | |
| import org.eclipse.microprofile.reactive.messaging.Acknowledgment; | |
| import org.eclipse.microprofile.reactive.messaging.Incoming; | |
| import org.eclipse.microprofile.reactive.messaging.Outgoing; | |
| import io.smallrye.reactive.messaging.annotations.Broadcast; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.HashMap; | |
| import java.util.Map; | |
| public class KafkaConfig { | |
| static Map<String, Object> config() { | |
| Map<String, Object> config = new HashMap<>(); | |
| config.put("bootstrap.servers", KAFKA_HOST); |
OlderNewer