> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamnative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Produce Messages

To build a JAR that we can run from the command line, first run:

```bash theme={null}
gradle shadowJar
```

And you should see the following output:

```bash theme={null}
BUILD SUCCESSFUL in 1s
```

Run the following command to execute the producer application, which will produce some random events to the `purchases` topic.

```bash theme={null}
java -cp build/libs/kafka-java-getting-started-0.0.1.jar io.streamnative.developer.ProducerExample
```

You should see output resembling this:

```bash theme={null}
10 events were produced to topic purchases
Produced event to topic purchases: key = awalther   value = t-shirts
Produced event to topic purchases: key = jbernard   value = alarm clock
Produced event to topic purchases: key = eabara     value = book
Produced event to topic purchases: key = htanaka    value = book
Produced event to topic purchases: key = jbernard   value = batteries
Produced event to topic purchases: key = awalther   value = book
Produced event to topic purchases: key = htanaka    value = book
Produced event to topic purchases: key = sgarcia    value = gift card
Produced event to topic purchases: key = sgarcia    value = t-shirts
Produced event to topic purchases: key = sgarcia    value = book
```
