own endpoint exmaple?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

own endpoint exmaple?

Thomas Thiele
Hi,

can some point me to a working example where an own endpoint was created.

In route I say:

.to("thomas://foo")

my Endpoint is

@Component
@UriEndpoint(scheme = "thomas", title = "Thiele", syntax="thomas:name", label = "Thomas")
public class ThomasStep extends DefaultEndpoint
{}

But I get.

thomas://name due to: No component found with scheme: thomas
Reply | Threaded
Open this post in threaded view
|

Re: own endpoint exmaple?

Alex Dettinger
Hi Thomas,

  This link might be of interest:
  https://camel.apache.org/manual/latest/writing-components.html

  In your case, I wonder if you missed to create the thomas component first.

hth,
Alex

On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]> wrote:

> Hi,
>
> can some point me to a working example where an own endpoint was created.
>
> In route I say:
>
> .to("thomas://foo")
>
> my Endpoint is
>
> @Component
> @UriEndpoint(scheme = "thomas", title = "Thiele", syntax="thomas:name",
> label = "Thomas")
> public class ThomasStep extends DefaultEndpoint
> {}
>
> But I get.
>
> thomas://name due to: No component found with scheme: thomas
>
Reply | Threaded
Open this post in threaded view
|

AW: own endpoint exmaple?

Thomas Thiele
Hi Alex,

1. I found this webpage but the links (e.g. createProducer()) goes to "page not found".

2. Stupid question: how and where to do this?

-----Ursprüngliche Nachricht-----
Von: Alex Dettinger <[hidden email]>
Gesendet: Montag, 16. September 2019 12:52
An: [hidden email]
Betreff: Re: own endpoint exmaple?

Hi Thomas,

  This link might be of interest:
  https://camel.apache.org/manual/latest/writing-components.html

  In your case, I wonder if you missed to create the thomas component first.

hth,
Alex

On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]> wrote:

> Hi,
>
> can some point me to a working example where an own endpoint was created.
>
> In route I say:
>
> .to("thomas://foo")
>
> my Endpoint is
>
> @Component
> @UriEndpoint(scheme = "thomas", title = "Thiele",
> syntax="thomas:name", label = "Thomas") public class ThomasStep
> extends DefaultEndpoint {}
>
> But I get.
>
> thomas://name due to: No component found with scheme: thomas
>
Reply | Threaded
Open this post in threaded view
|

Re: own endpoint exmaple?

omarsmak
In reply to this post by Thomas Thiele
If I understand correctly, you want to create your own component, is that
correct? If that is the case, please check here:
https://camel.apache.org/manual/latest/writing-components.html. Basically
you will need to either:

   - Add add a file to META-INF/services/org/apache/camel/component/FOO to
   enable the auto-discovery per the docs.
   - Or initiate the component manually and add it to camel context, you
   can take a look an example here:
   https://github.com/apache/camel/blob/master/examples/camel-example-artemis/src/main/java/org/apache/camel/example/artemis/ArtemisMain.java#L39
or
   here:
   https://github.com/apache/camel/blob/master/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/BaseEmbeddedKafkaTest.java#L81

regards

On Mon, 16 Sep 2019 at 12:44, <[hidden email]> wrote:

> Hi,
>
> can some point me to a working example where an own endpoint was created.
>
> In route I say:
>
> .to("thomas://foo")
>
> my Endpoint is
>
> @Component
> @UriEndpoint(scheme = "thomas", title = "Thiele", syntax="thomas:name",
> label = "Thomas")
> public class ThomasStep extends DefaultEndpoint
> {}
>
> But I get.
>
> thomas://name due to: No component found with scheme: thomas
>
Reply | Threaded
Open this post in threaded view
|

Re: own endpoint exmaple?

shuston
In reply to this post by Thomas Thiele
Is it possible that Spring is not finding your endpoint class?

-Steve

On 9/16/19, 6:55 AM, "[hidden email]" <[hidden email]> wrote:

    Hi Alex,
   
    1. I found this webpage but the links (e.g. createProducer()) goes to "page not found".
   
    2. Stupid question: how and where to do this?
   
    -----Ursprüngliche Nachricht-----
    Von: Alex Dettinger <[hidden email]>
    Gesendet: Montag, 16. September 2019 12:52
    An: [hidden email]
    Betreff: Re: own endpoint exmaple?
   
    Hi Thomas,
   
      This link might be of interest:
      https://camel.apache.org/manual/latest/writing-components.html
   
      In your case, I wonder if you missed to create the thomas component first.
   
    hth,
    Alex
   
    On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]> wrote:
   
    > Hi,
    >
    > can some point me to a working example where an own endpoint was created.
    >
    > In route I say:
    >
    > .to("thomas://foo")
    >
    > my Endpoint is
    >
    > @Component
    > @UriEndpoint(scheme = "thomas", title = "Thiele",
    > syntax="thomas:name", label = "Thomas") public class ThomasStep
    > extends DefaultEndpoint {}
    >
    > But I get.
    >
    > thomas://name due to: No component found with scheme: thomas
    >
   

Reply | Threaded
Open this post in threaded view
|

AW: own endpoint exmaple?

Thomas Thiele
In reply to this post by omarsmak
Hi,

the problem is that a lot of links on the page you are mentionend, are dead ("page not found"). I should have told that in the first posting.

I use spring so I hoped spring will find it.

I will look at the examples. Thanks.

-----Ursprüngliche Nachricht-----
Von: Omar Al-Safi <[hidden email]>
Gesendet: Montag, 16. September 2019 12:57
An: [hidden email]
Betreff: Re: own endpoint exmaple?

If I understand correctly, you want to create your own component, is that correct? If that is the case, please check here:
https://camel.apache.org/manual/latest/writing-components.html. Basically you will need to either:

   - Add add a file to META-INF/services/org/apache/camel/component/FOO to
   enable the auto-discovery per the docs.
   - Or initiate the component manually and add it to camel context, you
   can take a look an example here:
   https://github.com/apache/camel/blob/master/examples/camel-example-artemis/src/main/java/org/apache/camel/example/artemis/ArtemisMain.java#L39
or
   here:
   https://github.com/apache/camel/blob/master/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/BaseEmbeddedKafkaTest.java#L81

regards

On Mon, 16 Sep 2019 at 12:44, <[hidden email]> wrote:

> Hi,
>
> can some point me to a working example where an own endpoint was created.
>
> In route I say:
>
> .to("thomas://foo")
>
> my Endpoint is
>
> @Component
> @UriEndpoint(scheme = "thomas", title = "Thiele",
> syntax="thomas:name", label = "Thomas") public class ThomasStep
> extends DefaultEndpoint {}
>
> But I get.
>
> thomas://name due to: No component found with scheme: thomas
>
Reply | Threaded
Open this post in threaded view
|

Re: own endpoint exmaple?

Alex Dettinger
In reply to this post by shuston
Also, the source code of the direct component could be a good starter to
get inspiration:
https://github.com/apache/camel/tree/master/components/camel-direct/src/main/java/org/apache/camel/component/direct

Alex

On Mon, Sep 16, 2019 at 12:57 PM Steve Huston <[hidden email]> wrote:

> Is it possible that Spring is not finding your endpoint class?
>
> -Steve
>
> On 9/16/19, 6:55 AM, "[hidden email]" <[hidden email]>
> wrote:
>
>     Hi Alex,
>
>     1. I found this webpage but the links (e.g. createProducer()) goes to
> "page not found".
>
>     2. Stupid question: how and where to do this?
>
>     -----Ursprüngliche Nachricht-----
>     Von: Alex Dettinger <[hidden email]>
>     Gesendet: Montag, 16. September 2019 12:52
>     An: [hidden email]
>     Betreff: Re: own endpoint exmaple?
>
>     Hi Thomas,
>
>       This link might be of interest:
>       https://camel.apache.org/manual/latest/writing-components.html
>
>       In your case, I wonder if you missed to create the thomas component
> first.
>
>     hth,
>     Alex
>
>     On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]> wrote:
>
>     > Hi,
>     >
>     > can some point me to a working example where an own endpoint was
> created.
>     >
>     > In route I say:
>     >
>     > .to("thomas://foo")
>     >
>     > my Endpoint is
>     >
>     > @Component
>     > @UriEndpoint(scheme = "thomas", title = "Thiele",
>     > syntax="thomas:name", label = "Thomas") public class ThomasStep
>     > extends DefaultEndpoint {}
>     >
>     > But I get.
>     >
>     > thomas://name due to: No component found with scheme: thomas
>     >
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: own endpoint exmaple?

omarsmak
I see, yeah we will need to fix this. By the way, you can
start scaffolding your component through maven archetype,
https://camel.apache.org/manual/latest/camel-maven-archetypes.html, as I
recall, it will also add the necessary files to enable camel auto discovery
out of the box

On Mon, 16 Sep 2019 at 13:01, Alex Dettinger <[hidden email]> wrote:

> Also, the source code of the direct component could be a good starter to
> get inspiration:
>
> https://github.com/apache/camel/tree/master/components/camel-direct/src/main/java/org/apache/camel/component/direct
>
> Alex
>
> On Mon, Sep 16, 2019 at 12:57 PM Steve Huston <[hidden email]>
> wrote:
>
> > Is it possible that Spring is not finding your endpoint class?
> >
> > -Steve
> >
> > On 9/16/19, 6:55 AM, "[hidden email]" <
> [hidden email]>
> > wrote:
> >
> >     Hi Alex,
> >
> >     1. I found this webpage but the links (e.g. createProducer()) goes to
> > "page not found".
> >
> >     2. Stupid question: how and where to do this?
> >
> >     -----Ursprüngliche Nachricht-----
> >     Von: Alex Dettinger <[hidden email]>
> >     Gesendet: Montag, 16. September 2019 12:52
> >     An: [hidden email]
> >     Betreff: Re: own endpoint exmaple?
> >
> >     Hi Thomas,
> >
> >       This link might be of interest:
> >       https://camel.apache.org/manual/latest/writing-components.html
> >
> >       In your case, I wonder if you missed to create the thomas component
> > first.
> >
> >     hth,
> >     Alex
> >
> >     On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]> wrote:
> >
> >     > Hi,
> >     >
> >     > can some point me to a working example where an own endpoint was
> > created.
> >     >
> >     > In route I say:
> >     >
> >     > .to("thomas://foo")
> >     >
> >     > my Endpoint is
> >     >
> >     > @Component
> >     > @UriEndpoint(scheme = "thomas", title = "Thiele",
> >     > syntax="thomas:name", label = "Thomas") public class ThomasStep
> >     > extends DefaultEndpoint {}
> >     >
> >     > But I get.
> >     >
> >     > thomas://name due to: No component found with scheme: thomas
> >     >
> >
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

AW: own endpoint exmaple?

Thomas Thiele
Hi,

thanks so far. I didn’t know that I had to explicitely create a Component. The direct example helped a lot.
But there is this contruct, and it will not work with my code.
name is not set. (it has getter and setter)

I want that name is "thomas" when route-def is like

to("monitoring:thomas")

@UriEndpoint(scheme = "monitoring", title = "monitoring", syntax="monitoring:name", label = "Monitoring")
public class MonitorEndpoint extends DefaultEndpoint
{
  @UriPath
  @Metadata(required = true)
  private String name;
 
  public MonitorEndpoint() {
  }

  public MonitorEndpoint(final String endpointUri, final Component component) {
    super(endpointUri, component);
  }
 
