You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mick Knutson <mk...@baselogic.com> on 2008/09/25 22:49:45 UTC
Question about routing using a Processor from Spring/Camel
I have the following route:
from(Constants.REQUEST_INPUT_CHANNEL).errorHandler(
deadLetterChannel(Constants.REQUEST_INPUT_ERROR_CHANNEL)
//.maximumRedeliveries(2)
//.initialRedeliveryDelay(1)
.loggingLevel(LoggingLevel.INFO)
).process*(new ChangeRequestControllerImpl())*
.to(Constants.REQUEST_OUTPUT_CHANNEL);
}
My changeRequestInputExceptionProcessor is already in my camel-context.xml
so how do I get access to it in my route verse creating a *new
ChangeRequestControllerImpl() *?
--
---
Thank You…
Mick Knutson
BASE Logic, inc.
(415) 354-4215
Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com
Re: Question about routing using a Processor from Spring/Camel
Posted by Jon Anstey <ja...@gmail.com>.
Assuming you've defined your processor like
<bean id="changeRequestInputExceptionProcessor"
class="com.mycompany.ChangeRequestControllerImpl"/>
You can reference it by using
processRef("changeRequestInputExceptionProcessor")
On Thu, Sep 25, 2008 at 6:19 PM, Mick Knutson <mk...@baselogic.com>wrote:
> I have the following route:
>
> from(Constants.REQUEST_INPUT_CHANNEL).errorHandler(
> deadLetterChannel(Constants.REQUEST_INPUT_ERROR_CHANNEL)
> //.maximumRedeliveries(2)
> //.initialRedeliveryDelay(1)
> .loggingLevel(LoggingLevel.INFO)
> ).process*(new ChangeRequestControllerImpl())*
> .to(Constants.REQUEST_OUTPUT_CHANNEL);
>
> }
>
> My changeRequestInputExceptionProcessor is already in my camel-context.xml
> so how do I get access to it in my route verse creating a *new
> ChangeRequestControllerImpl() *?
>
>
>
>
> --
> ---
> Thank You…
>
> Mick Knutson
> BASE Logic, inc.
> (415) 354-4215
>
> Website: http://baselogic.com
> Blog: http://baselogic.com/blog
> BLiNC Magazine: http://blincmagazine.com
> Linked IN: http://linkedin.com/in/mickknutson
> DJ Mick: http://djmick.com
> MySpace: http://myspace.com/mickknutson
> Vacation Rental: http://tahoe.baselogic.com
>
--
Cheers,
Jon
http://janstey.blogspot.com/
RE: Question about routing using a Processor from Spring/Camel
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Ah sorry
We have both a beanRef and a processRef. Well I was to jumpy. Let's keep 'em as is.
However we could consider having bean and process accepts a String ref option and not have the xxRef builders.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Claus Ibsen [mailto:ci@silverbullet.dk]
Sent: 26. september 2008 11:25
To: camel-user@activemq.apache.org
Subject: RE: Question about routing using a Processor from Spring/Camel
Hi
Ah the processRef can be used.
Jonathan and other riders:
Maybe we should let the process builder be smarter and have it just as .process()= overloaded that accepts
process(Processor processor)
process(String ref)
process(Class type)
I don't like processRef. We don't have a beanRef etc.
So I think we should @deprecate processRef and create a process(String ref) instead. And consider adding a 3rd that takes a .class and tries to instantiate it and invoke the process method, if possible.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Claus Ibsen [mailto:ci@silverbullet.dk]
Sent: 26. september 2008 11:16
To: camel-user@activemq.apache.org
Subject: RE: Question about routing using a Processor from Spring/Camel
Hi
Use bean instead:
).bean("mySpringBeanId")
AFAIR we don't have a process that accepts a reference to an existing implementation to be looked up in the registry (= usually spring xml)
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Mick Knutson [mailto:mknutson@baselogic.com]
Sent: 25. september 2008 22:50
To: Camel
Subject: Question about routing using a Processor from Spring/Camel
I have the following route:
from(Constants.REQUEST_INPUT_CHANNEL).errorHandler(
deadLetterChannel(Constants.REQUEST_INPUT_ERROR_CHANNEL)
//.maximumRedeliveries(2)
//.initialRedeliveryDelay(1)
.loggingLevel(LoggingLevel.INFO)
).process*(new ChangeRequestControllerImpl())*
.to(Constants.REQUEST_OUTPUT_CHANNEL);
}
My changeRequestInputExceptionProcessor is already in my camel-context.xml
so how do I get access to it in my route verse creating a *new
ChangeRequestControllerImpl() *?
--
---
Thank You...
Mick Knutson
BASE Logic, inc.
(415) 354-4215
Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com
RE: Question about routing using a Processor from Spring/Camel
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi
Ah the processRef can be used.
Jonathan and other riders:
Maybe we should let the process builder be smarter and have it just as .process()= overloaded that accepts
process(Processor processor)
process(String ref)
process(Class type)
I don't like processRef. We don't have a beanRef etc.
So I think we should @deprecate processRef and create a process(String ref) instead. And consider adding a 3rd that takes a .class and tries to instantiate it and invoke the process method, if possible.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Claus Ibsen [mailto:ci@silverbullet.dk]
Sent: 26. september 2008 11:16
To: camel-user@activemq.apache.org
Subject: RE: Question about routing using a Processor from Spring/Camel
Hi
Use bean instead:
).bean("mySpringBeanId")
AFAIR we don't have a process that accepts a reference to an existing implementation to be looked up in the registry (= usually spring xml)
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Mick Knutson [mailto:mknutson@baselogic.com]
Sent: 25. september 2008 22:50
To: Camel
Subject: Question about routing using a Processor from Spring/Camel
I have the following route:
from(Constants.REQUEST_INPUT_CHANNEL).errorHandler(
deadLetterChannel(Constants.REQUEST_INPUT_ERROR_CHANNEL)
//.maximumRedeliveries(2)
//.initialRedeliveryDelay(1)
.loggingLevel(LoggingLevel.INFO)
).process*(new ChangeRequestControllerImpl())*
.to(Constants.REQUEST_OUTPUT_CHANNEL);
}
My changeRequestInputExceptionProcessor is already in my camel-context.xml
so how do I get access to it in my route verse creating a *new
ChangeRequestControllerImpl() *?
--
---
Thank You...
Mick Knutson
BASE Logic, inc.
(415) 354-4215
Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com
RE: Question about routing using a Processor from Spring/Camel
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi
Use bean instead:
).bean("mySpringBeanId")
AFAIR we don't have a process that accepts a reference to an existing implementation to be looked up in the registry (= usually spring xml)
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Mick Knutson [mailto:mknutson@baselogic.com]
Sent: 25. september 2008 22:50
To: Camel
Subject: Question about routing using a Processor from Spring/Camel
I have the following route:
from(Constants.REQUEST_INPUT_CHANNEL).errorHandler(
deadLetterChannel(Constants.REQUEST_INPUT_ERROR_CHANNEL)
//.maximumRedeliveries(2)
//.initialRedeliveryDelay(1)
.loggingLevel(LoggingLevel.INFO)
).process*(new ChangeRequestControllerImpl())*
.to(Constants.REQUEST_OUTPUT_CHANNEL);
}
My changeRequestInputExceptionProcessor is already in my camel-context.xml
so how do I get access to it in my route verse creating a *new
ChangeRequestControllerImpl() *?
--
---
Thank You...
Mick Knutson
BASE Logic, inc.
(415) 354-4215
Website: http://baselogic.com
Blog: http://baselogic.com/blog
BLiNC Magazine: http://blincmagazine.com
Linked IN: http://linkedin.com/in/mickknutson
DJ Mick: http://djmick.com
MySpace: http://myspace.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com