-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish message to Kafka topic (KRaft) with Dapr C# #1291
Comments
@abdul-hafeel My guess would be it's one of two things:
|
I'm new to Dapr as well as Kafka. Currently, for my .NET 8 desktop app, I want to implement Dapr with Kafka(KRaft), for that I'm working on POC, there I'm facing issues that:
'Dapr.DaprException: 'Publish operation failed: the Dapr endpoint indicated a failure'. ({"Status(StatusCode="Unavailable", Detail="Error connecting to subchannel.", DebugException="System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it.")"}).
docker-compose.yaml for Kafka image in Docker
`version: "3.8"
services:
kafka:
image: docker.io/bitnami/kafka:3.7
container_name: kafka
ports:
- "9092:9092"
volumes:
- "kafka_data:/bitnami"
- "./kafka.keystore.jks:/bitnami/kafka/config/certs/kafka.keystore.jks"
- "./kafka.truststore.jks:/bitnami/kafka/config/certs/kafka.truststore.jks"
environment:
# KRaft settings
- KAFKA_ENABLE_KRAFT=yes
- KAFKA_CFG_NODE_ID=0
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093
# Listeners
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://:9092
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT
# Additional settings
- KAFKA_ADVERTISED_HOST_NAME=127.0.0.1
- KAFKA_CREATE_TOPICS="kafka-topic:1:1"
volumes:
kafka_data:
driver: local`
Program.cs
=================================================
In the above line, it is accepted as a string, not a channel.
Kafka pubsub yaml (Dapr configuration)
`apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: kafka-pubsub
namespace: default
spec:
type: pubsub.kafka
version: v1
metadata:
value: "localhost:9092"
value: "my-group"
value: "false"
value: "true"`
Here I have attached tried code and configuration(s). I have turned off the firewall as well. Even though I am facing the same issue. Kindly help me out what I am missing here. Thanks in advance.
The text was updated successfully, but these errors were encountered: