code: public void afterPropertiesSet() {
          Assert.notNull(this.messageChannel, "MessageChannel must not be null");
          if (this.messageChannel instanceof PollableChannel) {
              this.consumerEndpoint = new PollingConsumer((PollableChannel) this.messageChannel, this);
          } else if (this.messageChannel instanceof SubscribableChannel) {
              this.consumerEndpoint = new EventDrivenConsumer((SubscribableChannel) this.messageChannel, this);
          }
      }
docs: {@inheritDoc}