Skip to content
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

subscribing to a kafkatopic with avro messages results in a 400 bad requet when I try to consumer and process the message #7694

Open
declan-grogan opened this issue Apr 12, 2024 · 0 comments
Labels
kind/bug Something isn't working

Comments

@declan-grogan
Copy link

In what area(s)?

/area runtime

What version of Dapr?

1.13.2

Expected Behavior

When subscribing to a kafka topic that have avro messages published I expect to subscribe to the topic and receive messages of the type I had published.
My code to test subscribing to the avro messages is here.
@Topic(name = "testkafkatopic2", pubsubName = "eventmessaging")
@PostMapping(path = "/eventmessaging", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity myTopicSubscriber(@requestbody(required = true) MembershipRequest eventData) {
System.out.println(eventData);
return ResponseEntity.ok().build();
}

Actual Behavior

What is happening is the subscriber fails to process the kafka message with the below error.

ERRO[0149] Error processing Kafka message: testkafkatopic2/0/20 [key=]. Error: fails to send binding event to http app channel, status code: 400 body: {"timestamp":"2024-04-12T16:4
3:05.734+00:00","status":400,"error":"Bad Request","path":"/eventmessaging"}. app_id=loyaltycoapi-sub component="eventmessaging (bindings.kafka/v1)" instance=IW-5CG3102693 scope=d
apr.contrib type=log ver=1.13.2

Steps to Reproduce the Problem

Publish a message to kafka with avro serialization.
Subscribe to the topic.

Here is my component binding file for your reference as well.
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: eventmessaging
spec:
type: bindings.kafka
version: v1
metadata:
# Kafka broker connection setting
- name: brokers
value: localhost:19092
# consumer configuration: topic and consumer group
- name: topics
value: testkafkatopic2
- name: consumerGroup
value: group1
# publisher configuration: topic
- name: publishTopic
value: testkafkatopic2
- name: authRequired
value: false
- name: direction
value: "input, output"
- name: schemaRegistryURL # Optional. When using Schema Registry Avro serialization/deserialization. The Schema Registry URL.
value: http://localhost:8081

Release Note

RELEASE NOTE: FIX Bug in runtime.

@declan-grogan declan-grogan added the kind/bug Something isn't working label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant