-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Implement Dev Services for Kafka #17468
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//// | ||
This guide is maintained in the main Quarkus repository | ||
and pull requests should be submitted there: | ||
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc | ||
//// | ||
= Dev Services for Kafka | ||
|
||
include::./attributes.adoc[] | ||
|
||
Dev Services for Kafka automatically starts a Kafka broker in dev mode and when running tests. | ||
So, you don't have to start a broker manually. | ||
The application is configured automatically. | ||
|
||
IMPORTANT: Because starting a Kafka broker can be long, Dev Services for Kafka uses https://vectorized.io/redpanda[Red Panda], a Kafka compatible broker which starts in ~1 second. | ||
|
||
== Enabling / Disabling Dev Services for Kafka | ||
|
||
Dev Services for Kafka is automatically enabled unless: | ||
|
||
- `quarkus.kafka.devservices.enabled` is set to `false` | ||
- the `kafka.bootstrap.servers` is configured | ||
- all the Reactive Messaging Kafka channels have the `bootstrap.servers` attribute set | ||
|
||
Dev Services for Kafka relies on Docker to start the broker. | ||
If your environment does not support Docker, you will need to start the broker manually, or connect to an already running broker. | ||
You can configure the broker address using `kafka.bootstrap.servers`. | ||
|
||
== Setting the port | ||
|
||
By default, Dev Services for Kafka picks a random port and configure the application. | ||
You can set the port by configuring the `quarkus.kafka.devservices.port` property. | ||
|
||
Note that the Kafka advertised address is automatically configured with the chosen port. | ||
|
||
== Configuring the image | ||
|
||
By default, Dev Services for Kafka uses: `vectorized/redpanda:latest`. | ||
You can select any version from https://hub.docker.com/r/vectorized/redpanda. | ||
|
||
IMPORTANT: Dev Services for Kafka only support Red Panda. |
This file contains 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
This file contains 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
17 changes: 17 additions & 0 deletions
17
...ent/src/main/java/io/quarkus/kafka/client/deployment/DevServicesKafkaBrokerBuildItem.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkus.kafka.client.deployment; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
public final class DevServicesKafkaBrokerBuildItem extends SimpleBuildItem { | ||
|
||
final String bootstrapServers; | ||
|
||
public DevServicesKafkaBrokerBuildItem(String bs) { | ||
this.bootstrapServers = bs; | ||
} | ||
|
||
public String getBootstrapServers() { | ||
return bootstrapServers; | ||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it really make sense to have a specific document just for that?
Not sure how it's organized for others but it feels a bit weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to have it in the Kafka quickstart (which has a lot of extra content that needs to move). Dev Services and its configuration has nothing to do with the quickstart. When we will have a proper reference guide it will go there.
Having a Kafka reference guide is on my todo list.