title: How to write a custom Apache Camel component/endpoint with Spring Boot Java Config
body: <p>I'm looking for an example/documentation of how to implement a custom Apache Camel <code>component</code> and <code>endpoint</code> with Spring Boot in Java Config. I don't know how I have to annotate the classes, that Could you please provide an example. 
  Without using Spring my (working) code looks like this:</p>
  
  <pre><code>public class MyCustomComponent extends DefaultComponent {
      @Override
      protected Endpoint createEndpoint(String uri, String remaining, Map&lt;String, Object&gt; parameters) throws Exception {
          Endpoint endpoint = new MyCustomEndpoint(uri, this);
          setProperties(endpoint, parameters);
          return endpoint;
      }
  }
  </code></pre>
  
  <p>Registered is the component in <code>resources/META-INF/services/org/apache/camel/component/myscheme</code> with the FQN of the <code>MyCustomComponent</code> class.</p>
  
  <pre><code>public class MyCustomEndpoint extends DefaultEndpoint {
  
      public MyCustomEndpoint(String uri, MyCustomComponent component) {
          super(uri, component);
      }
  
      @Override
      public Producer createProducer() throws Exception {
          return new MyCustomProducer(this);
      }
  
      @Override
      public Consumer createConsumer(Processor processor) throws Exception {
          throw new UnsupportedOperationException("Not implemented yet: MyCustomEndpoint#createConsumer");
      }
  
      @Override
      public boolean isSingleton() {
          return false;
      }
  }
  </code></pre>
  
  <pre><code>public class MyCustomProducer extends DefaultProducer {
  
      public MyCustomProducer(Endpoint endpoint) {
          super(endpoint);
      }
  
      @Override
      public void process(Exchange exchange) throws Exception {
      }
  }
  </code></pre>