This is a cache of https://developer.ibm.com/tutorials/event-streams-badge-event-streams-dev-challenge/. It is a snapshot of the page as it appeared on 2025-11-21T05:01:30.461+0000.
Take the IBM Event Streams Java app coding challenge - IBM Developer
In this tutorial, you will first run a small binary application. This application will produce some records to a topic. Then, your challenge is to write a consumer application that will consume records from the topic and that will recover the secret message put inside one of the records.
Prerequisites
To complete this challenge, you'll need the following in your local environment:
The challenge is to produce messages by running the producer binary application provided and modify the consumer application to find the secret message.
The producer application will create a topic called event-streams-coding-challenge and send records, one of which is the secret message. The next step will be to edit the example App.java application and add a poll loop in order to keep consuming records until it finds the secret message. The secret message is the value of the record that has the following key: coding-challenge.
Go to our ibm-messaging/eventstreams-badge-sample repository in GitHub, and click the clone or download button. You can choose to Clone with SSH, Use HTTPS, or Download a ZIP with the code. If you download a .ZIP file, unzip the repository.
Run the producer application by providing the broker address and API key found from your Event Streams Service credentials.
Ensure you see "Congratulations! You have successfully set up the topic for the coding challenge." in the output to confirm the secret message was correctly written to the topic.
Now it's time to try to recover the secret message!
Set up a project for the sample consumer application.
First, navigate to the coding-challenge-consumer directory:
cd coding-challenge-consumer
Copy codeCopied!
Then, create a project for your preferred IDE: gradle eclipse or gradle idea.
Finally, import the consumer project into your IDE.
In the IDE, open App.java and modify the code where you see TODO comments.
There are 4 TODO comments that highlight Consumer logic that is required to complete the challenge.
// TODO Move position to beginning of partition// TODO: Add consumer poll loop// TODO: Find the record whose key is equal to KEY ("coding-challenge")// TODO: Print the record value to discover the secret message
Copy codeCopied!
After you have finished modifying the consumer code, build the application.
Congratulations! You’ve successfully written your first Kafka application and completed the coding challenge. Be sure that you’ve checked out the Event Streams cheat sheet, because it’s packed full of ninja moves that every Event Streams user should know.
About cookies on this siteOur websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising.For more information, please review your cookie preferences options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.