You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Johan Haleby <jo...@gmail.com> on 2010/01/12 19:16:22 UTC

Workaround for PropertyPlaceholderConfigurer and packageScan?

Hi,

I've read the FAQ and I understand that I cannot use the placeholders in
inside the Camel XML in a spring configuration. However I've seen
workarounds for uri's by defining endpoints outside of the camel context xml
configuration and referring to these from the inside. Is there a similar
approach for the defining package scan path (without reverting to the old
Spring way of configuring things as demonstrated in 
http://issues.apache.org/activemq/browse/CAMEL-1997 CAMEL-1997 )? 

/Johan
-- 
View this message in context: http://old.nabble.com/Workaround-for-PropertyPlaceholderConfigurer-and-packageScan--tp27131146p27131146.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Workaround for PropertyPlaceholderConfigurer and packageScan?

Posted by Johan Haleby <jo...@gmail.com>.
I've added jira ticket  https://issues.apache.org/activemq/browse/CAMEL-2358
2358 . Thanks!


Claus Ibsen-2 wrote:
> 
> Hi
> 
> On Tue, Jan 12, 2010 at 7:16 PM, Johan Haleby <jo...@gmail.com>
> wrote:
>>
>> Hi,
>>
>> I've read the FAQ and I understand that I cannot use the placeholders in
>> inside the Camel XML in a spring configuration. However I've seen
>> workarounds for uri's by defining endpoints outside of the camel context
>> xml
>> configuration and referring to these from the inside. Is there a similar
>> approach for the defining package scan path (without reverting to the old
>> Spring way of configuring things as demonstrated in
>> http://issues.apache.org/activemq/browse/CAMEL-1997 CAMEL-1997 )?
>>
> 
> Yeah I think package and packageScan (which can do ANT based
> filtering) is currently inlined within camel:context.
> 
> Since <camel:endpoint> do support property placeholders maybe we can
> get the package and packageScan to do the same.
> 
> Can you create a JIRA ticket and put up a minor example, then we can
> use that to track down a solution?
> 
> 
> 
>> /Johan
>> --
>> View this message in context:
>> http://old.nabble.com/Workaround-for-PropertyPlaceholderConfigurer-and-packageScan--tp27131146p27131146.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/Workaround-for-PropertyPlaceholderConfigurer-and-packageScan--tp27131146p27148806.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to Understand InOnly and InOut pattern

Posted by ext2 <xu...@tongtech.com>.
While learning camel's pattern, it seems the in only patter is very hard to
understand;

Following is a test-case from the camel's unit test( with a little change).
inProcess bean just increase the input message body(as Integer) and set back
to input message. outProcess bean just increase the input message and set
result to output; 

1) following route if using in-out pattern is easy to understand, if I send
a input message number=1, and returned message-exchange's input is 1, output
is 3;
from("direct:a").process(outProcessor).process(outProcessor).to("mock:resul"
);
but using in-only pattern, result message-exchange's input is 3, output is
2. the input is 3, we can understand as if processor doesn't return output,
the input will act as next processor's input, so input is equal 3. but how
to under-stand the output is 2? I think it should be null;

2) following route if using inonly  pattern is easy to understand, if I send
a input message whose body is 1, the result is : in-message is 3,
out-message is null;
from("direct:a").process(inProcessor).process(inProcessor).to("mock:resul");

but if I using in-out pattern, it's hard to understand. The result is
in-message is 2, output-message is 3; how to understand the input-message is
2, I think it should be 1;

Finally what is the real-rule for camel's MEP? Does it means if I use
in-only MEP, the processor should only affect in-message, output message
affect will be unpredictable, and so one for in-out MEP?


final Processor inProcessor = new Processor() { 
            public void process(Exchange exchange) {
                Integer number = exchange.getIn().getBody(Integer.class);
                number = number + 1;
                exchange.getIn().setBody(number);
            }
        };

final Processor outProcessor = new Processor() {
	public void process(Exchange exchange) {
         Integer number = exchange.getIn().getBody(Integer.class);
        number = number + 1;
        exchange.getOut().setBody(number);
     }
};



Re: Workaround for PropertyPlaceholderConfigurer and packageScan?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

On Tue, Jan 12, 2010 at 7:16 PM, Johan Haleby <jo...@gmail.com> wrote:
>
> Hi,
>
> I've read the FAQ and I understand that I cannot use the placeholders in
> inside the Camel XML in a spring configuration. However I've seen
> workarounds for uri's by defining endpoints outside of the camel context xml
> configuration and referring to these from the inside. Is there a similar
> approach for the defining package scan path (without reverting to the old
> Spring way of configuring things as demonstrated in
> http://issues.apache.org/activemq/browse/CAMEL-1997 CAMEL-1997 )?
>

Yeah I think package and packageScan (which can do ANT based
filtering) is currently inlined within camel:context.

Since <camel:endpoint> do support property placeholders maybe we can
get the package and packageScan to do the same.

Can you create a JIRA ticket and put up a minor example, then we can
use that to track down a solution?



> /Johan
> --
> View this message in context: http://old.nabble.com/Workaround-for-PropertyPlaceholderConfigurer-and-packageScan--tp27131146p27131146.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus