Guest User

Untitled

a guest
May 16th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. final DataStream<ObjectNode> inputStream = env
  2. .addSource(new RMQSource<ObjectNode>(
  3. connectionConfig, // config for the RabbitMQ connection
  4. "start", // name of the RabbitMQ queue to consume
  5. true, // use correlation ids; can be false if only at-least-once is required
  6. new JSONDeserializationSchema())) // deserialization schema to turn messages into Java objects
  7. .setParallelism(1); // non-parallel source is only required for exactly-once
  8.  
  9. stream.addSink(new RMQSink<ObjectNode>(
  10. connectionConfig,
  11. "stop",
  12. new JSONSerializationSchema()
  13. ));
Add Comment
Please, Sign In to add comment