FW: Spring Camel "Parent" Context

2014-12-08 Thread Justin Rosenberg
I have many (over 100) projects that all include a core Spring project where 
ActiveMQ is configured.  Currently each project defines its own camel context 
as such:





I would like to change some parameters in the way the camel context is defined. 
 I could simply put the context in the common project, however the ID would not 
match the ID of the sub-project.  Therefore I would like to do something like 
the following:

In the common project:





In each individual project



Since "camel:camelContext" is just short-hand for Spring Configuration.  Could 
someone help me understand what the traditional Spring equivalent would be for:





Thank you,

Justin
 

CONFIDENTIALITY NOTICE:
The information in this message, and any attachment, is intended for the 
sole use of the individual and entity to whom it is addressed. This 
information may be privileged, confidential, and protected from 
disclosure. If you are not the intended recipient you are hereby notified 
that you have received this communication in error and that any review, 
disclosure, dissemination, distribution or copying of it, or its contents, 
is strictly prohibited. If you think that you have received this message 
in error please notify the sender and destroy all copies of this 
communication and any attachments. Thank you.


Re: FW: Spring Camel "Parent" Context

2014-12-08 Thread JustinCRL
I believe I have figured it out. 

The equivalent of: 
  

  


Is: 

  
  
  

  


If I am wrong please let me know.  Also if someone could explain where I can
see the translation of http://camel.apache.org/schema/spring tags to
classes, I would be grateful.  Useful knowledge for me to know in the
future.



--
View this message in context: 
http://camel.465427.n5.nabble.com/FW-Spring-Camel-Parent-Context-tp5760339p5760344.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FW: Spring Camel "Parent" Context

2014-12-08 Thread JustinCRL
Actually the context didn't start.  I'll update here once I figure it out. 
In the meantime, any help is appreciated.



--
View this message in context: 
http://camel.465427.n5.nabble.com/FW-Spring-Camel-Parent-Context-tp5760339p5760345.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FW: Spring Camel "Parent" Context

2014-12-08 Thread JustinCRL
There is a spring.handlers file in META-INF that references
org.apache.camel.spring.handler.CamelNamespaceHandler.  This is the link
between the Spring Tag and the construction on the implementation classes. 
However, I'm still missing a step in the definition that will cause the
Context to start when Spring Context loads.



--
View this message in context: 
http://camel.465427.n5.nabble.com/FW-Spring-Camel-Parent-Context-tp5760339p5760346.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FW: Spring Camel "Parent" Context

2014-12-08 Thread JustinCRL
I got farther with this.









.*






However, my org.apache.camel.spring.SpringRouteBuilder is
org.apache.camel.CamelContextAware and the context is not being set on it. 
There is obviously a bit of *magic* involved in getting 
to work.  I will either have to live with copying the configuration for all
of my projects, or have a single configuration with a single name.  I might
put in a feature request to support "abstract" and "parent" references.  If
I do, I'll add the link to the JIRA here.



--
View this message in context: 
http://camel.465427.n5.nabble.com/FW-Spring-Camel-Parent-Context-tp5760339p5760347.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FW: Spring Camel "Parent" Context

2014-12-09 Thread rosenbergj
I believe I have figured it out.

The equivalent of:
 
   
 


Is:








If I am wrong please let me know.  Also if someone could explain where I can
see the translation of http://camel.apache.org/schema/spring tags to
classes, I would be grateful.  Useful knowledge for me to know in the
future. 



--
View this message in context: 
http://camel.465427.n5.nabble.com/FW-Spring-Camel-Parent-Context-tp5760339p5760343.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FW: Spring Camel "Parent" Context

2014-12-09 Thread Willem Jiang
I think the magic is happened in side of camel spring post processor which 
inject the camel context to CamelContextAware interface. If you use 
CamelContextFactoryBean directly, it won’t setup the post processor for you out 
of box.

Please feel free to fill a JIRA for adding support of parent and abstraction. 

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On December 9, 2014 at 9:35:49 AM, JustinCRL (justin.rosenb...@crlcorp.com) 
wrote:
> I got farther with this.
>  
> > class="org.apache.camel.spring.CamelContextFactoryBean">
>  
>  
>  
>  
>  
>  
>  
> .*
>  
>  
>  
>  
>  
>  
> However, my org.apache.camel.spring.SpringRouteBuilder is
> org.apache.camel.CamelContextAware and the context is not being set on it.
> There is obviously a bit of *magic* involved in getting  
> to work. I will either have to live with copying the configuration for all
> of my projects, or have a single configuration with a single name. I might
> put in a feature request to support "abstract" and "parent" references. If
> I do, I'll add the link to the JIRA here.
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/FW-Spring-Camel-Parent-Context-tp5760339p5760347.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: FW: Spring Camel "Parent" Context

2014-12-15 Thread JustinCRL
Looks like a JIRA had already been created.  Claus wasn't a big fan of the
change.

https://issues.apache.org/jira/browse/CAMEL-5858

I might try to create a patch and see if there will still be resistance.  I
can't imagine I'm the only one with a use case of centralized CamelContext
configuration, but wanting to customize on a per actual context
implementation.  Specifically setting unique ID's can help with logging and
JMX management.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Spring-Camel-Parent-Context-tp5760366p5760715.html
Sent from the Camel - Users mailing list archive at Nabble.com.