Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- // set up pipeline options
- Options options = PipelineOptionsFactory.fromArgs(args).withValidation().as(Options.class);
- options.setStreaming(true);
- Pipeline pipeline = Pipeline.create(options);
- Jedis jedis = new Jedis("localhost");
- JedisPubSub pubsub = new JedisPubSub() {
- @Override
- public void onMessage(String channel, String message) {
- super.onMessage(channel, message);
- JSONObject jsonObject = new JSONObject(message);
- }
- };
- jedis.subscribe(pubsub, "data-stream");
- pipeline.apply(
- "ReadFromPubSub", //This is where I need to pass a method that returns the message from the pubsub
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement