// Module included in the following assemblies:
//
// assembly-kafka-bridge-quickstart.adoc

[id='proc-creating-kafka-bridge-consumer-{context}']
= Creating a Kafka Bridge consumer

[role="_abstract"]
Before you can perform any consumer operations in the Kafka cluster, you must first create a consumer by using the link:https://strimzi.io/docs/bridge/latest/#_createconsumer[consumers^] endpoint. The consumer is referred to as a __Kafka Bridge consumer__.

.Procedure

. Create a Kafka Bridge consumer in a new consumer group named `bridge-quickstart-consumer-group`:
+
[source,curl,subs=attributes+]
----
curl -X POST http://localhost:8080/consumers/bridge-quickstart-consumer-group \
  -H 'content-type: application/vnd.kafka.v2+json' \
  -d '{
    "name": "bridge-quickstart-consumer",
    "auto.offset.reset": "earliest",
    "format": "json",
    "enable.auto.commit": false,
    "fetch.min.bytes": 512,
    "consumer.request.timeout.ms": 30000
  }'
----
+
* The consumer is named `bridge-quickstart-consumer` and the embedded data format is set as `json`.
* Some basic configuration settings are defined.
* The consumer will not commit offsets to the log automatically because the `enable.auto.commit` setting is `false`. You will commit the offsets manually later in this quickstart.
+
If the request is successful, the Kafka Bridge returns the consumer ID (`instance_id`) and base URL (`base_uri`) in the response body, along with a `200` code.
+
.Example response

[source,json,subs=attributes+]
----
#...
{
  "instance_id": "bridge-quickstart-consumer",
  "base_uri":"http://<bridge-name>-bridge-service:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumer"
}
----

. Copy the base URL (`base_uri`) to use in the other consumer operations in this quickstart.

.What to do next

Now that you have created a Kafka Bridge consumer, you can  xref:proc-bridge-subscribing-consumer-topics-{context}[subscribe it to topics].

[role="_additional-resources"]
.Additional resources

* link:https://strimzi.io/docs/bridge/latest/#_createconsumer[POST /consumers/{groupid}^] in the API reference documentation.