  @Override
  public Consumer createConsumer(Processor processor) throws Exception {
    // TODO Auto-generated method stub
    return null;
  }






-----Ursprüngliche Nachricht-----
Von: Omar Al-Safi <[hidden email]>
Gesendet: Montag, 16. September 2019 13:05
An: [hidden email]
Betreff: Re: own endpoint exmaple?

I see, yeah we will need to fix this. By the way, you can start scaffolding your component through maven archetype, https://camel.apache.org/manual/latest/camel-maven-archetypes.html, as I recall, it will also add the necessary files to enable camel auto discovery out of the box

On Mon, 16 Sep 2019 at 13:01, Alex Dettinger <[hidden email]> wrote:

> Also, the source code of the direct component could be a good starter
> to get inspiration:
>
> https://github.com/apache/camel/tree/master/components/camel-direct/sr
> c/main/java/org/apache/camel/component/direct
>
> Alex
>
> On Mon, Sep 16, 2019 at 12:57 PM Steve Huston <[hidden email]>
> wrote:
>
> > Is it possible that Spring is not finding your endpoint class?
> >
> > -Steve
> >
> > On 9/16/19, 6:55 AM, "[hidden email]" <
> [hidden email]>
> > wrote:
> >
> >     Hi Alex,
> >
> >     1. I found this webpage but the links (e.g. createProducer())
> > goes to "page not found".
> >
> >     2. Stupid question: how and where to do this?
> >
> >     -----Ursprüngliche Nachricht-----
> >     Von: Alex Dettinger <[hidden email]>
> >     Gesendet: Montag, 16. September 2019 12:52
> >     An: [hidden email]
> >     Betreff: Re: own endpoint exmaple?
> >
> >     Hi Thomas,
> >
> >       This link might be of interest:
> >       https://camel.apache.org/manual/latest/writing-components.html
> >
> >       In your case, I wonder if you missed to create the thomas
> > component first.
> >
> >     hth,
> >     Alex
> >
> >     On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]> wrote:
> >
> >     > Hi,
> >     >
> >     > can some point me to a working example where an own endpoint
> > was created.
> >     >
> >     > In route I say:
> >     >
> >     > .to("thomas://foo")
> >     >
> >     > my Endpoint is
> >     >
> >     > @Component
> >     > @UriEndpoint(scheme = "thomas", title = "Thiele",
> >     > syntax="thomas:name", label = "Thomas") public class ThomasStep
> >     > extends DefaultEndpoint {}
> >     >
> >     > But I get.
> >     >
> >     > thomas://name due to: No component found with scheme: thomas
> >     >
> >
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: own endpoint exmaple?

Alex Dettinger
Hi Thomas,

  Did you figured it out ?
  From the code, it's hard to see what the issue could be: Do you extend
DefaultComponent ? Do you call setProperties() in createEndpoint() ? and so
on...
  If you have not used an archetype yet, then I would direct you back to
Omar Al-Safi suggestion: Scaffolding your component through maven archetype
https://camel.apache.org/manual/latest/camel-maven-archetypes.html.
  You'll then have a proper layout to start on then.

Alex


On Tue, Sep 17, 2019 at 12:49 PM <[hidden email]> wrote:

> Hi,
>
> thanks so far. I didn’t know that I had to explicitely create a Component.
> The direct example helped a lot.
> But there is this contruct, and it will not work with my code.
> name is not set. (it has getter and setter)
>
> I want that name is "thomas" when route-def is like
>
> to("monitoring:thomas")
>
> @UriEndpoint(scheme = "monitoring", title = "monitoring",
> syntax="monitoring:name", label = "Monitoring")
> public class MonitorEndpoint extends DefaultEndpoint
> {
>   @UriPath
>   @Metadata(required = true)
>   private String name;
>
>   public MonitorEndpoint() {
>   }
>
>   public MonitorEndpoint(final String endpointUri, final Component
> component) {
>     super(endpointUri, component);
>   }
>
>   @Override
>   public Consumer createConsumer(Processor processor) throws Exception {
>     // TODO Auto-generated method stub
>     return null;
>   }
>
>
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Omar Al-Safi <[hidden email]>
> Gesendet: Montag, 16. September 2019 13:05
> An: [hidden email]
> Betreff: Re: own endpoint exmaple?
>
> I see, yeah we will need to fix this. By the way, you can start
> scaffolding your component through maven archetype,
> https://camel.apache.org/manual/latest/camel-maven-archetypes.html, as I
> recall, it will also add the necessary files to enable camel auto discovery
> out of the box
>
> On Mon, 16 Sep 2019 at 13:01, Alex Dettinger <[hidden email]>
> wrote:
>
> > Also, the source code of the direct component could be a good starter
> > to get inspiration:
> >
> > https://github.com/apache/camel/tree/master/components/camel-direct/sr
> > c/main/java/org/apache/camel/component/direct
> >
> > Alex
> >
> > On Mon, Sep 16, 2019 at 12:57 PM Steve Huston <[hidden email]>
> > wrote:
> >
> > > Is it possible that Spring is not finding your endpoint class?
> > >
> > > -Steve
> > >
> > > On 9/16/19, 6:55 AM, "[hidden email]" <
> > [hidden email]>
> > > wrote:
> > >
> > >     Hi Alex,
> > >
> > >     1. I found this webpage but the links (e.g. createProducer())
> > > goes to "page not found".
> > >
> > >     2. Stupid question: how and where to do this?
> > >
> > >     -----Ursprüngliche Nachricht-----
> > >     Von: Alex Dettinger <[hidden email]>
> > >     Gesendet: Montag, 16. September 2019 12:52
> > >     An: [hidden email]
> > >     Betreff: Re: own endpoint exmaple?
> > >
> > >     Hi Thomas,
> > >
> > >       This link might be of interest:
> > >       https://camel.apache.org/manual/latest/writing-components.html
> > >
> > >       In your case, I wonder if you missed to create the thomas
> > > component first.
> > >
> > >     hth,
> > >     Alex
> > >
> > >     On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]> wrote:
> > >
> > >     > Hi,
> > >     >
> > >     > can some point me to a working example where an own endpoint
> > > was created.
> > >     >
> > >     > In route I say:
> > >     >
> > >     > .to("thomas://foo")
> > >     >
> > >     > my Endpoint is
> > >     >
> > >     > @Component
> > >     > @UriEndpoint(scheme = "thomas", title = "Thiele",
> > >     > syntax="thomas:name", label = "Thomas") public class ThomasStep
> > >     > extends DefaultEndpoint {}
> > >     >
> > >     > But I get.
> > >     >
> > >     > thomas://name due to: No component found with scheme: thomas
> > >     >
> > >
> > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

