PubNub data stream publisher

Let's put together a quick publisher that reads the live stream of sensor data messages from the PubNub and pushes them to RabbitMQ:

.. public class TestStream { private static final String EXCHANGE_NAME = "MYExchange"; private final static String QUEUE_NAME = "MYQueue"; private final static String ROUTING_KEY = "MYQueue"; private static void RMQPublisher(String myRecord) throws IOException, TimeoutException { ConnectionFactory factory = new ConnectionFactory(); Address[] addressArr = { new Address("localhost", 5672) }; Connection connection = factory.newConnection(addressArr); Channel channel = connection.createChannel(); channel.exchangeDeclare(EXCHANGE_NAME, "direct"); channel.queueDeclare(QUEUE_NAME, true, ...

Get Practical Real-time Data Processing and Analytics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.