// Module included in the following assemblies:
//
// assembly-evaluation.adoc

[id='proc-using-amq-streams-{context}']

= Sending and receiving messages from a topic

You can test your Strimzi installation by sending and receiving messages to `my-topic` from outside the cluster.

Use a terminal to run a Kafka producer and consumer on a local machine.

.Prerequisites

* Ensure Strimzi is installed on the Kubernetes cluster.
* ZooKeeper and Kafka must be running to be able to send and receive messages.

.Procedure

. Download the latest Kafka binaries and install Kafka on your local machine.
+
{ApacheKafkaDownload}

. Find the port of the bootstrap service:
+
[source, shell, subs=+quotes, options="nowrap"]
----
kubectl get service my-cluster-kafka-external-bootstrap -n my-kafka-project -o=jsonpath='{.spec.ports[0].nodePort}{"\n"}'
----

. Find the IP address of the Minikube node:
+
[source, shell, subs=+quotes, options="nowrap"]
----
kubectl get nodes --output=jsonpath='{range .items[*]}{.status.addresses[?(@.type=="InternalIP")].address}{"\n"}{end}'
----

. Open a terminal, and start the Kafka console producer with the topic `my-topic`:
+
[source,shell,subs=+quotes]
----
bin/kafka-console-producer.sh --bootstrap-server _<node-address>_:_<node-port>_ --topic my-topic
----

. Type your message into the console where the producer is running.

. Open a new terminal tab or window, and start the consumer to receive the messages:
+
[source,shell,subs=+quotes]
----
bin/kafka-console-consumer.sh --bootstrap-server _<node-address>_:_<node-port>_ --topic my-topic --from-beginning
----

. Verify that you see the incoming messages in the consumer console.

. Press Crtl+C to exit the Kafka console producer and consumer.