AW: own endpoint exmaple?

Thomas Thiele
"Scaffolding your component through maven archetype"

I think at the moment I didn’t know much about it.
I really didn’t want to blow up pom only for a little endpoint. Or did I not get it?


-----Ursprüngliche Nachricht-----
Von: Alex Dettinger <[hidden email]>
Gesendet: Donnerstag, 19. September 2019 10:20
An: [hidden email]
Betreff: Re: own endpoint exmaple?

Hi Thomas,

  Did you figured it out ?
  From the code, it's hard to see what the issue could be: Do you extend DefaultComponent ? Do you call setProperties() in createEndpoint() ? and so on...
  If you have not used an archetype yet, then I would direct you back to Omar Al-Safi suggestion: Scaffolding your component through maven archetype https://camel.apache.org/manual/latest/camel-maven-archetypes.html.
  You'll then have a proper layout to start on then.

Alex


On Tue, Sep 17, 2019 at 12:49 PM <[hidden email]> wrote:

> Hi,
>
> thanks so far. I didn’t know that I had to explicitely create a Component.
> The direct example helped a lot.
> But there is this contruct, and it will not work with my code.
> name is not set. (it has getter and setter)
>
> I want that name is "thomas" when route-def is like
>
> to("monitoring:thomas")
>
> @UriEndpoint(scheme = "monitoring", title = "monitoring",
> syntax="monitoring:name", label = "Monitoring") public class
> MonitorEndpoint extends DefaultEndpoint {
>   @UriPath
>   @Metadata(required = true)
>   private String name;
>
>   public MonitorEndpoint() {
>   }
>
>   public MonitorEndpoint(final String endpointUri, final Component
> component) {
>     super(endpointUri, component);
>   }
>
>   @Override
>   public Consumer createConsumer(Processor processor) throws Exception {
>     // TODO Auto-generated method stub
>     return null;
>   }
>
>
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Omar Al-Safi <[hidden email]>
> Gesendet: Montag, 16. September 2019 13:05
> An: [hidden email]
> Betreff: Re: own endpoint exmaple?
>
> I see, yeah we will need to fix this. By the way, you can start
> scaffolding your component through maven archetype,
> https://camel.apache.org/manual/latest/camel-maven-archetypes.html, as
> I recall, it will also add the necessary files to enable camel auto
> discovery out of the box
>
> On Mon, 16 Sep 2019 at 13:01, Alex Dettinger <[hidden email]>
> wrote:
>
> > Also, the source code of the direct component could be a good
> > starter to get inspiration:
> >
> > https://github.com/apache/camel/tree/master/components/camel-direct/
> > sr c/main/java/org/apache/camel/component/direct
> >
> > Alex
> >
> > On Mon, Sep 16, 2019 at 12:57 PM Steve Huston <[hidden email]>
> > wrote:
> >
> > > Is it possible that Spring is not finding your endpoint class?
> > >
> > > -Steve
> > >
> > > On 9/16/19, 6:55 AM, "[hidden email]" <
> > [hidden email]>
> > > wrote:
> > >
> > >     Hi Alex,
> > >
> > >     1. I found this webpage but the links (e.g. createProducer())
> > > goes to "page not found".
> > >
> > >     2. Stupid question: how and where to do this?
> > >
> > >     -----Ursprüngliche Nachricht-----
> > >     Von: Alex Dettinger <[hidden email]>
> > >     Gesendet: Montag, 16. September 2019 12:52
> > >     An: [hidden email]
> > >     Betreff: Re: own endpoint exmaple?
> > >
> > >     Hi Thomas,
> > >
> > >       This link might be of interest:
> > >      
> > > https://camel.apache.org/manual/latest/writing-components.html
> > >
> > >       In your case, I wonder if you missed to create the thomas
> > > component first.
> > >
> > >     hth,
> > >     Alex
> > >
> > >     On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]> wrote:
> > >
> > >     > Hi,
> > >     >
> > >     > can some point me to a working example where an own endpoint
> > > was created.
> > >     >
> > >     > In route I say:
> > >     >
> > >     > .to("thomas://foo")
> > >     >
> > >     > my Endpoint is
> > >     >
> > >     > @Component
> > >     > @UriEndpoint(scheme = "thomas", title = "Thiele",
> > >     > syntax="thomas:name", label = "Thomas") public class ThomasStep
> > >     > extends DefaultEndpoint {}
> > >     >
> > >     > But I get.
> > >     >
> > >     > thomas://name due to: No component found with scheme: thomas
> > >     >
> > >
> > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: own endpoint exmaple?

omarsmak
Hi Thomas,

May I know what do you want to achieve here? The context of your problem
can help us to know how can you move forward without much complexity
involved.

Regards,
Omar

On Thu, Sep 19, 2019, 13:20 <[hidden email]> wrote:

