이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Using the Streams for Apache Kafka Bridge
Use the Streams for Apache Kafka Bridge to connect with a Kafka cluster
Abstract
Providing feedback on Red Hat documentation 링크 복사링크가 클립보드에 복사되었습니다!
We appreciate your feedback on our documentation.
To propose improvements, open a Jira issue and describe your suggested changes. Provide as much detail as possible to enable us to address your request quickly.
Prerequisite
- You have a Red Hat Customer Portal account. This account enables you to log in to the Red Hat Jira Software instance. If you do not have an account, you will be prompted to create one.
Procedure
- Click Create issue.
- In the Summary text box, enter a brief description of the issue.
In the Description text box, provide the following information:
- The URL of the page where you found the issue.
-
A detailed description of the issue.
You can leave the information in any other fields at their default values.
- Add a reporter name.
- Click Create to submit the Jira issue to the documentation team.
Thank you for taking the time to provide feedback.
Chapter 1. Kafka Bridge overview 링크 복사링크가 클립보드에 복사되었습니다!
Use the Kafka Bridge to make HTTP requests to a Kafka cluster.
You can use the Kafka Bridge to integrate HTTP client applications with your Kafka cluster.
HTTP client integration
1.1. Running the Kafka Bridge 링크 복사링크가 클립보드에 복사되었습니다!
Install the Kafka Bridge to run in the same environment as your Kafka cluster.
You can download and add the Kafka Bridge installation artifacts to your host machine. To try out the Kafka Bridge in your local environment, see the Kafka Bridge quickstart.
It’s important to note that each instance of the Kafka Bridge maintains its own set of in-memory consumers (and subscriptions) that connect to the Kafka Brokers on behalf of the HTTP clients. This means that each HTTP client must maintain affinity to the same Kafka Bridge instance in order to access any subscriptions that are created. Additionally, when an instance of the Kafka Bridge restarts, the in-memory consumers and subscriptions are lost. It is the responsibility of the HTTP client to recreate any consumers and subscriptions if the Kafka Bridge restarts.
1.1.1. Running the Kafka Bridge on OpenShift 링크 복사링크가 클립보드에 복사되었습니다!
If you deployed Streams for Apache Kafka on OpenShift, you can use the Streams for Apache Kafka Cluster Operator to deploy the Kafka Bridge to the OpenShift cluster. Configure and deploy the Kafka Bridge as a KafkaBridge resource. You’ll need a running Kafka cluster that was deployed by the Cluster Operator in an OpenShift namespace. You can configure your deployment to access the Kafka Bridge outside the OpenShift cluster.
HTTP clients must maintain affinity to the same instance of the Kafka Bridge to access any consumers or subscriptions that they create. Hence, running multiple replicas of the Kafka Bridge per OpenShift Deployment is not recommended. If the Kafka Bridge pod restarts (for instance, due to OpenShift relocating the workload to another node), the HTTP client must recreate any consumers or subscriptions.
For information on deploying and configuring the HTTP Bridge as a KafkaBridge resource, see the Streams for Apache Kafka Custom Resource API Reference.
1.2. Kafka Bridge interface 링크 복사링크가 클립보드에 복사되었습니다!
The Kafka Bridge provides a RESTful interface that allows HTTP-based clients to interact with a Kafka cluster. It offers the advantages of a web API connection to Streams for Apache Kafka, without the need for client applications to interpret the Kafka protocol.
The API has two main resources — consumers and topics — that are exposed and made accessible through endpoints to interact with consumers and producers in your Kafka cluster. The resources relate only to the Kafka Bridge, not the consumers and producers connected directly to Kafka.
1.2.1. HTTP requests 링크 복사링크가 클립보드에 복사되었습니다!
The Kafka Bridge supports HTTP requests to a Kafka cluster, with methods to:
- Send messages to a topic.
- Retrieve messages from topics.
- Retrieve a list of partitions for a topic.
- Create and delete consumers.
- Subscribe consumers to topics, so that they start receiving messages from those topics.
- Retrieve a list of topics that a consumer is subscribed to.
- Unsubscribe consumers from topics.
- Assign partitions to consumers.
- Commit a list of consumer offsets.
- Seek on a partition, so that a consumer starts receiving messages from the first or last offset position, or a given offset position.
The methods provide JSON responses and HTTP response code error handling. Messages can be sent in JSON or binary formats.
Clients can produce and consume messages without the requirement to use the native Kafka protocol.
1.3. Kafka Bridge OpenAPI specification 링크 복사링크가 클립보드에 복사되었습니다!
Kafka Bridge APIs use the OpenAPI Specification (OAS). OAS provides a standard framework for describing and implementing HTTP APIs.
The Kafka Bridge OpenAPI specification is in JSON format. You can find the OpenAPI JSON files in the src/main/resources/ folder of the Kafka Bridge source download files. The download files are available from the Customer Portal.
You can also use the GET /openapi method to retrieve the OpenAPI v3 specification in JSON format.
1.4. Securing connectivity to the Kafka cluster 링크 복사링크가 클립보드에 복사되었습니다!
You can configure the following between the Kafka Bridge and your Kafka cluster:
- TLS or SASL-based authentication
- A TLS-encrypted connection
You configure the Kafka Bridge for authentication through its properties file.
You can also use ACLs in Kafka brokers to restrict the topics that can be consumed and produced using the Kafka Bridge.
Use the KafkaBridge resource to configure authentication when you are running the Kafka Bridge on OpenShift.
1.5. Securing the Kafka Bridge HTTP interface 링크 복사링크가 클립보드에 복사되었습니다!
Authentication and encryption between HTTP clients and the Kafka Bridge is not supported directly by the Kafka Bridge. Requests sent from clients to the Kafka Bridge are sent without authentication or encryption. Requests must use HTTP rather than HTTPS.
You can combine the Kafka Bridge with the following tools to secure it:
- Network policies and firewalls that define which pods can access the Kafka Bridge
- Reverse proxies (for example, OAuth 2.0)
- API gateways
1.6. Requests to the Kafka Bridge 링크 복사링크가 클립보드에 복사되었습니다!
Specify data formats and HTTP headers to ensure valid requests are submitted to the Kafka Bridge.
1.6.1. Content Type headers 링크 복사링크가 클립보드에 복사되었습니다!
API request and response bodies are always encoded as JSON.
When performing consumer operations,
POSTrequests must provide the followingContent-Typeheader if there is a non-empty body:Content-Type: application/vnd.kafka.v2+json
Content-Type: application/vnd.kafka.v2+jsonCopy to Clipboard Copied! Toggle word wrap Toggle overflow When performing producer operations,
POSTrequests must provideContent-Typeheaders specifying the embedded data format of the messages produced. This can be eitherjson,binaryortext.Expand Embedded data format Content-Type header JSON
Content-Type: application/vnd.kafka.json.v2+jsonBinary
Content-Type: application/vnd.kafka.binary.v2+jsonText
Content-Type: application/vnd.kafka.text.v2+json
The embedded data format is set per consumer, as described in the next section.
The Content-Type must not be set if the POST request has an empty body. An empty body can be used to create a consumer with the default values.
1.6.2. Embedded data format 링크 복사링크가 클립보드에 복사되었습니다!
The embedded data format is the format of the Kafka messages that are transmitted, over HTTP, from a producer to a consumer using the Kafka Bridge. Three embedded data formats are supported: JSON, binary and text.
When creating a consumer using the /consumers/groupid endpoint, the POST request body must specify an embedded data format of either JSON, binary or text. This is specified in the format field, for example:
{
"name": "my-consumer",
"format": "binary",
# ...
}
{
"name": "my-consumer",
"format": "binary",
# ...
}
- 1
- A binary embedded data format.
The embedded data format specified when creating a consumer must match the data format of the Kafka messages it will consume.
If you choose to specify a binary embedded data format, subsequent producer requests must provide the binary data in the request body as Base64-encoded strings. For example, when sending messages using the /topics/topicname endpoint, records.value must be encoded in Base64:
Producer requests must also provide a Content-Type header that corresponds to the embedded data format, for example, Content-Type: application/vnd.kafka.binary.v2+json.
1.6.3. Message format 링크 복사링크가 클립보드에 복사되었습니다!
When sending messages using the /topics endpoint, you enter the message payload in the request body, in the records parameter.
The records parameter can contain any of these optional fields:
-
Message
headers -
Message
key -
Message
value -
Destination
partition
Example POST request to /topics
- 1
- The header value in binary format and encoded as Base64.
Please note that if your consumer is configured to use the text embedded data format, the value and key field in the records parameter must be a string and not a JSON object.
1.6.4. Accept headers 링크 복사링크가 클립보드에 복사되었습니다!
After creating a consumer, all subsequent GET requests must provide an Accept header in the following format:
Accept: application/vnd.kafka.EMBEDDED-DATA-FORMAT.v2+json
Accept: application/vnd.kafka.EMBEDDED-DATA-FORMAT.v2+json
The EMBEDDED-DATA-FORMAT is either json, binary or text.
For example, when retrieving records for a subscribed consumer using an embedded data format of JSON, include this Accept header:
Accept: application/vnd.kafka.json.v2+json
Accept: application/vnd.kafka.json.v2+json
1.7. CORS 링크 복사링크가 클립보드에 복사되었습니다!
In general, it is not possible for an HTTP client to issue requests across different domains.
For example, suppose the Kafka Bridge you deployed alongside a Kafka cluster is accessible using the http://my-bridge.io domain. HTTP clients can use the URL to interact with the Kafka Bridge and exchange messages through the Kafka cluster. However, your client is running as a web application in the http://my-web-application.io domain. The client (source) domain is different from the Kafka Bridge (target) domain. Because of same-origin policy restrictions, requests from the client fail. You can avoid this situation by using Cross-Origin Resource Sharing (CORS).
CORS allows for simple and preflighted requests between origin sources on different domains.
Simple requests are suitable for standard requests using GET, HEAD, POST methods.
A preflighted request sends a HTTP OPTIONS request as an initial check that the actual request is safe to send. On confirmation, the actual request is sent. Preflight requests are suitable for methods that require greater safeguards, such as PUT and DELETE, and use non-standard headers.
All requests require an origins value in their header, which is the source of the HTTP request.
CORS allows you to specify allowed methods and originating URLs for accessing the Kafka cluster in your Kafka Bridge HTTP configuration.
Example CORS configuration for Kafka Bridge
# ... http.cors.enabled=true http.cors.allowedOrigins=http://my-web-application.io http.cors.allowedMethods=GET,POST,PUT,DELETE,OPTIONS,PATCH
# ...
http.cors.enabled=true
http.cors.allowedOrigins=http://my-web-application.io
http.cors.allowedMethods=GET,POST,PUT,DELETE,OPTIONS,PATCH
1.7.1. Simple request 링크 복사링크가 클립보드에 복사되었습니다!
For example, this simple request header specifies the origin as http://my-web-application.io.
Origin: http://my-web-application.io
Origin: http://my-web-application.io
The header information is added to the request to consume records.
curl -v -X GET HTTP-BRIDGE-ADDRESS/consumers/my-group/instances/my-consumer/records \ -H 'Origin: http://my-web-application.io'\ -H 'content-type: application/vnd.kafka.v2+json'
curl -v -X GET HTTP-BRIDGE-ADDRESS/consumers/my-group/instances/my-consumer/records \
-H 'Origin: http://my-web-application.io'\
-H 'content-type: application/vnd.kafka.v2+json'
In the response from the Kafka Bridge, an Access-Control-Allow-Origin header is returned. It contains the list of domains from where HTTP requests can be issued to the bridge.
HTTP/1.1 200 OK Access-Control-Allow-Origin: *
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
- 1
- Returning an asterisk (
*) shows the resource can be accessed by any domain.
1.7.2. Preflighted request 링크 복사링크가 클립보드에 복사되었습니다!
An initial preflight request is sent to Kafka Bridge using an OPTIONS method. The HTTP OPTIONS request sends header information to check that Kafka Bridge will allow the actual request.
Here the preflight request checks that a POST request is valid from http://my-web-application.io.
OPTIONS /my-group/instances/my-consumer/subscription HTTP/1.1 Origin: http://my-web-application.io Access-Control-Request-Method: POST Access-Control-Request-Headers: Content-Type
OPTIONS /my-group/instances/my-consumer/subscription HTTP/1.1
Origin: http://my-web-application.io
Access-Control-Request-Method: POST
Access-Control-Request-Headers: Content-Type
OPTIONS is added to the header information of the preflight request.
curl -v -X OPTIONS -H 'Origin: http://my-web-application.io' \ -H 'Access-Control-Request-Method: POST' \ -H 'content-type: application/vnd.kafka.v2+json'
curl -v -X OPTIONS -H 'Origin: http://my-web-application.io' \
-H 'Access-Control-Request-Method: POST' \
-H 'content-type: application/vnd.kafka.v2+json'
Kafka Bridge responds to the initial request to confirm that the request will be accepted. The response header returns allowed origins, methods and headers.
HTTP/1.1 200 OK Access-Control-Allow-Origin: http://my-web-application.io Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS,PATCH Access-Control-Allow-Headers: content-type
HTTP/1.1 200 OK
Access-Control-Allow-Origin: http://my-web-application.io
Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS,PATCH
Access-Control-Allow-Headers: content-type
If the origin or method is rejected, an error message is returned.
The actual request does not require Access-Control-Request-Method header, as it was confirmed in the preflight request, but it does require the origin header.
curl -v -X POST HTTP-BRIDGE-ADDRESS/topics/bridge-topic \ -H 'Origin: http://my-web-application.io' \ -H 'content-type: application/vnd.kafka.v2+json'
curl -v -X POST HTTP-BRIDGE-ADDRESS/topics/bridge-topic \
-H 'Origin: http://my-web-application.io' \
-H 'content-type: application/vnd.kafka.v2+json'
The response shows the originating URL is allowed.
HTTP/1.1 200 OK Access-Control-Allow-Origin: http://my-web-application.io
HTTP/1.1 200 OK
Access-Control-Allow-Origin: http://my-web-application.io
1.8. Configuring loggers for the Kafka Bridge 링크 복사링크가 클립보드에 복사되었습니다!
You can set a different log level for each operation that is defined by the Kafka Bridge OpenAPI specification.
Each operation has a corresponding API endpoint through which the bridge receives requests from HTTP clients. You can change the log level on each endpoint to produce more or less fine-grained logging information about the incoming and outgoing HTTP requests.
Loggers are defined in the log4j2.properties file, which has the following default configuration for healthy and ready endpoints:
logger.healthy.name = http.openapi.operation.healthy logger.healthy.level = WARN logger.ready.name = http.openapi.operation.ready logger.ready.level = WARN
logger.healthy.name = http.openapi.operation.healthy
logger.healthy.level = WARN
logger.ready.name = http.openapi.operation.ready
logger.ready.level = WARN
The log level of all other operations is set to INFO by default. Loggers are formatted as follows:
logger.<operation_id>.name = http.openapi.operation.<operation_id> logger.<operation_id>_level = _<LOG_LEVEL>
logger.<operation_id>.name = http.openapi.operation.<operation_id>
logger.<operation_id>_level = _<LOG_LEVEL>
Where <operation_id> is the identifier of the specific operation.
List of operations defined by the OpenAPI specification
-
createConsumer -
deleteConsumer -
subscribe -
unsubscribe -
poll -
assign -
commit -
send -
sendToPartition -
seekToBeginning -
seekToEnd -
seek -
healthy -
ready -
openapi
Where <LOG_LEVEL> is the logging level as defined by log4j2 (i.e. INFO, DEBUG, …).
Chapter 2. Kafka Bridge quickstart 링크 복사링크가 클립보드에 복사되었습니다!
Use this quickstart to try out the Kafka Bridge in your local development environment.
You will learn how to do the following:
- Produce messages to topics and partitions in your Kafka cluster
- Create a Kafka Bridge consumer
- Perform basic consumer operations, such as subscribing the consumer to topics and retrieving the messages that you produced
In this quickstart, HTTP requests are formatted as curl commands that you can copy and paste to your terminal.
Ensure you have the prerequisites and then follow the tasks in the order provided in this chapter.
In this quickstart, you will produce and consume messages in JSON format.
Prerequisites for the quickstart
- A Kafka cluster is running on the host machine.
2.1. Downloading a Kafka Bridge archive 링크 복사링크가 클립보드에 복사되었습니다!
A zipped distribution of the Kafka Bridge is available for download.
Procedure
- Download the latest version of the Kafka Bridge archive from the Customer Portal.
2.2. Installing the Kafka Bridge 링크 복사링크가 클립보드에 복사되었습니다!
Use the script provided with the Kafka Bridge archive to install the Kafka Bridge. The application.properties file provided with the installation archive provides default configuration settings.
The following default property values configure the Kafka Bridge to listen for requests on port 8080.
Default configuration properties
http.host=0.0.0.0 http.port=8080
http.host=0.0.0.0
http.port=8080
Prerequisites
Procedure
- If you have not already done so, unzip the Kafka Bridge installation archive to any directory.
Run the Kafka Bridge script using the configuration properties as a parameter:
For example:
./bin/kafka_bridge_run.sh --config-file=<path>/application.properties
./bin/kafka_bridge_run.sh --config-file=<path>/application.propertiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check to see that the installation was successful in the log.
HTTP-Kafka Bridge started and listening on port 8080 HTTP-Kafka Bridge bootstrap servers localhost:9092
HTTP-Kafka Bridge started and listening on port 8080 HTTP-Kafka Bridge bootstrap servers localhost:9092Copy to Clipboard Copied! Toggle word wrap Toggle overflow
What to do next
2.3. Producing messages to topics and partitions 링크 복사링크가 클립보드에 복사되었습니다!
Use the Kafka Bridge to produce messages to a Kafka topic in JSON format by using the topics endpoint.
You can produce messages to topics in JSON format by using the topics endpoint. You can specify destination partitions for messages in the request body. The partitions endpoint provides an alternative method for specifying a single destination partition for all messages as a path parameter.
In this procedure, messages are produced to a topic called bridge-quickstart-topic.
Prerequisites
The Kafka cluster has a topic with three partitions.
You can use the
kafka-topics.shutility to create topics.Example topic creation with three partitions
bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic bridge-quickstart-topic --partitions 3 --replication-factor 1
bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic bridge-quickstart-topic --partitions 3 --replication-factor 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verifying the topic was created
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic bridge-quickstart-topic
bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic bridge-quickstart-topicCopy to Clipboard Copied! Toggle word wrap Toggle overflow
If you deployed Streams for Apache Kafka on OpenShift, you can create a topic using the KafkaTopic custom resource.
Procedure
Using the Kafka Bridge, produce three messages to the topic you created:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
sales-lead-0001is sent to a partition based on the hash of the key. -
sales-lead-0002is sent directly to partition 2. -
sales-lead-0003is sent to a partition in thebridge-quickstart-topictopic using a round-robin method.
-
If the request is successful, the Kafka Bridge returns an
offsetsarray, along with a200code and acontent-typeheader ofapplication/vnd.kafka.v2+json. For each message, theoffsetsarray describes:- The partition that the message was sent to
The current message offset of the partition
Example response
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional topic requests
Make other curl requests to find information on topics and partitions.
- List topics
curl -X GET \ http://localhost:8080/topics
curl -X GET \ http://localhost:8080/topicsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example response
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Get topic configuration and partition details
curl -X GET \ http://localhost:8080/topics/bridge-quickstart-topic
curl -X GET \ http://localhost:8080/topics/bridge-quickstart-topicCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example response
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - List the partitions of a specific topic
curl -X GET \ http://localhost:8080/topics/bridge-quickstart-topic/partitions
curl -X GET \ http://localhost:8080/topics/bridge-quickstart-topic/partitionsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example response
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - List the details of a specific topic partition
curl -X GET \ http://localhost:8080/topics/bridge-quickstart-topic/partitions/0
curl -X GET \ http://localhost:8080/topics/bridge-quickstart-topic/partitions/0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example response
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - List the offsets of a specific topic partition
curl -X GET \ http://localhost:8080/topics/bridge-quickstart-topic/partitions/0/offsets
curl -X GET \ http://localhost:8080/topics/bridge-quickstart-topic/partitions/0/offsetsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example response
{ "beginning_offset": 0, "end_offset": 1 }{ "beginning_offset": 0, "end_offset": 1 }Copy to Clipboard Copied! Toggle word wrap Toggle overflow
What to do next
After producing messages to topics and partitions, create a Kafka Bridge consumer.
2.4. Creating a Kafka Bridge consumer 링크 복사링크가 클립보드에 복사되었습니다!
Before you can perform any consumer operations in the Kafka cluster, you must first create a consumer by using the 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:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
The consumer is named
bridge-quickstart-consumerand the embedded data format is set asjson. - Some basic configuration settings are defined.
The consumer will not commit offsets to the log automatically because the
enable.auto.commitsetting isfalse. 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 a200code.Example response
#... { "instance_id": "bridge-quickstart-consumer", "base_uri":"http://<bridge_id>-bridge-service:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumer" }#... { "instance_id": "bridge-quickstart-consumer", "base_uri":"http://<bridge_id>-bridge-service:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumer" }Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
The consumer is named
-
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 subscribe it to topics.
2.5. Subscribing a Kafka Bridge consumer to topics 링크 복사링크가 클립보드에 복사되었습니다!
After you have created a Kafka Bridge consumer, subscribe it to one or more topics by using the subscription endpoint. When subscribed, the consumer starts receiving all messages that are produced to the topic.
Procedure
Subscribe the consumer to the
bridge-quickstart-topictopic that you created earlier, in Producing messages to topics and partitions:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
topicsarray can contain a single topic (as shown here) or multiple topics. If you want to subscribe the consumer to multiple topics that match a regular expression, you can use thetopic_patternstring instead of thetopicsarray.If the request is successful, the Kafka Bridge returns a
204(No Content) code only.
When using an Apache Kafka client, the HTTP subscribe operation adds topics to the local consumer’s subscriptions. Joining a consumer group and obtaining partition assignments occur after running multiple HTTP poll operations, starting the partition rebalance and join-group process. It’s important to note that the initial HTTP poll operations may not return any records.
What to do next
After subscribing a Kafka Bridge consumer to topics, you can retrieve messages from the consumer.
2.6. Retrieving the latest messages from a Kafka Bridge consumer 링크 복사링크가 클립보드에 복사되었습니다!
Retrieve the latest messages from the Kafka Bridge consumer by requesting data from the records endpoint. In production, HTTP clients can call this endpoint repeatedly (in a loop).
Procedure
- Produce additional messages to the Kafka Bridge consumer, as described in Producing messages to topics and partitions.
Submit a
GETrequest to therecordsendpoint:curl -X GET http://localhost:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumer/records \ -H 'accept: application/vnd.kafka.json.v2+json'
curl -X GET http://localhost:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumer/records \ -H 'accept: application/vnd.kafka.json.v2+json'Copy to Clipboard Copied! Toggle word wrap Toggle overflow After creating and subscribing to a Kafka Bridge consumer, a first GET request will return an empty response because the poll operation starts a rebalancing process to assign partitions.
Repeat step two to retrieve messages from the Kafka Bridge consumer.
The Kafka Bridge returns an array of messages — describing the topic name, key, value, partition, and offset — in the response body, along with a
200code. Messages are retrieved from the latest offset by default.Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf an empty response is returned, produce more records to the consumer as described in Producing messages to topics and partitions, and then try retrieving messages again.
What to do next
After retrieving messages from a Kafka Bridge consumer, try committing offsets to the log.
2.7. Commiting offsets to the log 링크 복사링크가 클립보드에 복사되었습니다!
Use the offsets endpoint to manually commit offsets to the log for all messages received by the Kafka Bridge consumer. This is required because the Kafka Bridge consumer that you created earlier, in Creating a Kafka Bridge consumer, was configured with the enable.auto.commit setting as false.
Procedure
Commit offsets to the log for the
bridge-quickstart-consumer:curl -X POST http://localhost:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumer/offsets
curl -X POST http://localhost:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumer/offsetsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Because no request body is submitted, offsets are committed for all the records that have been received by the consumer. Alternatively, the request body can contain an array of (OffsetCommitSeek) that specifies the topics and partitions that you want to commit offsets for.
If the request is successful, the Kafka Bridge returns a
204code only.
What to do next
After committing offsets to the log, try out the endpoints for seeking to offsets.
2.8. Seeking to offsets for a partition 링크 복사링크가 클립보드에 복사되었습니다!
Use the positions endpoints to configure the Kafka Bridge consumer to retrieve messages for a partition from a specific offset, and then from the latest offset. This is referred to in Apache Kafka as a seek operation.
Procedure
Seek to a specific offset for partition 0 of the
quickstart-bridge-topictopic:Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the request is successful, the Kafka Bridge returns a
204code only.Submit a
GETrequest to therecordsendpoint:curl -X GET http://localhost:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumer/records \ -H 'accept: application/vnd.kafka.json.v2+json'
curl -X GET http://localhost:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumer/records \ -H 'accept: application/vnd.kafka.json.v2+json'Copy to Clipboard Copied! Toggle word wrap Toggle overflow The Kafka Bridge returns messages from the offset that you seeked to.
Restore the default message retrieval behavior by seeking to the last offset for the same partition. This time, use the positions/end endpoint.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the request is successful, the Kafka Bridge returns another
204code.
You can also use the positions/beginning endpoint to seek to the first offset for one or more partitions.
What to do next
In this quickstart, you have used the Kafka Bridge to perform several common operations on a Kafka cluster. You can now delete the Kafka Bridge consumer that you created earlier.
2.9. Deleting a Kafka Bridge consumer 링크 복사링크가 클립보드에 복사되었습니다!
Delete the Kafka Bridge consumer that you used throughout this quickstart.
Procedure
Delete the Kafka Bridge consumer by sending a
DELETErequest to the instances endpoint.curl -X DELETE http://localhost:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumer
curl -X DELETE http://localhost:8080/consumers/bridge-quickstart-consumer-group/instances/bridge-quickstart-consumerCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the request is successful, the Kafka Bridge returns a
204code.
Chapter 3. Kafka Bridge configuration 링크 복사링크가 클립보드에 복사되었습니다!
Configure a deployment of the Kafka Bridge with Kafka-related properties and specify the HTTP connection details needed to be able to interact with Kafka. Additionally, enable metrics in Prometheus format using either the Prometheus JMX Exporter or the Streams for Apache Kafka Metrics Reporter. You can also use configuration properties to enable and use distributed tracing with the Kafka Bridge. Distributed tracing allows you to track the progress of transactions between applications in a distributed system.
Use the KafkaBridge resource to configure properties when you are running the Kafka Bridge on OpenShift.
3.1. Configuring Kafka Bridge properties 링크 복사링크가 클립보드에 복사되었습니다!
This procedure describes how to configure the Kafka and HTTP connection properties used by the Kafka Bridge.
You configure the Kafka Bridge, as any other Kafka client, using appropriate prefixes for Kafka-related properties.
-
kafka.for general configuration that applies to producers and consumers, such as server connection and security. -
kafka.consumer.for consumer-specific configuration passed only to the consumer. -
kafka.producer.for producer-specific configuration passed only to the producer.
As well as enabling HTTP access to a Kafka cluster, HTTP properties provide the capability to enable and define access control for the Kafka Bridge through Cross-Origin Resource Sharing (CORS). CORS is a HTTP mechanism that allows browser access to selected resources from more than one origin. To configure CORS, you define a list of allowed resource origins and HTTP methods to access them. Additional HTTP headers in requests describe the CORS origins that are permitted access to the Kafka cluster.
Prerequisites
Procedure
Edit the
application.propertiesfile provided with the Kafka Bridge installation archive.Use the properties file to specify Kafka and HTTP-related properties.
Configure standard Kafka-related properties, including properties specific to the Kafka consumers and producers.
Use:
-
kafka.bootstrap.serversto define the host/port connections to the Kafka cluster -
kafka.producer.acksto provide acknowledgments to the HTTP client kafka.consumer.auto.offset.resetto determine how to manage reset of the offset in KafkaFor more information on configuration of Kafka properties, see the Apache Kafka website
-
Configure HTTP-related properties to enable HTTP access to the Kafka cluster.
For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Save the configuration file.
3.2. Configuring Prometheus JMX Exporter metrics 링크 복사링크가 클립보드에 복사되었습니다!
Enable the Prometheus JMX Exporter to collect Kafka Bridge metrics by setting the bridge.metrics option to jmxPrometheusExporter.
Prerequisites
Procedure
Set the
bridge.metricsconfiguration tojmxPrometheusExporter.Configuration for enabling metrics
bridge.metrics=jmxPrometheusExporter
bridge.metrics=jmxPrometheusExporterCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optionally, you can add a custom Prometheus JMX Exporter configuration using the
bridge.metrics.exporter.config.pathproperty. If not configured, a default embedded configuration file is used.Run the Kafka Bridge run script.
Running the Kafka Bridge
./bin/kafka_bridge_run.sh --config-file=<path>/application.properties
./bin/kafka_bridge_run.sh --config-file=<path>/application.propertiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow With metrics enabled, you can scrape metrics in Prometheus format from the
/metricsendpoint of the Kafka Bridge.
3.3. Configuring Streams for Apache Kafka Metrics Reporter metrics 링크 복사링크가 클립보드에 복사되었습니다!
This feature is a technology preview and not intended for a production environment. For more information see the release notes.
Enable the Streams for Apache Kafka Metrics Reporter to collect Kafka Bridge metrics by setting the bridge.metrics option to strimziMetricsReporter.
Prerequisites
Procedure
Set the
bridge.metricsconfiguration tostrimziMetricsReporter.Configuration for enabling metrics
bridge.metrics=strimziMetricsReporter
bridge.metrics=strimziMetricsReporterCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optionally, you can configure a comma-separated list of regular expressions to filter exposed metrics using the
kafka.prometheus.metrics.reporter.allowlistproperty. If not configured, a default set of metrics is exposed.When needed, it is possible to configure the
allowlistper client type. For example, by using thekafka.adminprefix and settingkafka.admin.prometheus.metrics.reporter.allowlist=, all admin client metrics are excluded.You can add any plugin configuration to the Kafka Bridge properties file using
kafka.,kafka.admin.,kafka.producer., andkafka.consumer.prefixes. In the event that the same property is configured with multiple prefixes, the most specific prefix takes precedence. For example,kafka.producer.prometheus.metrics.reporter.allowlisttakes precedence overkafka.prometheus.metrics.reporter.allowlist.Run the Kafka Bridge run script.
Running the Kafka Bridge
./bin/kafka_bridge_run.sh --config-file=<path>/application.properties
./bin/kafka_bridge_run.sh --config-file=<path>/application.propertiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow With metrics enabled, you can scrape metrics in Prometheus format from the
/metricsendpoint of the Kafka Bridge.
3.4. Configuring distributed tracing 링크 복사링크가 클립보드에 복사되었습니다!
Enable distributed tracing to trace messages consumed and produced by the Kafka Bridge, and HTTP requests from client applications.
Properties to enable tracing are present in the application.properties file. To enable distributed tracing, do the following:
-
Set the
bridge.tracingproperty value to enable the tracing you want to use. The only possible value isopentelemetry. - Set environment variables for tracing.
With the default configuration, OpenTelemetry tracing uses OTLP as the exporter protocol. By configuring the OTLP endpoint, you can still use a Jaeger backend instance to get traces.
Jaeger has supported the OTLP protocol since version 1.35. Older Jaeger versions cannot get traces using the OTLP protocol.
OpenTelemetry defines an API specification for collecting tracing data as spans of metrics data. Spans represent a specific operation. A trace is a collection of one or more spans.
Traces are generated when the Kafka Bridge does the following:
- Sends messages from Kafka to consumer HTTP clients
- Receives messages from producer HTTP clients to send to Kafka
Jaeger implements the required APIs and presents visualizations of the trace data in its user interface for analysis.
To have end-to-end tracing, you must configure tracing in your HTTP clients.
Streams for Apache Kafka no longer supports OpenTracing. If you were previously using OpenTracing with the bridge.tracing=jaeger option, we encourage you to transition to using OpenTelemetry instead.
Prerequisites
Procedure
Edit the
application.propertiesfile provided with the Kafka Bridge installation archive.Use the
bridge.tracingproperty to enable the tracing you want to use.Example configuration to enable OpenTelemetry
bridge.tracing=opentelemetry
bridge.tracing=opentelemetry1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The property for enabling OpenTelemetry is uncommented by removing the
#at the beginning of the line.
With tracing enabled, you initialize tracing when you run the Kafka Bridge script.
- Save the configuration file.
Set the environment variables for tracing.
Environment variables for OpenTelemetry
OTEL_SERVICE_NAME=my-tracing-service OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
OTEL_SERVICE_NAME=my-tracing-service1 OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:43172 Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the Kafka Bridge script with the property enabled for tracing.
Running the Kafka Bridge with OpenTelemetry enabled
./bin/kafka_bridge_run.sh --config-file=<path>/application.properties
./bin/kafka_bridge_run.sh --config-file=<path>/application.propertiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow The internal consumers and producers of the Kafka Bridge are now enabled for tracing.
3.4.1. Specifying tracing systems with OpenTelemetry 링크 복사링크가 클립보드에 복사되었습니다!
Instead of the default OTLP tracing system, you can specify other tracing systems that are supported by OpenTelemetry.
If you want to use another tracing system with OpenTelemetry, do the following:
- Add the library of the tracing system to the Kafka classpath.
Add the name of the tracing system as an additional exporter environment variable.
Additional environment variable when not using OTLP
OTEL_SERVICE_NAME=my-tracing-service OTEL_TRACES_EXPORTER=zipkin OTEL_EXPORTER_ZIPKIN_ENDPOINT=http://localhost:9411/api/v2/spans
OTEL_SERVICE_NAME=my-tracing-service OTEL_TRACES_EXPORTER=zipkin1 OTEL_EXPORTER_ZIPKIN_ENDPOINT=http://localhost:9411/api/v2/spans2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.4.2. Supported Span attributes 링크 복사링크가 클립보드에 복사되었습니다!
The Kafka Bridge adds, in addition to the standard OpenTelemetry attributes, the following attributes from the OpenTelemetry standard conventions for HTTP to its spans.
| Attribute key | Attribute value |
|
|
Hardcoded to |
|
| The http method used to make the request |
|
| The URI scheme component |
|
| The URI path component |
|
| The URI query component |
|
| The name of the Kafka topic being produced to or read from |
|
|
Hardcoded to |
|
|
|
Chapter 4. Kafka Bridge API Reference 링크 복사링크가 클립보드에 복사되었습니다!
4.1. Introduction 링크 복사링크가 클립보드에 복사되었습니다!
The Kafka Bridge provides a REST API for integrating HTTP based client applications with a Kafka cluster. You can use the API to create and manage consumers and send and receive records over HTTP rather than the native Kafka protocol.
4.2. Endpoints 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1. Consumers 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.1. assign 링크 복사링크가 클립보드에 복사되었습니다!
POST /consumers/{groupid}/instances/{name}/assignments
4.2.1.1.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Assigns one or more topic partitions to a consumer.
4.2.1.1.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the consumer belongs. | X | null | |
| name | Name of the consumer to assign topic partitions to. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| Partitions | List of topic partitions to assign to the consumer. Section 4.3.16, “Partitions Partitions” | X |
4.2.1.1.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.1.1.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.1.1.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Partitions assigned successfully. | <<>> |
| 404 | The specified consumer instance was not found. | |
| 409 | Subscriptions to topics, partitions, and patterns are mutually exclusive. |
4.2.1.1.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.2. commit 링크 복사링크가 클립보드에 복사되었습니다!
POST /consumers/{groupid}/instances/{name}/offsets
4.2.1.2.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Commits a list of consumer offsets. To commit offsets for all records fetched by the consumer, leave the request body empty.
4.2.1.2.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the consumer belongs. | X | null | |
| name | Name of the consumer. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| OffsetCommitSeekList | List of consumer offsets to commit to the consumer offsets commit log. You can specify one or more topic partitions to commit offsets for. Section 4.3.9, “OffsetCommitSeekList OffsetCommitSeekList” | - |
4.2.1.2.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.1.2.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.1.2.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Commit made successfully. | <<>> |
| 404 | The specified consumer instance was not found. |
4.2.1.2.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.3. createConsumer 링크 복사링크가 클립보드에 복사되었습니다!
POST /consumers/{groupid}
4.2.1.3.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Creates a consumer instance in the given consumer group. You can optionally specify a consumer name and supported configuration options. It returns a base URI which must be used to construct URLs for subsequent requests against this consumer instance.
4.2.1.3.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group in which to create the consumer. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| Consumer | Name and configuration of the consumer. The name is unique within the scope of the consumer group. If a name is not specified, a randomly generated name is assigned. All parameters are optional. The supported configuration options are shown in the following example. Section 4.3.2, “Consumer Consumer” | - |
4.2.1.3.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.3.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.1.3.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | Consumer created successfully. | |
| 409 | A consumer instance with the specified name already exists in the Kafka Bridge. | |
| 422 | One or more consumer configuration options have invalid values. |
4.2.1.3.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.4. deleteConsumer 링크 복사링크가 클립보드에 복사되었습니다!
DELETE /consumers/{groupid}/instances/{name}
4.2.1.4.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Deletes a specified consumer instance. The request for this operation MUST use the base URL (including the host and port) returned in the response from the POST request to /consumers/{groupid} that was used to create this consumer.
4.2.1.4.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the consumer belongs. | X | null | |
| name | Name of the consumer to delete. | X | null |
4.2.1.4.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.1.4.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.1.4.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Consumer removed successfully. | <<>> |
| 404 | The specified consumer instance was not found. |
4.2.1.4.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.5. listSubscriptions 링크 복사링크가 클립보드에 복사되었습니다!
GET /consumers/{groupid}/instances/{name}/subscription
4.2.1.5.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves a list of the topics to which the consumer is subscribed.
4.2.1.5.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the subscribed consumer belongs. | X | null | |
| name | Name of the subscribed consumer. | X | null |
4.2.1.5.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.5.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.1.5.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | List of subscribed topics and partitions. | |
| 404 | The specified consumer instance was not found. |
4.2.1.5.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.6. poll 링크 복사링크가 클립보드에 복사되었습니다!
GET /consumers/{groupid}/instances/{name}/records
4.2.1.6.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves records for a subscribed consumer, including message values, topics, and partitions. The request for this operation MUST use the base URL (including the host and port) returned in the response from the POST request to /consumers/{groupid} that was used to create this consumer.
4.2.1.6.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the subscribed consumer belongs. | X | null | |
| name | Name of the subscribed consumer to retrieve records from. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| timeout | The maximum amount of time, in milliseconds, that the HTTP Bridge spends retrieving records before timing out the request. | - | null | |
| max_bytes | The maximum size, in bytes, of unencoded keys and values that can be included in the response. Otherwise, an error response with code 422 is returned. | - | null |
4.2.1.6.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.6.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.json.v2+json
- application/vnd.kafka.binary.v2+json
- application/vnd.kafka.text.v2+json
- application/vnd.kafka.v2+json
4.2.1.6.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | Poll request executed successfully. | |
| 404 | The specified consumer instance was not found. | |
| 406 | The `format` used in the consumer creation request does not match the embedded format in the Accept header of this request or the bridge got a message from the topic which is not JSON encoded. | |
| 422 | Response exceeds the maximum number of bytes the consumer can receive |
4.2.1.6.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.7. seek 링크 복사링크가 클립보드에 복사되었습니다!
POST /consumers/{groupid}/instances/{name}/positions
4.2.1.7.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Configures a subscribed consumer to fetch offsets from a particular offset the next time it fetches a set of records from a given topic partition. This overrides the default fetch behavior for consumers. You can specify one or more topic partitions.
4.2.1.7.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the consumer belongs. | X | null | |
| name | Name of the subscribed consumer. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| OffsetCommitSeekList | List of partition offsets from which the subscribed consumer will next fetch records. Section 4.3.9, “OffsetCommitSeekList OffsetCommitSeekList” | X |
4.2.1.7.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.1.7.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.1.7.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Seek performed successfully. | <<>> |
| 404 | The specified consumer instance was not found, or the specified consumer instance did not have one of the specified partitions assigned. |
4.2.1.7.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.8. seekToBeginning 링크 복사링크가 클립보드에 복사되었습니다!
POST /consumers/{groupid}/instances/{name}/positions/beginning
4.2.1.8.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Configures a subscribed consumer to seek (and subsequently read from) the first offset in one or more given topic partitions.
4.2.1.8.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the subscribed consumer belongs. | X | null | |
| name | Name of the subscribed consumer. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| Partitions | List of topic partitions to which the consumer is subscribed. The consumer will seek the first offset in the specified partitions. Section 4.3.16, “Partitions Partitions” | X |
4.2.1.8.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.1.8.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.1.8.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Seek to the beginning performed successfully. | <<>> |
| 404 | The specified consumer instance was not found, or the specified consumer instance did not have one of the specified partitions assigned. |
4.2.1.8.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.9. seekToEnd 링크 복사링크가 클립보드에 복사되었습니다!
POST /consumers/{groupid}/instances/{name}/positions/end
4.2.1.9.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Configures a subscribed consumer to seek (and subsequently read from) the offset at the end of one or more of the given topic partitions.
4.2.1.9.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the subscribed consumer belongs. | X | null | |
| name | Name of the subscribed consumer. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| Partitions | List of topic partitions to which the consumer is subscribed. The consumer will seek the last offset in the specified partitions. Section 4.3.16, “Partitions Partitions” | X |
4.2.1.9.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.1.9.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.1.9.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Seek to the end performed successfully. | <<>> |
| 404 | The specified consumer instance was not found, or the specified consumer instance did not have one of the specified partitions assigned. |
4.2.1.9.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.10. subscribe 링크 복사링크가 클립보드에 복사되었습니다!
POST /consumers/{groupid}/instances/{name}/subscription
4.2.1.10.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Subscribes a consumer to one or more topics. You can describe the topics to which the consumer will subscribe in a list (of Topics type) or as a topic_pattern field. Each call replaces the subscriptions for the subscriber.
4.2.1.10.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the subscribed consumer belongs. | X | null | |
| name | Name of the consumer to subscribe to topics. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| Topics | List of topics to which the consumer will subscribe. Section 4.3.26, “Topics Topics” | X |
4.2.1.10.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.1.10.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.1.10.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Consumer subscribed successfully. | <<>> |
| 404 | The specified consumer instance was not found. | |
| 409 | Subscriptions to topics, partitions, and patterns are mutually exclusive. | |
| 422 | A list (of `Topics` type) or a `topic_pattern` must be specified. |
4.2.1.10.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.1.11. unsubscribe 링크 복사링크가 클립보드에 복사되었습니다!
DELETE /consumers/{groupid}/instances/{name}/subscription
4.2.1.11.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Unsubscribes a consumer from all topics.
4.2.1.11.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the subscribed consumer belongs. | X | null | |
| name | Name of the consumer to unsubscribe from topics. | X | null |
4.2.1.11.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.1.11.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/json
4.2.1.11.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Consumer unsubscribed successfully. | <<>> |
| 404 | The specified consumer instance was not found. |
4.2.1.11.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2. Default 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.1. healthy 링크 복사링크가 클립보드에 복사되었습니다!
GET /healthy
4.2.2.1.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Check if the bridge is running. This does not necessarily imply that it is ready to accept requests.
4.2.2.1.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.1.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.2.1.4. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | The bridge is healthy | <<>> |
| 500 | The bridge is not healthy | <<>> |
4.2.2.1.5. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.2. info 링크 복사링크가 클립보드에 복사되었습니다!
GET /
4.2.2.2.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves information about the Kafka Bridge instance, in JSON format.
4.2.2.2.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.2.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.2.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/json
4.2.2.2.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | Information about Kafka Bridge instance. |
4.2.2.2.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.3. metrics 링크 복사링크가 클립보드에 복사되었습니다!
GET /metrics
4.2.2.3.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves the bridge metrics in Prometheus format.
4.2.2.3.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.3.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
String
4.2.2.3.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- text/plain
4.2.2.3.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | Metrics in Prometheus format retrieved successfully. | String |
| 404 | The metrics endpoint is not enabled. | <<>> |
4.2.2.3.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.4. openapi 링크 복사링크가 클립보드에 복사되었습니다!
GET /openapi
4.2.2.4.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves the OpenAPI v3 specification in JSON format.
4.2.2.4.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.4.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
String
4.2.2.4.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/json
4.2.2.4.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | OpenAPI v3 specification in JSON format retrieved successfully. | String |
4.2.2.4.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.5. openapiv2 링크 복사링크가 클립보드에 복사되었습니다!
GET /openapi/v2
4.2.2.5.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
OpenAPI v2 Swagger not supported.
4.2.2.5.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.5.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.2.5.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.2.5.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 410 | OpenAPI v2 Swagger not supported. |
4.2.2.5.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.6. openapiv3 링크 복사링크가 클립보드에 복사되었습니다!
GET /openapi/v3
4.2.2.6.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves the OpenAPI v3 specification in JSON format.
4.2.2.6.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.6.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
String
4.2.2.6.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/json
4.2.2.6.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | OpenAPI v3 specification in JSON format retrieved successfully. | String |
4.2.2.6.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.7. ready 링크 복사링크가 클립보드에 복사되었습니다!
GET /ready
4.2.2.7.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Check if the bridge is ready and can accept requests.
4.2.2.7.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
4.2.2.7.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.2.7.4. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | The bridge is ready | <<>> |
| 500 | The bridge is not ready | <<>> |
4.2.2.7.5. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.3. Producer 링크 복사링크가 클립보드에 복사되었습니다!
4.2.3.1. send 링크 복사링크가 클립보드에 복사되었습니다!
POST /topics/{topicname}
4.2.3.1.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Sends one or more records to a given topic, optionally specifying a partition, key, or both.
4.2.3.1.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| topicname | Name of the topic to send records to or retrieve metadata from. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| ProducerRecordList | X |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| async | Ignore metadata as result of the sending operation, not returning them to the client. If not specified it is false, metadata returned. | - | null |
4.2.3.1.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.3.1.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.3.1.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | Records sent successfully. | |
| 404 | The specified topic was not found. | |
| 422 | The record list is not valid. |
4.2.3.1.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.3.2. sendToPartition 링크 복사링크가 클립보드에 복사되었습니다!
POST /topics/{topicname}/partitions/{partitionid}
4.2.3.2.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Sends one or more records to a given topic partition, optionally specifying a key.
4.2.3.2.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| topicname | Name of the topic to send records to or retrieve metadata from. | X | null | |
| partitionid | ID of the partition to send records to or retrieve metadata from. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| ProducerRecordToPartitionList | List of records to send to a given topic partition, including a value (required) and a key (optional). Section 4.3.20, “ProducerRecordToPartitionList ProducerRecordToPartitionList” | X |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| async | Whether to return immediately upon sending records, instead of waiting for metadata. No offsets will be returned if specified. Defaults to false. | - | null |
4.2.3.2.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.3.2.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.3.2.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | Records sent successfully. | |
| 404 | The specified topic partition was not found. | |
| 422 | The record is not valid. |
4.2.3.2.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.4. Seek 링크 복사링크가 클립보드에 복사되었습니다!
4.2.4.1. seek 링크 복사링크가 클립보드에 복사되었습니다!
POST /consumers/{groupid}/instances/{name}/positions
4.2.4.1.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Configures a subscribed consumer to fetch offsets from a particular offset the next time it fetches a set of records from a given topic partition. This overrides the default fetch behavior for consumers. You can specify one or more topic partitions.
4.2.4.1.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the consumer belongs. | X | null | |
| name | Name of the subscribed consumer. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| OffsetCommitSeekList | List of partition offsets from which the subscribed consumer will next fetch records. Section 4.3.9, “OffsetCommitSeekList OffsetCommitSeekList” | X |
4.2.4.1.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.4.1.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.4.1.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Seek performed successfully. | <<>> |
| 404 | The specified consumer instance was not found, or the specified consumer instance did not have one of the specified partitions assigned. |
4.2.4.1.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.4.2. seekToBeginning 링크 복사링크가 클립보드에 복사되었습니다!
POST /consumers/{groupid}/instances/{name}/positions/beginning
4.2.4.2.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Configures a subscribed consumer to seek (and subsequently read from) the first offset in one or more given topic partitions.
4.2.4.2.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the subscribed consumer belongs. | X | null | |
| name | Name of the subscribed consumer. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| Partitions | List of topic partitions to which the consumer is subscribed. The consumer will seek the first offset in the specified partitions. Section 4.3.16, “Partitions Partitions” | X |
4.2.4.2.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.4.2.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.4.2.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Seek to the beginning performed successfully. | <<>> |
| 404 | The specified consumer instance was not found, or the specified consumer instance did not have one of the specified partitions assigned. |
4.2.4.2.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.4.3. seekToEnd 링크 복사링크가 클립보드에 복사되었습니다!
POST /consumers/{groupid}/instances/{name}/positions/end
4.2.4.3.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Configures a subscribed consumer to seek (and subsequently read from) the offset at the end of one or more of the given topic partitions.
4.2.4.3.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| groupid | ID of the consumer group to which the subscribed consumer belongs. | X | null | |
| name | Name of the subscribed consumer. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| Partitions | List of topic partitions to which the consumer is subscribed. The consumer will seek the last offset in the specified partitions. Section 4.3.16, “Partitions Partitions” | X |
4.2.4.3.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.4.3.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.4.3.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 204 | Seek to the end performed successfully. | <<>> |
| 404 | The specified consumer instance was not found, or the specified consumer instance did not have one of the specified partitions assigned. |
4.2.4.3.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5. Topics 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.1. createTopic 링크 복사링크가 클립보드에 복사되었습니다!
POST /admin/topics
4.2.5.1.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Creates a topic with given name, partitions count, and replication factor.
4.2.5.1.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| NewTopic | Creates a topic with given name, partitions count, and replication factor. Section 4.3.7, “NewTopic NewTopic” | X |
4.2.5.1.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
-
4.2.5.1.4. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 201 | Created | <<>> |
4.2.5.1.5. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.2. getOffsets 링크 복사링크가 클립보드에 복사되었습니다!
GET /topics/{topicname}/partitions/{partitionid}/offsets
4.2.5.2.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves a summary of the offsets for the topic partition.
4.2.5.2.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| topicname | Name of the topic containing the partition. | X | null | |
| partitionid | ID of the partition. | X | null |
4.2.5.2.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.2.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.5.2.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | A summary of the offsets of the topic partition. | |
| 404 | The specified topic partition was not found. |
4.2.5.2.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.3. getPartition 링크 복사링크가 클립보드에 복사되었습니다!
GET /topics/{topicname}/partitions/{partitionid}
4.2.5.3.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves partition metadata for the topic partition.
4.2.5.3.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| topicname | Name of the topic to send records to or retrieve metadata from. | X | null | |
| partitionid | ID of the partition to send records to or retrieve metadata from. | X | null |
4.2.5.3.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.3.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.5.3.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | Partition metadata | |
| 404 | The specified partition was not found. |
4.2.5.3.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.4. getTopic 링크 복사링크가 클립보드에 복사되었습니다!
GET /topics/{topicname}
4.2.5.4.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves the metadata about a given topic.
4.2.5.4.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| topicname | Name of the topic to send records to or retrieve metadata from. | X | null |
4.2.5.4.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.4.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.5.4.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | Topic metadata | |
| 404 | The specified topic was not found. |
4.2.5.4.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.5. listPartitions 링크 복사링크가 클립보드에 복사되었습니다!
GET /topics/{topicname}/partitions
4.2.5.5.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves a list of partitions for the topic.
4.2.5.5.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| topicname | Name of the topic to send records to or retrieve metadata from. | X | null |
4.2.5.5.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
array[Section 4.3.15, “PartitionMetadata PartitionMetadata”]
4.2.5.5.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.5.5.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | List of partitions. | |
| 404 | The specified topic was not found. |
4.2.5.5.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.6. listTopics 링크 복사링크가 클립보드에 복사되었습니다!
GET /topics
4.2.5.6.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Retrieves a list of all topics.
4.2.5.6.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.6.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
List
4.2.5.6.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.5.6.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | List of topics. | List[string] |
4.2.5.6.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.7. send 링크 복사링크가 클립보드에 복사되었습니다!
POST /topics/{topicname}
4.2.5.7.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Sends one or more records to a given topic, optionally specifying a partition, key, or both.
4.2.5.7.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| topicname | Name of the topic to send records to or retrieve metadata from. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| ProducerRecordList | X |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| async | Ignore metadata as result of the sending operation, not returning them to the client. If not specified it is false, metadata returned. | - | null |
4.2.5.7.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.7.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.5.7.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | Records sent successfully. | |
| 404 | The specified topic was not found. | |
| 422 | The record list is not valid. |
4.2.5.7.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.8. sendToPartition 링크 복사링크가 클립보드에 복사되었습니다!
POST /topics/{topicname}/partitions/{partitionid}
4.2.5.8.1. Description 링크 복사링크가 클립보드에 복사되었습니다!
Sends one or more records to a given topic partition, optionally specifying a key.
4.2.5.8.2. Parameters 링크 복사링크가 클립보드에 복사되었습니다!
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| topicname | Name of the topic to send records to or retrieve metadata from. | X | null | |
| partitionid | ID of the partition to send records to or retrieve metadata from. | X | null |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| ProducerRecordToPartitionList | List of records to send to a given topic partition, including a value (required) and a key (optional). Section 4.3.20, “ProducerRecordToPartitionList ProducerRecordToPartitionList” | X |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
| async | Whether to return immediately upon sending records, instead of waiting for metadata. No offsets will be returned if specified. Defaults to false. | - | null |
4.2.5.8.3. Return Type 링크 복사링크가 클립보드에 복사되었습니다!
4.2.5.8.4. Content Type 링크 복사링크가 클립보드에 복사되었습니다!
- application/vnd.kafka.v2+json
4.2.5.8.5. Responses 링크 복사링크가 클립보드에 복사되었습니다!
| Code | Message | Datatype |
|---|---|---|
| 200 | Records sent successfully. | |
| 404 | The specified topic partition was not found. | |
| 422 | The record is not valid. |
4.2.5.8.6. Samples 링크 복사링크가 클립보드에 복사되었습니다!
4.3. Models 링크 복사링크가 클립보드에 복사되었습니다!
4.3.1. BridgeInfo BridgeInfo 링크 복사링크가 클립보드에 복사되었습니다!
Information about Kafka Bridge instance.
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| bridge_version | String |
4.3.2. Consumer Consumer 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| name | String | The unique name for the consumer instance. The name is unique within the scope of the consumer group. The name is used in URLs. If a name is not specified, a randomly generated name is assigned. | |||
| format | String | The allowable message format for the consumer, which can be `binary` (default) or `json`. The messages are converted into a JSON format. | |||
| auto.offset.reset | String | Resets the offset position for the consumer. If set to `latest` (default), messages are read from the latest offset. If set to `earliest`, messages are read from the first offset. | |||
| fetch.min.bytes | Integer | Sets the minimum amount of data, in bytes, for the consumer to receive. The broker waits until the data to send exceeds this amount. Default is `1` byte. | |||
| consumer.request.timeout.ms | Integer | Sets the maximum amount of time, in milliseconds, for the consumer to wait for messages for a request. If the timeout period is reached without a response, an error is returned. Default is `30000` (30 seconds). | |||
| enable.auto.commit | Boolean | If set to `true` (default), message offsets are committed automatically for the consumer. If set to `false`, message offsets must be committed manually. | |||
| isolation.level | String | If set to `read_uncommitted` (default), all transaction records are retrieved, indpendent of any transaction outcome. If set to `read_committed`, the records from committed transactions are retrieved. |
4.3.3. ConsumerRecord ConsumerRecord 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| key | |||||
| offset | Long | int64 | |||
| partition | Integer | int32 | |||
| topic | String | ||||
| value | X | ||||
| headers | |||||
| timestamp | Long | int64 |
4.3.4. CreatedConsumer CreatedConsumer 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| instance_id | String | Unique ID for the consumer instance in the group. | |||
| base_uri | String | Base URI used to construct URIs for subsequent requests against this consumer instance. |
4.3.5. Error Error 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| error_code | Integer | int32 | |||
| message | String |
4.3.6. KafkaHeader KafkaHeader 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| key | X | String | |||
| value | X | byte[] | The header value in binary format, base64-encoded | byte |
4.3.7. NewTopic NewTopic 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| topic_name | X | String | Name of the topic to create. | ||
| partitions_count | X | Integer | Number of partitions for the topic. | ||
| replication_factor | X | Integer | Number of replicas for each partition. |
4.3.8. OffsetCommitSeek OffsetCommitSeek 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| partition | X | Integer | int32 | ||
| offset | X | Long | int64 | ||
| topic | X | String |
4.3.9. OffsetCommitSeekList OffsetCommitSeekList 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| offsets |
4.3.10. OffsetRecordSent OffsetRecordSent 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| partition | Integer | int32 | |||
| offset | Long | int64 |
4.3.11. OffsetRecordSentList OffsetRecordSentList 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| offsets | List of OffsetRecordSentList_offsets_inner |
4.3.12. OffsetRecordSentListOffsetsInner 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| partition | Integer | int32 | |||
| offset | Long | int64 | |||
| error_code | Integer | int32 | |||
| message | String |
4.3.13. OffsetsSummary OffsetsSummary 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| beginning_offset | Long | int64 | |||
| end_offset | Long | int64 |
4.3.14. Partition Partition 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| partition | Integer | int32 | |||
| topic | String |
4.3.15. PartitionMetadata PartitionMetadata 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| partition | Integer | int32 | |||
| leader | Integer | int32 | |||
| replicas |
4.3.16. Partitions Partitions 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| partitions |
4.3.17. ProducerRecord ProducerRecord 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| partition | Integer | int32 | |||
| timestamp | Long | int64 | |||
| value | X | X | |||
| key | |||||
| headers |
4.3.18. ProducerRecordList ProducerRecordList 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| records |
4.3.19. ProducerRecordToPartition ProducerRecordToPartition 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| value | X | X | |||
| key | |||||
| headers |
4.3.20. ProducerRecordToPartitionList ProducerRecordToPartitionList 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| records | List of Section 4.3.19, “ProducerRecordToPartition ProducerRecordToPartition” |
4.3.21. RecordKey RecordKey 링크 복사링크가 클립보드에 복사되었습니다!
Key representation for a record. It can be an array, a JSON object or a string
| Field Name | Required | Nullable | Type | Description | Format |
|---|
4.3.22. RecordValue RecordValue 링크 복사링크가 클립보드에 복사되었습니다!
Value representation for a record. It can be an array, a JSON object or a string
| Field Name | Required | Nullable | Type | Description | Format |
|---|
4.3.23. Replica Replica 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| broker | Integer | int32 | |||
| leader | Boolean | ||||
| in_sync | Boolean |
4.3.24. SubscribedTopicList SubscribedTopicList 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| topics | |||||
| partitions | List of map | int32 |
4.3.25. TopicMetadata TopicMetadata 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| name | String | Name of the topic | |||
| configs | Map of string | Per-topic configuration overrides | |||
| partitions | List of Section 4.3.15, “PartitionMetadata PartitionMetadata” |
4.3.26. Topics Topics 링크 복사링크가 클립보드에 복사되었습니다!
| Field Name | Required | Nullable | Type | Description | Format |
|---|---|---|---|---|---|
| topics | List of string | ||||
| topic_pattern | String | A regex topic pattern for matching multiple topics |
Appendix A. Using your subscription 링크 복사링크가 클립보드에 복사되었습니다!
Streams for Apache Kafka is provided through a software subscription. To manage your subscriptions, access your account at the Red Hat Customer Portal.
A.1. Accessing Your Account 링크 복사링크가 클립보드에 복사되었습니다!
- Go to access.redhat.com.
- If you do not already have an account, create one.
- Log in to your account.
A.2. Activating a Subscription 링크 복사링크가 클립보드에 복사되었습니다!
- Go to access.redhat.com.
- Navigate to My Subscriptions.
- Navigate to Activate a subscription and enter your 16-digit activation number.
A.3. Downloading Zip and Tar Files 링크 복사링크가 클립보드에 복사되었습니다!
To access zip or tar files, use the customer portal to find the relevant files for download. If you are using RPM packages, this step is not required.
- Open a browser and log in to the Red Hat Customer Portal Product Downloads page at access.redhat.com/downloads.
- Locate the Streams for Apache Kafka entries in the INTEGRATION AND AUTOMATION category.
- Select the desired Streams for Apache Kafka product. The Software Downloads page opens.
- Click the Download link for your component.
A.4. Installing packages with DNF 링크 복사링크가 클립보드에 복사되었습니다!
To install a package and all the package dependencies, use:
dnf install <package_name>
dnf install <package_name>
To install a previously-downloaded package from a local directory, use:
dnf install <path_to_download_package>
dnf install <path_to_download_package>
Revised on 2026-01-16 17:17:10 UTC