title: Spring Integration DSL: PublishSubscribeChannel order
body: <p>I want to understand how the PublishSubscribeChannel works, so I've implemented a small example:</p>
  
  <pre><code>@Bean
  public MessageSource&lt;?&gt; integerMessageSource() {
      MethodInvokingMessageSource source = new MethodInvokingMessageSource();
      source.setObject(new AtomicInteger());
      source.setMethodName("getAndIncrement");
      return source;
  }
  
  
  
  @Bean
  public IntegrationFlow mainFlow() {
      // @formatter:off
      return IntegrationFlows
          .from(integerMessageSource(), c -&gt; c.poller(Pollers.fixedRate(1000)))
          .publishSubscribeChannel(pubSub -&gt; pubSub
              .subscribe(flow -&gt; flow
                  .handle(message -&gt; LOG.info("Handling message, step 1: {}", message.getPayload())))
              .subscribe(flow -&gt; flow
                  .handle(message -&gt; LOG.info("Handling message, step 2: {}", message.getPayload())))
              .subscribe(flow -&gt; flow
                  .transform(source -&gt; MessageBuilder.withPayload("Error").build())
                  .handle(message -&gt; {
                      LOG.info("Error");
                  }))
              .subscribe(flow -&gt; flow
                  .handle(message -&gt; LOG.info("Handling message, step 4: {}", message.getPayload())))
          )
          .get();
      // @formatter:on
  }
  </code></pre>
  
  <p>I've expected that I see as an output:</p>
  
  <pre><code>Handling message, step 1...
  Handling message, step 2...
  Error
  Handling message, step 4...
  </code></pre>
  
  <p>But the third subflow (with the "Error" output) is always processed first. When I try to define an order I for steps 1, 2, and 4, I get the following console output (warning):</p>
  
  <pre><code>o.s.integration.dsl.GenericEndpointSpec  : 'order' can be applied only for AbstractMessageHandler
  </code></pre>
  
  <p>I would have expected that the subscribers gets called in the order of subscription, but this does not seem to be the case.</p>
  
  <p>I'm using Spring Boot 1.5.4 and Spring Integration 4.3.10.</p>