> "Scaffolding your component through maven archetype"
>
> I think at the moment I didn’t know much about it.
> I really didn’t want to blow up pom only for a little endpoint. Or did I
> not get it?
>
>
> -----Ursprüngliche Nachricht-----
> Von: Alex Dettinger <[hidden email]>
> Gesendet: Donnerstag, 19. September 2019 10:20
> An: [hidden email]
> Betreff: Re: own endpoint exmaple?
>
> Hi Thomas,
>
>   Did you figured it out ?
>   From the code, it's hard to see what the issue could be: Do you extend
> DefaultComponent ? Do you call setProperties() in createEndpoint() ? and so
> on...
>   If you have not used an archetype yet, then I would direct you back to
> Omar Al-Safi suggestion: Scaffolding your component through maven archetype
> https://camel.apache.org/manual/latest/camel-maven-archetypes.html.
>   You'll then have a proper layout to start on then.
>
> Alex
>
>
> On Tue, Sep 17, 2019 at 12:49 PM <[hidden email]> wrote:
>
> > Hi,
> >
> > thanks so far. I didn’t know that I had to explicitely create a
> Component.
> > The direct example helped a lot.
> > But there is this contruct, and it will not work with my code.
> > name is not set. (it has getter and setter)
> >
> > I want that name is "thomas" when route-def is like
> >
> > to("monitoring:thomas")
> >
> > @UriEndpoint(scheme = "monitoring", title = "monitoring",
> > syntax="monitoring:name", label = "Monitoring") public class
> > MonitorEndpoint extends DefaultEndpoint {
> >   @UriPath
> >   @Metadata(required = true)
> >   private String name;
> >
> >   public MonitorEndpoint() {
> >   }
> >
> >   public MonitorEndpoint(final String endpointUri, final Component
> > component) {
> >     super(endpointUri, component);
> >   }
> >
> >   @Override
> >   public Consumer createConsumer(Processor processor) throws Exception {
> >     // TODO Auto-generated method stub
> >     return null;
> >   }
> >
> >
> >
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Omar Al-Safi <[hidden email]>
> > Gesendet: Montag, 16. September 2019 13:05
> > An: [hidden email]
> > Betreff: Re: own endpoint exmaple?
> >
> > I see, yeah we will need to fix this. By the way, you can start
> > scaffolding your component through maven archetype,
> > https://camel.apache.org/manual/latest/camel-maven-archetypes.html, as
> > I recall, it will also add the necessary files to enable camel auto
> > discovery out of the box
> >
> > On Mon, 16 Sep 2019 at 13:01, Alex Dettinger <[hidden email]>
> > wrote:
> >
> > > Also, the source code of the direct component could be a good
> > > starter to get inspiration:
> > >
> > > https://github.com/apache/camel/tree/master/components/camel-direct/
> > > sr c/main/java/org/apache/camel/component/direct
> > >
> > > Alex
> > >
> > > On Mon, Sep 16, 2019 at 12:57 PM Steve Huston <[hidden email]>
> > > wrote:
> > >
> > > > Is it possible that Spring is not finding your endpoint class?
> > > >
> > > > -Steve
> > > >
> > > > On 9/16/19, 6:55 AM, "[hidden email]" <
> > > [hidden email]>
> > > > wrote:
> > > >
> > > >     Hi Alex,
> > > >
> > > >     1. I found this webpage but the links (e.g. createProducer())
> > > > goes to "page not found".
> > > >
> > > >     2. Stupid question: how and where to do this?
> > > >
> > > >     -----Ursprüngliche Nachricht-----
> > > >     Von: Alex Dettinger <[hidden email]>
> > > >     Gesendet: Montag, 16. September 2019 12:52
> > > >     An: [hidden email]
> > > >     Betreff: Re: own endpoint exmaple?
> > > >
> > > >     Hi Thomas,
> > > >
> > > >       This link might be of interest:
> > > >
> > > > https://camel.apache.org/manual/latest/writing-components.html
> > > >
> > > >       In your case, I wonder if you missed to create the thomas
> > > > component first.
> > > >
> > > >     hth,
> > > >     Alex
> > > >
> > > >     On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]>
> wrote:
> > > >
> > > >     > Hi,
> > > >     >
> > > >     > can some point me to a working example where an own endpoint
> > > > was created.
> > > >     >
> > > >     > In route I say:
> > > >     >
> > > >     > .to("thomas://foo")
> > > >     >
> > > >     > my Endpoint is
> > > >     >
> > > >     > @Component
> > > >     > @UriEndpoint(scheme = "thomas", title = "Thiele",
> > > >     > syntax="thomas:name", label = "Thomas") public class ThomasStep
> > > >     > extends DefaultEndpoint {}
> > > >     >
> > > >     > But I get.
> > > >     >
> > > >     > thomas://name due to: No component found with scheme: thomas
> > > >     >
> > > >
> > > >
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

AW: own endpoint exmaple?

Thomas Thiele
Simply hide a complex monitoring (db-entries, log, etc.) with a simple call like "file://" "log:".
I could use a bean or processor and I actually I had, but I thought its simplier so. For the caller (routedef) and for clean code.


-----Ursprüngliche Nachricht-----
Von: Omar Al-Safi <[hidden email]>
Gesendet: Donnerstag, 19. September 2019 13:28
An: [hidden email]
Betreff: Re: own endpoint exmaple?

Hi Thomas,

May I know what do you want to achieve here? The context of your problem can help us to know how can you move forward without much complexity involved.

Regards,
Omar

On Thu, Sep 19, 2019, 13:20 <[hidden email]> wrote:

