O'Reilly logo

Real-time Analytics with Storm and Cassandra by Shilpi Saxena

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating Storm with RabbitMQ

Now that we have installed Storm, the next step will be to integrate RabbitMQ with Storm, for which we will have to create a custom spout called the RabbitMQ spout. This spout will read the messages from the specified queue; thus, it will furnish the role of a consumer, and then push these messages to a downstream topology.

Here is how the spout code will look:

public class AMQPRecvSpout implements IRichSpout{ //The constructor where we set initialize all properties public AMQPRecvSpout(String host, int port, String username, String password, String vhost, boolean requeueOnFail, boolean autoAck) { this.amqpHost = host; this.amqpPort = port; this.amqpUsername = username; this.amqpPasswd = password; this.amqpVhost = ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required