title: Maybe not public or not valid? Using Spring's Websocket and Kafka
body: <p>As I am trying to consume data from a topic (the topic name is based on user) and during runtime I am trying to consume message from the topic but I am getting the following error.</p>
  
  <blockquote>
    <p>Caused by:
    org.springframework.expression.spel.SpelEvaluationException: EL1008E:
    Property or field 'consumerProperties' cannot be found on object of
    type 'org.springframework.beans.factory.config.BeanExpressionContext'
    - maybe not public or not valid?</p>
  </blockquote>
  
  <p>Here is my code </p>
  
  <pre><code>@Service
  public class kafkaConsumerService {
  
  
      private SimpMessagingTemplate template;
  
       KafkaConsumerProperties consumerProperties;
  
       @Autowired
      public kafkaConsumerService(KafkaConsumerProperties consumerProperties, SimpMessagingTemplate template) {
           this.consumerProperties=consumerProperties;
           this.template=template;
      }
  
      @KafkaListener(topics = {"#{consumerProperties.getTopic()}"})
      // @KafkaListener(topics="Chandan3706")
      public void consume(@Payload Message message) {
          System.out.println("from kafka topic::" + message);
          template.convertAndSend("/chat/getMessage", message);
      }
  
  }
  </code></pre>
  
  <p>My KafkaConsumerProperties.class</p>
  
  <pre><code>@Component
  @ConfigurationProperties(prefix="kafka.consumer")
  public class KafkaConsumerProperties {
  
      private String bootStrap;
      private String group;
      private String topic;
  
      public String getBootStrap() {
          return bootStrap;
      }
  
      public void setBootStrap(String bootStrap) {
          this.bootStrap = bootStrap;
      }
  
      public String getGroup() {
          return group;
      }
  
      public void setGroup(String group) {
          this.group = group;
      }
  
      public String getTopic() {
          return topic;
      }
  
      public void setTopic(String topic) {
          this.topic = topic;
  
      }
  
      @Override
      public String toString() {
          return "KafkaConsumerProperties [bootStrap=" + bootStrap + ", group=" + group + ", topic=" + topic + "]";
      }
  }
  </code></pre>
  
  <p>Thanks in advance</p>