Hi, Oscar The collector object is created in [1] open method, so we can't get it in ProcessFunciton open method. One possible way is you change the source code, place it in ProcessFunction#Context.
[1] https://github.com/apache/flink/blob/aa8d93ea239f5be79066b7e5caad08d966c86ab2/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/ProcessOperator.java#L57 Best, Ron Oscar Perez via user <user@flink.apache.org> 于2023年8月30日周三 21:11写道: > Hi! > We would like to use hexagonal architecture in our design and treat the > collector as an output port when sending events from the use case. > > For that, we would like to call an interface from the use case that > effectively sends the event ultimately via out.collect > > The problem is that for instantiating the use case we need to inject the > collector as dependency and we dont have access to the collector at the > process function class level, only at the processelement method level. > > Is there any way to access the collector from the process function class, > in the open method ? > > Regards, > Oscar >