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); |
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.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
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
KAFKA_HOST= | |
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
{ | |
"swagger":"2.0", | |
"info":{ | |
"description":"This is a sample server Petstore server via JSON.", | |
"version":"1.0.0", | |
"title":"Swagger Petstore (JSON)", | |
"termsOfService":"http://helloreverb.com/terms/", | |
"contact":{ | |
"email":"[email protected]" | |
}, |
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
{ | |
"type" : "record", | |
"name" : "Tweet", | |
"fields" : [ | |
{ | |
"name" : "user", | |
"type" : "string" | |
}, | |
{ | |
"name" : "text", |
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
// GetCurrent_Context returns the name of the currently selected context | |
func GetCurrent_Context(svcContext *servicecontext.Context, localizer localize.Localizer) (*servicecontext.ServiceConfig, error) { | |
if svcContext.CurrentContext == "" { | |
return nil, localizer.MustLocalizeError("context.common.error.notSet") | |
} | |
currCtx, ok := svcContext.Contexts[svcContext.CurrentContext] | |
if !ok { | |
return nil, localizer.MustLocalizeError("context.common.error.context.notFound", localize.NewEntry("Name", svcContext.CurrentContext)) |
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
const template = document.createElement('template'); | |
template.innerHTML = ` | |
<div> | |
Hello Weather App | |
</div> | |
` | |
class WeatherCard extends HTMLElement { | |
constructor() { |
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
<template> | |
<div class="hello"> | |
<a href="http://localhost:3000/auth/github"> | |
<button>Sign-In With Github</button> | |
</a> | |
</div> | |
</template> | |
<script> | |
import axios from "axios"; |
NewerOlder