> "Scaffolding your component through maven archetype"
>
> I think at the moment I didn’t know much about it.
> I really didn’t want to blow up pom only for a little endpoint. Or did
> I not get it?
>
>
> -----Ursprüngliche Nachricht-----
> Von: Alex Dettinger <[hidden email]>
> Gesendet: Donnerstag, 19. September 2019 10:20
> An: [hidden email]
> Betreff: Re: own endpoint exmaple?
>
> Hi Thomas,
>
>   Did you figured it out ?
>   From the code, it's hard to see what the issue could be: Do you
> extend DefaultComponent ? Do you call setProperties() in
> createEndpoint() ? and so on...
>   If you have not used an archetype yet, then I would direct you back
> to Omar Al-Safi suggestion: Scaffolding your component through maven
> archetype https://camel.apache.org/manual/latest/camel-maven-archetypes.html.
>   You'll then have a proper layout to start on then.
>
> Alex
>
>
> On Tue, Sep 17, 2019 at 12:49 PM <[hidden email]> wrote:
>
> > Hi,
> >
> > thanks so far. I didn’t know that I had to explicitely create a
> Component.
> > The direct example helped a lot.
> > But there is this contruct, and it will not work with my code.
> > name is not set. (it has getter and setter)
> >
> > I want that name is "thomas" when route-def is like
> >
> > to("monitoring:thomas")
> >
> > @UriEndpoint(scheme = "monitoring", title = "monitoring",
> > syntax="monitoring:name", label = "Monitoring") public class
> > MonitorEndpoint extends DefaultEndpoint {
> >   @UriPath
> >   @Metadata(required = true)
> >   private String name;
> >
> >   public MonitorEndpoint() {
> >   }
> >
> >   public MonitorEndpoint(final String endpointUri, final Component
> > component) {
> >     super(endpointUri, component);
> >   }
> >
> >   @Override
> >   public Consumer createConsumer(Processor processor) throws Exception {
> >     // TODO Auto-generated method stub
> >     return null;
> >   }
> >
> >
> >
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Omar Al-Safi <[hidden email]>
> > Gesendet: Montag, 16. September 2019 13:05
> > An: [hidden email]
> > Betreff: Re: own endpoint exmaple?
> >
> > I see, yeah we will need to fix this. By the way, you can start
> > scaffolding your component through maven archetype,
> > https://camel.apache.org/manual/latest/camel-maven-archetypes.html,
> > as I recall, it will also add the necessary files to enable camel
> > auto discovery out of the box
> >
> > On Mon, 16 Sep 2019 at 13:01, Alex Dettinger <[hidden email]>
> > wrote:
> >
> > > Also, the source code of the direct component could be a good
> > > starter to get inspiration:
> > >
> > > https://github.com/apache/camel/tree/master/components/camel-direc
> > > t/ sr c/main/java/org/apache/camel/component/direct
> > >
> > > Alex
> > >
> > > On Mon, Sep 16, 2019 at 12:57 PM Steve Huston
> > > <[hidden email]>
> > > wrote:
> > >
> > > > Is it possible that Spring is not finding your endpoint class?
> > > >
> > > > -Steve
> > > >
> > > > On 9/16/19, 6:55 AM, "[hidden email]" <
> > > [hidden email]>
> > > > wrote:
> > > >
> > > >     Hi Alex,
> > > >
> > > >     1. I found this webpage but the links (e.g.
> > > > createProducer()) goes to "page not found".
> > > >
> > > >     2. Stupid question: how and where to do this?
> > > >
> > > >     -----Ursprüngliche Nachricht-----
> > > >     Von: Alex Dettinger <[hidden email]>
> > > >     Gesendet: Montag, 16. September 2019 12:52
> > > >     An: [hidden email]
> > > >     Betreff: Re: own endpoint exmaple?
> > > >
> > > >     Hi Thomas,
> > > >
> > > >       This link might be of interest:
> > > >
> > > > https://camel.apache.org/manual/latest/writing-components.html
> > > >
> > > >       In your case, I wonder if you missed to create the thomas
> > > > component first.
> > > >
> > > >     hth,
> > > >     Alex
> > > >
> > > >     On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]>
> wrote:
> > > >
> > > >     > Hi,
> > > >     >
> > > >     > can some point me to a working example where an own
> > > > endpoint was created.
> > > >     >
> > > >     > In route I say:
> > > >     >
> > > >     > .to("thomas://foo")
> > > >     >
> > > >     > my Endpoint is
> > > >     >
> > > >     > @Component
> > > >     > @UriEndpoint(scheme = "thomas", title = "Thiele",
> > > >     > syntax="thomas:name", label = "Thomas") public class ThomasStep
> > > >     > extends DefaultEndpoint {}
> > > >     >
> > > >     > But I get.
> > > >     >
> > > >     > thomas://name due to: No component found with scheme: thomas
> > > >     >
> > > >
> > > >
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: own endpoint exmaple?

gcotgi
A couple of suggestions from someone that had to build a custom component:

- Use the archetype to generate a skelton, then modify the pom to integrate
it back into your own structure. We did it and we found the process quite
straightforward.
- Find an existing camel component that works in a similar way to yours and
use it as an "inspiration" and as a reference.

For simpler projects (or one-offs) we usually just load a shared
RouteBuilder end expose the routes via a standard camel endpoint (e.g.
direct)

Hope it helps


Il gio 19 set 2019, 13:43 <[hidden email]> ha scritto:

> Simply hide a complex monitoring (db-entries, log, etc.) with a simple
> call like "file://" "log:".
> I could use a bean or processor and I actually I had, but I thought its
> simplier so. For the caller (routedef) and for clean code.
>
>
> -----Ursprüngliche Nachricht-----
> Von: Omar Al-Safi <[hidden email]>
> Gesendet: Donnerstag, 19. September 2019 13:28
> An: [hidden email]
> Betreff: Re: own endpoint exmaple?
>
> Hi Thomas,
>
> May I know what do you want to achieve here? The context of your problem
> can help us to know how can you move forward without much complexity
> involved.
>
> Regards,
> Omar
>
> On Thu, Sep 19, 2019, 13:20 <[hidden email]> wrote:
>
> > "Scaffolding your component through maven archetype"
> >
> > I think at the moment I didn’t know much about it.
> > I really didn’t want to blow up pom only for a little endpoint. Or did
> > I not get it?
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Alex Dettinger <[hidden email]>
> > Gesendet: Donnerstag, 19. September 2019 10:20
> > An: [hidden email]
> > Betreff: Re: own endpoint exmaple?
> >
> > Hi Thomas,
> >
> >   Did you figured it out ?
> >   From the code, it's hard to see what the issue could be: Do you
> > extend DefaultComponent ? Do you call setProperties() in
> > createEndpoint() ? and so on...
> >   If you have not used an archetype yet, then I would direct you back
> > to Omar Al-Safi suggestion: Scaffolding your component through maven
> > archetype
> https://camel.apache.org/manual/latest/camel-maven-archetypes.html.
> >   You'll then have a proper layout to start on then.
> >
> > Alex
> >
> >
> > On Tue, Sep 17, 2019 at 12:49 PM <[hidden email]> wrote:
> >
> > > Hi,
> > >
> > > thanks so far. I didn’t know that I had to explicitely create a
> > Component.
> > > The direct example helped a lot.
> > > But there is this contruct, and it will not work with my code.
> > > name is not set. (it has getter and setter)
> > >
> > > I want that name is "thomas" when route-def is like
> > >
> > > to("monitoring:thomas")
> > >
> > > @UriEndpoint(scheme = "monitoring", title = "monitoring",
> > > syntax="monitoring:name", label = "Monitoring") public class
> > > MonitorEndpoint extends DefaultEndpoint {
> > >   @UriPath
> > >   @Metadata(required = true)
> > >   private String name;
> > >
> > >   public MonitorEndpoint() {
> > >   }
> > >
> > >   public MonitorEndpoint(final String endpointUri, final Component
> > > component) {
> > >     super(endpointUri, component);
> > >   }
> > >
> > >   @Override
> > >   public Consumer createConsumer(Processor processor) throws Exception
> {
> > >     // TODO Auto-generated method stub
> > >     return null;
> > >   }
> > >
> > >
> > >
> > >
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Omar Al-Safi <[hidden email]>
> > > Gesendet: Montag, 16. September 2019 13:05
> > > An: [hidden email]
> > > Betreff: Re: own endpoint exmaple?
> > >
> > > I see, yeah we will need to fix this. By the way, you can start
> > > scaffolding your component through maven archetype,
> > > https://camel.apache.org/manual/latest/camel-maven-archetypes.html,
> > > as I recall, it will also add the necessary files to enable camel
> > > auto discovery out of the box
> > >
> > > On Mon, 16 Sep 2019 at 13:01, Alex Dettinger <[hidden email]>
> > > wrote:
> > >
> > > > Also, the source code of the direct component could be a good
> > > > starter to get inspiration:
> > > >
> > > > https://github.com/apache/camel/tree/master/components/camel-direc
> > > > t/ sr c/main/java/org/apache/camel/component/direct
> > > >
> > > > Alex
> > > >
> > > > On Mon, Sep 16, 2019 at 12:57 PM Steve Huston
> > > > <[hidden email]>
> > > > wrote:
> > > >
> > > > > Is it possible that Spring is not finding your endpoint class?
> > > > >
> > > > > -Steve
> > > > >
> > > > > On 9/16/19, 6:55 AM, "[hidden email]" <
> > > > [hidden email]>
> > > > > wrote:
> > > > >
> > > > >     Hi Alex,
> > > > >
> > > > >     1. I found this webpage but the links (e.g.
> > > > > createProducer()) goes to "page not found".
> > > > >
> > > > >     2. Stupid question: how and where to do this?
> > > > >
> > > > >     -----Ursprüngliche Nachricht-----
> > > > >     Von: Alex Dettinger <[hidden email]>
> > > > >     Gesendet: Montag, 16. September 2019 12:52
> > > > >     An: [hidden email]
> > > > >     Betreff: Re: own endpoint exmaple?
> > > > >
> > > > >     Hi Thomas,
> > > > >
> > > > >       This link might be of interest:
> > > > >
> > > > > https://camel.apache.org/manual/latest/writing-components.html
> > > > >
> > > > >       In your case, I wonder if you missed to create the thomas
> > > > > component first.
> > > > >
> > > > >     hth,
> > > > >     Alex
> > > > >
> > > > >     On Mon, Sep 16, 2019 at 12:44 PM <[hidden email]>
> > wrote:
> > > > >
> > > > >     > Hi,
> > > > >     >
> > > > >     > can some point me to a working example where an own
> > > > > endpoint was created.
> > > > >     >
> > > > >     > In route I say:
> > > > >     >
> > > > >     > .to("thomas://foo")
> > > > >     >
> > > > >     > my Endpoint is
> > > > >     >
> > > > >     > @Component
> > > > >     > @UriEndpoint(scheme = "thomas", title = "Thiele",
> > > > >     > syntax="thomas:name", label = "Thomas") public class
> ThomasStep
> > > > >     > extends DefaultEndpoint {}
> > > > >     >
> > > > >     > But I get.
> > > > >     >
> > > > >     > thomas://name due to: No component found with scheme: thomas
> > > > >     >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

AW: own endpoint exmaple?

Thomas Thiele
Thanks. Will look at it.

-----Ursprüngliche Nachricht-----
Von: Condello, Giovanni <[hidden email]>
Gesendet: Donnerstag, 19. September 2019 13:55
An: [hidden email]
Betreff: Re: own endpoint exmaple?

A couple of suggestions from someone that had to build a custom component:

- Use the archetype to generate a skelton, then modify the pom to integrate it back into your own structure. We did it and we found the process quite straightforward.
- Find an existing camel component that works in a similar way to yours and use it as an "inspiration" and as a reference.

For simpler projects (or one-offs) we usually just load a shared RouteBuilder end expose the routes via a standard camel endpoint (e.g.
direct)

Hope it helps


Il gio 19 set 2019, 13:43 <[hidden email]> ha scritto:

> Simply hide a complex monitoring (db-entries, log, etc.) with a simple
> call like "file://" "log:".
> I could use a bean or processor and I actually I had, but I thought
> its simplier so. For the caller (routedef) and for clean code.
>
>
> -----Ursprüngliche Nachricht-----
> Von: Omar Al-Safi <[hidden email]>
> Gesendet: Donnerstag, 19. September 2019 13:28
> An: [hidden email]
> Betreff: Re: own endpoint exmaple?
>
> Hi Thomas,
>
> May I know what do you want to achieve here? The context of your
> problem can help us to know how can you move forward without much
> complexity involved.
>
> Regards,
> Omar
>
> On Thu, Sep 19, 2019, 13:20 <[hidden email]> wrote:
>
> > "Scaffolding your component through maven archetype"
> >
> > I think at the moment I didn’t know much about it.
> > I really didn’t want to blow up pom only for a little endpoint. Or
> > did I not get it?
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Alex Dettinger <[hidden email]>
> > Gesendet: Donnerstag, 19. September 2019 10:20
> > An: [hidden email]
> > Betreff: Re: own endpoint exmaple?
> >
> > Hi Thomas,
> >
> >   Did you figured it out ?
> >   From the code, it's hard to see what the issue could be: Do you
> > extend DefaultComponent ? Do you call setProperties() in
> > createEndpoint() ? and so on...
> >   If you have not used an archetype yet, then I would direct you
> > back to Omar Al-Safi suggestion: Scaffolding your component through
> > maven archetype
> https://camel.apache.org/manual/latest/camel-maven-archetypes.html.
> >   You'll then have a proper layout to start on then.
> >
> > Alex
> >
> >
> > On Tue, Sep 17, 2019 at 12:49 PM <[hidden email]> wrote:
> >
> > > Hi,
> > >
> > > thanks so far. I didn’t know that I had to explicitely create a
> > Component.
> > > The direct example helped a lot.
> > > But there is this contruct, and it will not work with my code.
> > > name is not set. (it has getter and setter)
> > >
> > > I want that name is "thomas" when route-def is like
> > >
> > > to("monitoring:thomas")
> > >
> > > @UriEndpoint(scheme = "monitoring", title = "monitoring",
> > > syntax="monitoring:name", label = "Monitoring") public class
> > > MonitorEndpoint extends DefaultEndpoint {
> > >   @UriPath
> > >   @Metadata(required = true)
> > >   private String name;
> > >
> > >   public MonitorEndpoint() {
> > >   }
> > >
> > >   public MonitorEndpoint(final String endpointUri, final Component
> > > component) {
> > >     super(endpointUri, component);
> > >   }
> > >
> > >   @Override
> > >   public Consumer createConsumer(Processor processor) throws
> > > Exception
> {
> > >     // TODO Auto-generated method stub
> > >     return null;
> > >   }
> > >
> > >
> > >
> > >
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Omar Al-Safi <[hidden email]>
> > > Gesendet: Montag, 16. September 2019 13:05
> > > An: [hidden email]
> > > Betreff: Re: own endpoint exmaple?
> > >
> > > I see, yeah we will need to fix this. By the way, you can start
> > > scaffolding your component through maven archetype,
> > > https://camel.apache.org/manual/latest/camel-maven-archetypes.html
> > > , as I recall, it will also add the necessary files to enable
> > > camel auto discovery out of the box
> > >
> > > On Mon, 16 Sep 2019 at 13:01, Alex Dettinger
> > > <[hidden email]>
> > > wrote:
> > >
> > > > Also, the source code of the direct component could be a good
> > > > starter to get inspiration:
> > > >
> > > > https://github.com/apache/camel/tree/master/components/camel-dir
> > > > ec t/ sr c/main/java/org/apache/camel/component/direct
> > > >
> > > > Alex
> > > >
> > > > On Mon, Sep 16, 2019 at 12:57 PM Steve Huston
> > > > <[hidden email]>
> > > > wrote:
> > > >
> > > > > Is it possible that Spring is not finding your endpoint class?
> > > > >
> > > > > -Steve
> > > > >
> > > > > On 9/16/19, 6:55 AM, "[hidden email]" <
> > > > [hidden email]>
> > > > > wrote:
> > > > >
> > > > >     Hi Alex,
> > > > >
> > > > >     1. I found this webpage but the links (e.g.
> > > > > createProducer()) goes to "page not found".
> > > > >
> > > > >     2. Stupid question: how and where to do this?
> > > > >
> > > > >     -----Ursprüngliche Nachricht-----
> > > > >     Von: Alex Dettinger <[hidden email]>
> > > > >     Gesendet: Montag, 16. September 2019 12:52
> > > > >     An: [hidden email]
> > > > >     Betreff: Re: own endpoint exmaple?
> > > > >
> > > > >     Hi Thomas,
> > > > >
> > > > >       This link might be of interest:
> > > > >
> > > > > https://camel.apache.org/manual/latest/writing-components.html
> > > > >
> > > > >       In your case, I wonder if you missed to create the
> > > > > thomas component first.
> > > > >
> > > > >     hth,
> > > > >     Alex
> > > > >
> > > > >     On Mon, Sep 16, 2019 at 12:44 PM
> > > > > <[hidden email]>
> > wrote:
> > > > >
> > > > >     > Hi,
> > > > >     >
> > > > >     > can some point me to a working example where an own
> > > > > endpoint was created.
> > > > >     >
> > > > >     > In route I say:
> > > > >     >
> > > > >     > .to("thomas://foo")
> > > > >     >
> > > > >     > my Endpoint is
> > > > >     >
> > > > >     > @Component
> > > > >     > @UriEndpoint(scheme = "thomas", title = "Thiele",
> > > > >     > syntax="thomas:name", label = "Thomas") public class
> ThomasStep
> > > > >     > extends DefaultEndpoint {}
> > > > >     >
> > > > >     > But I get.
> > > > >     >
> > > > >     > thomas://name due to: No component found with scheme: thomas
> > > > >     >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>