Below is the code that is reading from pubsub topic.
public IntegrationFlow processEvent() {
return IntegrationFlow.from(Consumer.class, gateway -> gateway.beanName("onMessage"))
.transform(Transformers.fromJson(Alert.class))
.log(LoggingHandler.Level.DEBUG, "Message Routed to DB store", t -> t.toString())
.routeToRecipients(r -> r
.recipient(persistenceRouteChannel()))
.get();
}
here its not happening parallel.
My use case is to pull the records from pubsub and put it into postgresdb. But with spring integration flow it taking long like to insert 1000 records it taking around 15 mins. I created multiple threads using spring.cloud.gcp.pubsub.subscriber.executor-threads=4 and spring.cloud.gcp.pubsub.subscriber.parallel-pull-count=3 .Still the threads are threads still in parking state. How to enable Parnellism or concurrency for the Integration flow.