djaneluz commented on issue #21825:
URL: https://github.com/apache/beam/issues/21825#issuecomment-1255455551

   Hello!
   
   I have a streaming pipeline that consumes Pub/Sub messages, extracts keys, 
group them by window (FixedWindow of 5 min) and call Redis to get the values, 
that are used as side input to another step.
   
   Something like:
   
           final PCollection<KV<String, Iterable<MyMessage>>> myMessageKV = 
pipeline
               .apply("ReadPubSubMessages", 
PubsubIO.readMessages().fromSubscription(options.getSubscription()))
               .apply("ExtractAndParse", ParDo.of(new ExtractAndParse()))
               .apply("MapMessageWithKey", 
MapElements.into(TypeDescriptors.kvs(TypeDescriptors.strings(), 
           TypeDescriptor.of(MyMessage.class)))
                   .via(m-> KV.of(m.getMyKey(), m)))
               .apply("5MinFixedWindow", 
Window.into(FixedWindows.of(Duration.standardMinutes(5))))
               .apply("GroupByKey", GroupByKey.create());
   
           final PCollectionView<Map<String, Iterable<String>>> myCache = 
myMessageKV 
                   .apply("ExtractKeys", Keys.create())
                   .apply("ReadRedis", RedisIO.readKeyPatterns()
                           .withEndpoint(redisHost, REDIS_PORT)
                           .withOutputParallelization(false))
                   .apply("ViewAsMultiMapFromCache", View.asMultimap());
   
           final PCollectionTuple outputs = myMessageKV 
                   .apply("EnrichMessage", ParDo.of(new EnrichMessages())
                            .withSideInput(REF_CODE_CACHE_TAG_ID, 
refCodeCache));
   
           ...
   
   I just ran the pipeline again with BEAM version _2.41.0_ and got the error. 
With version _2.38.0_ it works just fine.
   
   Let me know what more do you need.
   
   Thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to