AW: own endpoint exmaple?
Thanks. Will look at it. -Ursprüngliche Nachricht- Von: Condello, Giovanni Gesendet: Donnerstag, 19. September 2019 13:55 An: users@camel.apache.org 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 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 > Gesendet: Donnerstag, 19. September 2019 13:28 > An: users@camel.apache.org > 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 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 > > Gesendet: Donnerstag, 19. September 2019 10:20 > > An: users@camel.apache.org > > 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 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 > > > Gesendet: Montag, 16. September 2019 13:05 > > > An: users@camel.apache.org > > > 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 > > > > > > 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 > > > > > > > > wrote: > > > > > > > > > Is it possible that Spring is not finding your endpoint class? > > > > > > > > > > -Steve > > > > > > > > > > On 9/16/19, 6:55 AM, "thomas.thi...@telekom.de" < > > > > thomas.thi...@telekom.de> > > > > > 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 > > > > > Gesendet: Montag, 16.
AW: own endpoint exmaple?
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 Gesendet: Donnerstag, 19. September 2019 13:28 An: users@camel.apache.org 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 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 > Gesendet: Donnerstag, 19. September 2019 10:20 > An: users@camel.apache.org > 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 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 > > Gesendet: Montag, 16. September 2019 13:05 > > An: users@camel.apache.org > > 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 > > 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 > > > > > > wrote: > > > > > > > Is it possible that Spring is not finding your endpoint class? > > > > > > > > -Steve > > > > > > > > On 9/16/19, 6:55 AM, "thomas.thi...@telekom.de" < > > > thomas.thi...@telekom.de> > > > > 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 > > > > Gesendet: Montag, 16. September 2019 12:52 > > > > An: users@camel.apache.org > > > > 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 > 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. > > > > > > > > > >
AW: own endpoint exmaple?
"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 Gesendet: Donnerstag, 19. September 2019 10:20 An: users@camel.apache.org 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 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 > Gesendet: Montag, 16. September 2019 13:05 > An: users@camel.apache.org > 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 > 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 > > wrote: > > > > > Is it possible that Spring is not finding your endpoint class? > > > > > > -Steve > > > > > > On 9/16/19, 6:55 AM, "thomas.thi...@telekom.de" < > > thomas.thi...@telekom.de> > > > 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 > > > Gesendet: Montag, 16. September 2019 12:52 > > > An: users@camel.apache.org > > > 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 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 > > > > > > > > > > > > > > > >
AW: own endpoint exmaple?
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 Gesendet: Montag, 16. September 2019 13:05 An: users@camel.apache.org 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 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 > wrote: > > > Is it possible that Spring is not finding your endpoint class? > > > > -Steve > > > > On 9/16/19, 6:55 AM, "thomas.thi...@telekom.de" < > thomas.thi...@telekom.de> > > 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 > > Gesendet: Montag, 16. September 2019 12:52 > > An: users@camel.apache.org > > 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 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 > > > > > > > > > >
AW: own endpoint exmaple?
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 Gesendet: Montag, 16. September 2019 12:57 An: users@camel.apache.org 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, 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 >
AW: own endpoint exmaple?
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 Gesendet: Montag, 16. September 2019 12:52 An: users@camel.apache.org 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 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 >