Skip to content

Commit c53025e

Browse files
authored
Renamed hello-world Java to java-kafka (#45)
* Renamed hello-world Java to kafka-native Signed-off-by: Paolo Patierno <ppatierno@live.com> * Renamed Java application to java-kafka-producer, consumer and streams Signed-off-by: Paolo Patierno <ppatierno@live.com>
1 parent fe6ebb7 commit c53025e

29 files changed

+170
-170
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
RELEASE_VERSION ?= latest
22

3-
SUBDIRS=java/kafka/hello-world-consumer java/kafka/hello-world-producer java/kafka/hello-world-streams http/vertx/kafka-http-consumer http/vertx/kafka-http-producer
3+
SUBDIRS=java/kafka/consumer java/kafka/producer java/kafka/streams http/vertx/kafka-http-consumer http/vertx/kafka-http-producer
44
DOCKER_TARGETS=docker_build docker_push docker_tag
55

66
all: $(SUBDIRS)

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ Examples how to deploy Apache Kafka using Strimzi can be found on the [Strimzi w
3636

3737
After successfully building the images (which will cause the images to be pushed to the specified Docker repository) you are ready to deploy the producer and consumer containers along with Kafka and Zookeper.
3838

39-
You can deploy the examples individually by applying [`hello-world-producer.yaml`](./java/kafka/hello-world-producer.yaml), [`hello-world-consumer.yaml`](./java/kafka/hello-world-consumer.yaml) and [`hello-world-streams.yaml`](./java/kafka/hello-world-streams.yaml) files.
39+
You can deploy the examples individually by applying [`java-kafka-producer.yaml`](./java/kafka/java-kafka-producer.yaml), [`java-kafka-consumer.yaml`](./java/kafka/java-kafka-consumer.yaml) and [`java-kafka-streams.yaml`](./java/kafka/java-kafka-streams.yaml) files.
4040
This will create Kubernetes `Deployments` with the example image.
4141
The second option is to apply `deployment.yaml` file.
4242
This deploys the producer, consumer and streams and also creates the topics they are using.
4343

44-
If you built your own version of these examples, remember to update the `image` field with the path where the image was pushed during the build and it's available (i.e. `<my-docker-org>/hello-world-consumer:latest`).
44+
If you built your own version of these examples, remember to update the `image` field with the path where the image was pushed during the build and it's available (i.e. `<my-docker-org>/java-kafka-consumer:latest`).
4545

4646
When using [`deployment.yaml`](./java/kafka/deployment.yaml) file for deployment you can start observing the sending messages in producer container's log and the receiving of messages in consumer container's log.
4747
It's also available as a [`deployment-ssl.yaml`](./java/kafka/deployment-ssl.yaml) which deploys the same producer and consumer applications but using a TLS encryption and [`deployment-ssl-auth.yaml`](./java/kafka/deployment-ssl-auth.yaml) which uses TLS client authentication and ACLs.

java/kafka/hello-world-streams/Dockerfile java/kafka/consumer/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ ENV VERSION ${version}
1111
COPY ./scripts/ /bin
1212
COPY ./src/main/resources/log4j2.properties /bin/log4j2.properties
1313

14-
ADD target/hello-world-streams-1.0-SNAPSHOT.jar /
14+
ADD target/java-kafka-consumer-1.0-SNAPSHOT.jar /
1515

16-
CMD ["/bin/run.sh", "/hello-world-streams-1.0-SNAPSHOT.jar"]
16+
CMD ["/bin/run.sh", "/java-kafka-consumer-1.0-SNAPSHOT.jar"]

java/kafka/hello-world-streams/Makefile java/kafka/consumer/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PROJECT_NAME=hello-world-streams
1+
PROJECT_NAME=java-kafka-consumer
22

33
all: java_build docker_build docker_push
44
build: java_build

java/kafka/hello-world-consumer/pom.xml java/kafka/consumer/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
<parent>
88
<groupId>strimzi.io</groupId>
9-
<artifactId>kafka-java-example</artifactId>
9+
<artifactId>java-kafka-examples</artifactId>
1010
<version>1.0-SNAPSHOT</version>
1111
</parent>
12-
<artifactId>hello-world-consumer</artifactId>
12+
<artifactId>java-kafka-consumer</artifactId>
1313

1414
<dependencies>
1515
<dependency>

java/kafka/deployment-oauth.yaml

+34-34
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121
apiVersion: kafka.strimzi.io/v1beta1
2222
kind: KafkaUser
2323
metadata:
24-
name: service-account-hello-world-producer
24+
name: service-account-java-kafka-producer
2525
labels:
2626
strimzi.io/cluster: my-cluster
2727
spec:
@@ -44,7 +44,7 @@ spec:
4444
apiVersion: v1
4545
kind: Secret
4646
metadata:
47-
name: hello-world-producer-oauth
47+
name: java-kafka-producer-oauth
4848
type: Opaque
4949
data:
5050
clientSecret: aGVsbG8td29ybGQtcHJvZHVjZXItc2VjcmV0
@@ -53,21 +53,21 @@ apiVersion: apps/v1
5353
kind: Deployment
5454
metadata:
5555
labels:
56-
app: hello-world-producer
57-
name: hello-world-producer
56+
app: java-kafka-producer
57+
name: java-kafka-producer
5858
spec:
5959
replicas: 1
6060
selector:
6161
matchLabels:
62-
app: hello-world-producer
62+
app: java-kafka-producer
6363
template:
6464
metadata:
6565
labels:
66-
app: hello-world-producer
66+
app: java-kafka-producer
6767
spec:
6868
containers:
69-
- name: hello-world-producer
70-
image: strimzi/hello-world-producer:latest
69+
- name: java-kafka-producer
70+
image: strimzi/java-kafka-producer:latest
7171
env:
7272
- name: BOOTSTRAP_SERVERS
7373
value: my-cluster-kafka-bootstrap:9092
@@ -80,11 +80,11 @@ spec:
8080
- name: MESSAGE_COUNT
8181
value: "1000000"
8282
- name: OAUTH_CLIENT_ID
83-
value: hello-world-producer
83+
value: java-kafka-producer
8484
- name: OAUTH_CLIENT_SECRET
8585
valueFrom:
8686
secretKeyRef:
87-
name: hello-world-producer-oauth
87+
name: java-kafka-producer-oauth
8888
key: clientSecret
8989
- name: OAUTH_TOKEN_ENDPOINT_URI
9090
value: https://sso.myproject.svc:8443/auth/realms/internal/protocol/openid-connect/token
@@ -97,7 +97,7 @@ spec:
9797
apiVersion: kafka.strimzi.io/v1beta1
9898
kind: KafkaUser
9999
metadata:
100-
name: service-account-hello-world-streams
100+
name: service-account-java-kafka-streams
101101
labels:
102102
strimzi.io/cluster: my-cluster
103103
spec:
@@ -114,7 +114,7 @@ spec:
114114
operation: Describe
115115
- resource:
116116
type: group
117-
name: hello-world-streams
117+
name: java-kafka-streams
118118
patternType: prefix
119119
operation: Read
120120
- resource:
@@ -133,7 +133,7 @@ spec:
133133
apiVersion: v1
134134
kind: Secret
135135
metadata:
136-
name: hello-world-streams-oauth
136+
name: java-kafka-streams-oauth
137137
type: Opaque
138138
data:
139139
clientSecret: aGVsbG8td29ybGQtc3RyZWFtcy1zZWNyZXQ=
@@ -142,38 +142,38 @@ apiVersion: apps/v1
142142
kind: Deployment
143143
metadata:
144144
labels:
145-
app: hello-world-streams
146-
name: hello-world-streams
145+
app: java-kafka-streams
146+
name: java-kafka-streams
147147
spec:
148148
replicas: 1
149149
selector:
150150
matchLabels:
151-
app: hello-world-streams
151+
app: java-kafka-streams
152152
template:
153153
metadata:
154154
labels:
155-
app: hello-world-streams
155+
app: java-kafka-streams
156156
spec:
157157
containers:
158-
- name: hello-world-streams
159-
image: strimzi/hello-world-streams:latest
158+
- name: java-kafka-streams
159+
image: strimzi/java-kafka-streams:latest
160160
env:
161161
- name: BOOTSTRAP_SERVERS
162162
value: my-cluster-kafka-bootstrap:9092
163163
- name: APPLICATION_ID
164-
value: hello-world-streams
164+
value: java-kafka-streams
165165
- name: SOURCE_TOPIC
166166
value: my-topic
167167
- name: TARGET_TOPIC
168168
value: my-topic-reversed
169169
- name: LOG_LEVEL
170170
value: "INFO"
171171
- name: OAUTH_CLIENT_ID
172-
value: hello-world-streams
172+
value: java-kafka-streams
173173
- name: OAUTH_CLIENT_SECRET
174174
valueFrom:
175175
secretKeyRef:
176-
name: hello-world-streams-oauth
176+
name: java-kafka-streams-oauth
177177
key: clientSecret
178178
- name: OAUTH_TOKEN_ENDPOINT_URI
179179
value: https://sso.myproject.svc:8443/auth/realms/internal/protocol/openid-connect/token
@@ -186,7 +186,7 @@ spec:
186186
apiVersion: kafka.strimzi.io/v1beta1
187187
kind: KafkaUser
188188
metadata:
189-
name: service-account-hello-world-consumer
189+
name: service-account-java-kafka-consumer
190190
labels:
191191
strimzi.io/cluster: my-cluster
192192
spec:
@@ -203,13 +203,13 @@ spec:
203203
operation: Describe
204204
- resource:
205205
type: group
206-
name: hello-world-consumer
206+
name: java-kafka-consumer
207207
operation: Read
208208
---
209209
apiVersion: v1
210210
kind: Secret
211211
metadata:
212-
name: hello-world-consumer-oauth
212+
name: java-kafka-consumer-oauth
213213
type: Opaque
214214
data:
215215
clientSecret: aGVsbG8td29ybGQtY29uc3VtZXItc2VjcmV0
@@ -218,38 +218,38 @@ apiVersion: apps/v1
218218
kind: Deployment
219219
metadata:
220220
labels:
221-
app: hello-world-consumer
222-
name: hello-world-consumer
221+
app: java-kafka-consumer
222+
name: java-kafka-consumer
223223
spec:
224224
replicas: 1
225225
selector:
226226
matchLabels:
227-
app: hello-world-consumer
227+
app: java-kafka-consumer
228228
template:
229229
metadata:
230230
labels:
231-
app: hello-world-consumer
231+
app: java-kafka-consumer
232232
spec:
233233
containers:
234-
- name: hello-world-consumer
235-
image: strimzi/hello-world-consumer:latest
234+
- name: java-kafka-consumer
235+
image: strimzi/java-kafka-consumer:latest
236236
env:
237237
- name: BOOTSTRAP_SERVERS
238238
value: my-cluster-kafka-bootstrap:9092
239239
- name: TOPIC
240240
value: my-topic-reversed
241241
- name: GROUP_ID
242-
value: hello-world-consumer
242+
value: java-kafka-consumer
243243
- name: LOG_LEVEL
244244
value: "INFO"
245245
- name: MESSAGE_COUNT
246246
value: "1000000"
247247
- name: OAUTH_CLIENT_ID
248-
value: hello-world-consumer
248+
value: java-kafka-consumer
249249
- name: OAUTH_CLIENT_SECRET
250250
valueFrom:
251251
secretKeyRef:
252-
name: hello-world-consumer-oauth
252+
name: java-kafka-consumer-oauth
253253
key: clientSecret
254254
- name: OAUTH_TOKEN_ENDPOINT_URI
255255
value: https://sso.myproject.svc:8443/auth/realms/internal/protocol/openid-connect/token

0 commit comments

Comments
 (0)