Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Containerising App and verify Mongo and Kafka connections #16

Merged
merged 4 commits into from
Oct 27, 2024

Conversation

SVAdithya
Copy link
Owner

No description provided.

Copy link

SVAdithya

This comment was marked as spam.

@@ -75,6 +110,9 @@ services:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana-storage:/var/lib/grafana
networks:
- app-network
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grafana Working as expected:
image

@@ -2,13 +2,13 @@ spring.application.name=KafkaStudy
kafka.regular.topic=my-topic
regular.kafka.autostart=false
reactive.kafka.autostart=true
spring.kafka.consumer.bootstrap-servers=127.0.0.1:9092
spring.kafka.consumer.bootstrap-servers=kafka:9092
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Able to produce message to Kafka and App is consuming data
image

App logs:
image

spring.kafka.consumer.group-id=demo-3
spring.kafka.consumer.auto-offset-reset=earliest
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer
spring.kafka.consumer.properties.session.timeout.ms=30000
spring.kafka.consumer.properties.heartbeat.interval.ms=10000
spring.data.mongodb.uri=mongodb://root:example@localhost:27017/testMongoDb?authSource=admin
spring.data.mongodb.uri=mongodb://root:example@mongodb:27017/testMongoDb?authSource=admin
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data successfully saved to MongoDB.
image

mongodb:
image: mongo:latest
container_name: mongodb-container
container_name: mongodb
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INSIDE Listener:
Purpose: This is used for communication between Kafka brokers and clients (like producers and consumers) that are within the Docker network. It is typically configured to listen on a specific internal IP address or hostname.
Example Usage: If you have other services running in the same Docker network (e.g., your Spring Boot application), they will connect to Kafka using the INSIDE listener.
OUTSIDE Listener:
Purpose: This listener is exposed to the outside world, allowing clients outside of the Docker network (such as applications running on your local machine) to connect to Kafka. This typically listens on localhost or a specific external IP address.
Example Usage: If you are testing Kafka from your local machine or another service outside the Docker network, you will connect using the OUTSIDE listener.

@SVAdithya SVAdithya merged commit 350e5b0 into main Oct 27, 2024
3 checks passed
@SVAdithya SVAdithya deleted the feature/containerize_app branch October 27, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant