[ https://issues.apache.org/jira/browse/FLINK-11213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16728303#comment-16728303 ]
vinoyang edited comment on FLINK-11213 at 12/24/18 11:14 AM: ------------------------------------------------------------- [~lzh9] If you want to ask a question, it is a better option to send the question to the users mailing list. was (Author: yanghua): [~lzh9] If you want to ask a question, it is a better option to send the question to the [users mailing list|u...@flink.apache.org]. > Is there any condition that large amount of redis connection created on each > TM? > -------------------------------------------------------------------------------- > > Key: FLINK-11213 > URL: https://issues.apache.org/jira/browse/FLINK-11213 > Project: Flink > Issue Type: Task > Reporter: lzh9 > Priority: Major > > In the job, large amount of redis connections are created on each TM, is > there some ideas? code like: > def main(args:Array[String]): Unit = { > val env = StreamExecutionEnvironment.getExecutionEnvironment > env.addSource(new Source).setParallelism(4).addSink(new > Sinker).setParallelism(4) > env.execute() > } > class Sinker extends RichSinkFunction[String]{ > lazy val applicationContext = new > ClassPathXmlApplicationContext("application-redis-context.xml") > lazy val redisTemplate =applicationContext.getBean("redisTemplate", > classOf[RedisTemplate[String, String]]) > override def invoke(value: String, context: SinkFunction.Context[_]): Unit = > { > val value = redisTemplate.opsForValue().get("key01") > println(value) > } > } -- This message was sent by Atlassian JIRA (v7.6.3#76005)