Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Python Real time Applications with Storm

You're reading from   Building Python Real time Applications with Storm Learn to process massive real-time data streams using Storm and Python—no Java required!

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781784392857
Length 122 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Testing a bolt


Storm makes it easy to deploy and run Python topologies, but developing and testing them in Storm is challenging, whether running in standalone Storm or a full Storm deployment:

  • Storm launches programs on your behalf—not only your Python code but auxiliary Java processes as well

  • It controls the Python components' standard input and output channels

  • The Python programs must respond regularly to heartbeat messages or be shut down by Storm

This makes it difficult to debug Storm topologies using the typical tools and techniques used for other pieces of Python code, such as the common technique of running from the command line and debugging with pdb.

Petrel's mock module helps us with this. It provides a simple, standalone Python container for testing simple topologies and verifying that the expected results are returned.

In Petrel terms, a simple topology is one that only outputs to the default stream and has no branches or loops. The run_simple_topology() assumes that the first component...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image