title: Multiple spring cloud stream application running together
body: <p>I referred to the example posted <a href="https://stackoverflow.com/questions/52814155/multiple-streamlisteners-with-spring-cloud-stream-connected-to-kafka/52842392">here</a>. I am trying to run Multiple spring cloud stream application together. Here the output of first is given as input to other. Below is what I am trying to do.   </p>
  
  <pre><code>@Bean
      public Function&lt;KStream&lt;FormUUID, FormData&gt;, KStream&lt;UUID, Application&gt;&gt; process()
      {
          //do some processing here and return 
      }
  // read output from above process and join it with an event stream
  @Bean
      public BiConsumer&lt;KStream&lt;UUID, ProcessEvent&gt;, KTable&lt;UUID, Application&gt;&gt; listen()
      {
  
          return (eventStream,appTable )-&gt; eventStream
                  .join(appTable, (event, app) -&gt; app).foreach((k, app) -&gt; app.createQuote());
  
      }
  </code></pre>
  
  <p>The application.yml looks like below</p>
  
  <pre><code>spring.cloud:
   function: process;listen
   stream:
    kafka.streams:
      bindings:
        process-in-0.consumer.application-id: form-aggregator
        listen-in-0.consumer.application-id: event-processor
        listen-in-1.consumer.application-id: event-processor
      binder.configuration:
        default.key.serde: org.springframework.kafka.support.serializer.JsonSerde
        default.value.serde: org.springframework.kafka.support.serializer.JsonSerde
        spring.json.key.default.type: com.xxx.datamapper.domain.FormUUID
        spring.json.value.default.type: com.xxx.datamapper.domain.FormData
        commit.interval.ms: 1000
    bindings:
      process-in-0.destination: FORM_DATA_TOPIC
      process-out-0.destination: APPLICATION_TOPIC
      listen-in-0.destination: APPLICATION_TOPIC
      listen-in-1.destination: PROCESS_TOPIC
  </code></pre>
  
  <p>Above configuration throws </p>
  
  <pre><code>java.lang.IllegalStateException: Multiple functions found, but function definition property is not set.
  </code></pre>
  
  <p>if I try to use below configuration </p>
  
  <pre><code>spring.cloud.stream.function.definition: processAndListen
  </code></pre>
  
  <p>Then my application works but the second stream config (defined in listen Bean) doesnt gets executed.</p>