Re: Using shared Netty configuration with Rest DSL

2015-07-31 Thread arnaudeprez
Hi Claus,

I confirm there is a glitch here when we use componentProperty instead of
endpointProperty for netty4-http component.
I suppose it's more related to the new rest dsl than the component itself.

I'm not able to find an issue for that. Is that taken into account ? 
Otherwise I can log a new issue for that.

Rgds,

A.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-shared-Netty-configuration-with-Rest-DSL-tp5767400p5770147.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using shared Netty configuration with Rest DSL

2015-05-26 Thread Claus Ibsen
Hi

Ah maybe there is a glitch configuring those on the component level?

You are welcome to log a JIRA so we wont forget. On the component
level makes it configurable once for end users, when they eg use it
with regular Camel routes, and not as much the rest-dsl.


On Fri, May 22, 2015 at 2:47 PM, Alex Soto alex.s...@envieta.com wrote:
 It is working now.  Thanks!

 Best regards,
 Alex soto

 On May 22, 2015, at 3:53 AM, Willem Jiang willem.ji...@gmail.com wrote:

 You can setup the endpoint property just like this

 restConfiguration component=netty4-http” 
 camel:componentProperty key=“configuration value=#configuration/
 camel:endpointProperty key=“nettySharedHttpServer 
 value=#sharedNettyHttpServer/
 camel:endpointProperty key=“securityConfiguration 
 value=“#securityConfiguration/
 /restConfiguration

 BTW, you need to create the securityConfiguration yourself.



 --
 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 May 22, 2015 at 3:06:20 AM, Alex Soto (alex.s...@envieta.com) wrote:
 I would like to reuse the same Netty Service that is configured outside of 
 the Rest DSL.
 For example I have the Netty and SSL configuration:




 type=JKS provider=SUN/


 type=JKS provider=SUN/











 init-method=start destroy-method=stop




 Now in my Camel Context I declare the Rest DSL:























 However, it does not seem to be picking up the shared configuration. Log 
 file shows:

 BootstrapFactory on port 0 is using bootstrap configuration: 
 [NettyServerBootstrapConfiguration{protocol='tcp',
 host=‘X.local', port=0, broadcast=false, sendBufferSize=65536, 
 receiveBufferSize=65536,
 receiveBufferSizePredictor=0, workerCount=0, bossCount=1, keepAlive=true, 
 tcpNoDelay=true,
 reuseAddress=true, connectTimeout=1, backlog=0, 
 serverInitializerFactory=org.apache.camel.component.netty4.http.HttpServerInitializerFactory@2db0d008,
 nettyServerBootstrapFactory=null, options=null, ssl=false, sslHandler=null,
 sslContextParameters='null', needClientAuth=false, 
 enabledProtocols='TLSv1,TLSv1.1,TLSv1.2,
 keyStoreFile=null, trustStoreFile=null, keyStoreResource='null', 
 trustStoreResource='null',
 keyStoreFormat='JKS', securityProvider='SunX509', passphrase='null', 
 bossGroup=null,
 workerGroup=null, networkInterface='null’}]

 I could not find any examples of how to accomplish this. Any hints?

 Best regards,
 Alex soto





-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Using shared Netty configuration with Rest DSL

2015-05-26 Thread Claus Ibsen
Hi

componentProperty is for setting options on the component level.

It becomes clearer in the future when the component docs is auto
generated based on the source code, so all options is listed and up to
date. Today its a manual process in wiki for the docs.



On Tue, May 26, 2015 at 2:34 PM, Alex Soto alex.s...@envieta.com wrote:
 Hi,

 It appears to be working with the following:

 !—
 SSL configuration Notice we read the certificate file from 
 the user
 home directory. {{env:HOME}} is expanded to the current 
 user's home directory.
  --
 camel:sslContextParameters id=sslParams
 camel:keyManagers keyPassword=changeit
 camel:keyStore resource={{env:HOME}}/localhost.jks
 password=changeit type=JKS provider=SUN 
 /
 /camel:keyManagers
 camel:trustManagers
 camel:keyStore resource={{env:HOME}}/localhost.jks
 password=changeit type=JKS provider=SUN 
 /
 /camel:trustManagers
 /camel:sslContextParameters

 !-- Netty's HTTP bootstrap configuration --
 bean id=configuration 
 class=org.apache.camel.component.netty4.http.NettySharedHttpServerBootstrapConfiguration
 property name=port value=8890 /
 property name=host value=0.0.0.0 /
 property name=backlog value=50 /
 property name=sslContextParameters ref=sslParams /
 property name=ssl value=true /
 /bean

 !-- Netty HTTP server, which can be shared between multiple routes 
 --
 bean id=sharedNettyHttpServer
 
 class=org.apache.camel.component.netty4.http.DefaultNettySharedHttpServer
 init-method=start
 destroy-method=stop

 property name=nettyServerBootstrapConfiguration 
 ref=configuration /
 /bean

 camelContext xmlns=http://camel.apache.org/schema/spring;
 restConfiguration component=netty4-http 
 endpointProperty key=nettySharedHttpServer 
 value=#sharedNettyHttpServer /
 /restConfiguration

 !-- REST Service Definition --
 rest path=/visitor/
 get uri=/
 camel:descriptionReturn list of known 
 visitors/camel:description
 to uri=direct:list /
 /get
 /rest
 …


 However, it is not clear from the documentation the difference between 
 “componentProperty”  and “endpointProperty” and when to use each, so please 
 let me know if I am misusing this in any way.

 Best regards,
 Alex soto

 On May 26, 2015, at 5:42 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi

 Ah maybe there is a glitch configuring those on the component level?

 You are welcome to log a JIRA so we wont forget. On the component
 level makes it configurable once for end users, when they eg use it
 with regular Camel routes, and not as much the rest-dsl.


 On Fri, May 22, 2015 at 2:47 PM, Alex Soto alex.s...@envieta.com wrote:
 It is working now.  Thanks!

 Best regards,
 Alex soto

 On May 22, 2015, at 3:53 AM, Willem Jiang willem.ji...@gmail.com wrote:

 You can setup the endpoint property just like this

 restConfiguration component=netty4-http” 
 camel:componentProperty key=“configuration value=#configuration/
 camel:endpointProperty key=“nettySharedHttpServer 
 value=#sharedNettyHttpServer/
 camel:endpointProperty key=“securityConfiguration 
 value=“#securityConfiguration/
 /restConfiguration

 BTW, you need to create the securityConfiguration yourself.



 --
 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 May 22, 2015 at 3:06:20 AM, Alex Soto (alex.s...@envieta.com) wrote:
 I would like to reuse the same Netty Service that is configured outside 
 of the Rest DSL.
 For example I have the Netty and SSL configuration:




 type=JKS provider=SUN/


 type=JKS provider=SUN/











 init-method=start destroy-method=stop




 Now in my Camel Context I declare the Rest DSL:























 However, it does not seem to be picking up the shared configuration. Log 
 file shows:

 BootstrapFactory on port 0 is using bootstrap configuration: 
 [NettyServerBootstrapConfiguration{protocol='tcp',
 host=‘X.local', port=0, broadcast=false, sendBufferSize=65536, 
 receiveBufferSize=65536,
 receiveBufferSizePredictor=0, workerCount=0, bossCount=1, keepAlive=true, 
 tcpNoDelay=true,
 reuseAddress=true, connectTimeout=1, backlog=0, 
 serverInitializerFactory=org.apache.camel.component.netty4.http.HttpServerInitializerFactory@2db0d008,
 nettyServerBootstrapFactory=null, options=null, ssl=false, 

Re: Using shared Netty configuration with Rest DSL

2015-05-22 Thread Willem Jiang
You can setup the endpoint property just like this

restConfiguration component=netty4-http” 
camel:componentProperty key=“configuration value=#configuration/ 
camel:endpointProperty key=“nettySharedHttpServer 
value=#sharedNettyHttpServer/
camel:endpointProperty key=“securityConfiguration 
value=“#securityConfiguration/ 
/restConfiguration 

BTW, you need to create the securityConfiguration yourself.



--  
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 May 22, 2015 at 3:06:20 AM, Alex Soto (alex.s...@envieta.com) wrote:
 I would like to reuse the same Netty Service that is configured outside of 
 the Rest DSL.  
 For example I have the Netty and SSL configuration:
  
  
  
  
  type=JKS provider=SUN/
  
  
  type=JKS provider=SUN/
  
  
  
  
  
  
  
  
  
  
  
  init-method=start destroy-method=stop
  
  
  
  
 Now in my Camel Context I declare the Rest DSL:
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 However, it does not seem to be picking up the shared configuration. Log file 
 shows:
  
 BootstrapFactory on port 0 is using bootstrap configuration: 
 [NettyServerBootstrapConfiguration{protocol='tcp',  
 host=‘X.local', port=0, broadcast=false, sendBufferSize=65536, 
 receiveBufferSize=65536,  
 receiveBufferSizePredictor=0, workerCount=0, bossCount=1, keepAlive=true, 
 tcpNoDelay=true,  
 reuseAddress=true, connectTimeout=1, backlog=0, 
 serverInitializerFactory=org.apache.camel.component.netty4.http.HttpServerInitializerFactory@2db0d008,
   
 nettyServerBootstrapFactory=null, options=null, ssl=false, sslHandler=null,  
 sslContextParameters='null', needClientAuth=false, 
 enabledProtocols='TLSv1,TLSv1.1,TLSv1.2,  
 keyStoreFile=null, trustStoreFile=null, keyStoreResource='null', 
 trustStoreResource='null',  
 keyStoreFormat='JKS', securityProvider='SunX509', passphrase='null', 
 bossGroup=null,  
 workerGroup=null, networkInterface='null’}]
  
 I could not find any examples of how to accomplish this. Any hints?
  
 Best regards,
 Alex soto



Re: Using shared Netty configuration with Rest DSL

2015-05-22 Thread Alex Soto
It is working now.  Thanks!

Best regards,
Alex soto

 On May 22, 2015, at 3:53 AM, Willem Jiang willem.ji...@gmail.com wrote:
 
 You can setup the endpoint property just like this
 
 restConfiguration component=netty4-http” 
 camel:componentProperty key=“configuration value=#configuration/ 
 camel:endpointProperty key=“nettySharedHttpServer 
 value=#sharedNettyHttpServer/
 camel:endpointProperty key=“securityConfiguration 
 value=“#securityConfiguration/ 
 /restConfiguration 
 
 BTW, you need to create the securityConfiguration yourself.
 
 
 
 --  
 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 May 22, 2015 at 3:06:20 AM, Alex Soto (alex.s...@envieta.com) wrote:
 I would like to reuse the same Netty Service that is configured outside of 
 the Rest DSL.  
 For example I have the Netty and SSL configuration:
 
 
 
 
 type=JKS provider=SUN/
 
 
 type=JKS provider=SUN/
 
 
 
 
 
 
 
 
 
 
 
 init-method=start destroy-method=stop
 
 
 
 
 Now in my Camel Context I declare the Rest DSL:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 However, it does not seem to be picking up the shared configuration. Log 
 file shows:
 
 BootstrapFactory on port 0 is using bootstrap configuration: 
 [NettyServerBootstrapConfiguration{protocol='tcp',  
 host=‘X.local', port=0, broadcast=false, sendBufferSize=65536, 
 receiveBufferSize=65536,  
 receiveBufferSizePredictor=0, workerCount=0, bossCount=1, keepAlive=true, 
 tcpNoDelay=true,  
 reuseAddress=true, connectTimeout=1, backlog=0, 
 serverInitializerFactory=org.apache.camel.component.netty4.http.HttpServerInitializerFactory@2db0d008,
   
 nettyServerBootstrapFactory=null, options=null, ssl=false, sslHandler=null,  
 sslContextParameters='null', needClientAuth=false, 
 enabledProtocols='TLSv1,TLSv1.1,TLSv1.2,  
 keyStoreFile=null, trustStoreFile=null, keyStoreResource='null', 
 trustStoreResource='null',  
 keyStoreFormat='JKS', securityProvider='SunX509', passphrase='null', 
 bossGroup=null,  
 workerGroup=null, networkInterface='null’}]
 
 I could not find any examples of how to accomplish this. Any hints?
 
 Best regards,
 Alex soto
 



Using shared Netty configuration with Rest DSL

2015-05-21 Thread Alex Soto
I would like to reuse the same Netty Service that is configured outside of the 
Rest DSL.  For example I have the Netty and SSL configuration:


camel:sslContextParameters id=sslParams
 camel:keyManagers keyPassword=changeit
   camel:keyStore resource={{env:HOME}}/localhost.jks password=changeit 
type=JKS provider=SUN/
 /camel:keyManagers
 camel:trustManagers
   camel:keyStore resource={{env:HOME}}/localhost.jks password=changeit 
type=JKS provider=SUN/
 /camel:trustManagers
/camel:sslContextParameters

bean id=configuration 
class=org.apache.camel.component.netty4.http.NettySharedHttpServerBootstrapConfiguration
   property name=port value=8890/
   property name=host value=0.0.0.0/
   property name=backlog value=50/
   property name=sslContextParameters ref=sslParams/
   property name=ssl value=true/
/bean

bean id=sharedNettyHttpServer 
class=org.apache.camel.component.netty4.http.DefaultNettySharedHttpServer 
init-method=start destroy-method=stop
   property name=nettyServerBootstrapConfiguration ref=configuration/
/bean


Now in my Camel Context I declare the Rest DSL:


camelContext id=camel-context-name trace=true 
xmlns=http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring

 restConfiguration component=netty4-http  
  camel:componentProperty key=nettySharedHttpServer 
value=#sharedNettyHttpServer/
  componentProperty key=nettyServerBootstrapConfiguration 
value=#configuration/
  camel:endpointProperty key=nettyServerBootstrapConfiguration 
value=#configuration/
 /restConfiguration
  
 rest path=/customers/
get uri=/{id}
to uri=direct:getCustomers/
/get
get uri=/{id}/orders
to uri=direct:getCustomerOrders/
/get
post uri=/neworder
to uri=direct:newOrder/
/post
/rest


However, it does not seem to be picking up the shared configuration.  Log file 
shows:

BootstrapFactory on port 0 is using bootstrap configuration: 
[NettyServerBootstrapConfiguration{protocol='tcp', host=‘X.local', port=0, 
broadcast=false, sendBufferSize=65536, receiveBufferSize=65536, 
receiveBufferSizePredictor=0, workerCount=0, bossCount=1, keepAlive=true, 
tcpNoDelay=true, reuseAddress=true, connectTimeout=1, backlog=0, 
serverInitializerFactory=org.apache.camel.component.netty4.http.HttpServerInitializerFactory@2db0d008,
 nettyServerBootstrapFactory=null, options=null, ssl=false, sslHandler=null, 
sslContextParameters='null', needClientAuth=false, 
enabledProtocols='TLSv1,TLSv1.1,TLSv1.2, keyStoreFile=null, 
trustStoreFile=null, keyStoreResource='null', trustStoreResource='null', 
keyStoreFormat='JKS', securityProvider='SunX509', passphrase='null', 
bossGroup=null, workerGroup=null, networkInterface='null’}]

I could not find any examples of how to accomplish this.  Any hints?

Best regards,
Alex soto