http caller's IP address

2015-01-29 Thread Tim Dudgeon
When using REST DSL with jetty/restlet/etc is it possible to know the 
caller's IP address?

I can't see any header property for this.

Tim


Re: http caller's IP address

2015-01-29 Thread Claus Ibsen
Hi

Depending on which component you use, you can get access to its native
type, such as HttpRequest, and use that to get the caller ip, just as
you would have to do if you use the components without rest-dsl.

On Thu, Jan 29, 2015 at 5:41 PM, Tim Dudgeon tdudgeon...@gmail.com wrote:
 When using REST DSL with jetty/restlet/etc is it possible to know the
 caller's IP address?
 I can't see any header property for this.

 Tim



-- 
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: Spring Camel Quartz cluster configuration

2015-01-29 Thread Willem Jiang
Hi,

org.springframework.scheduling.quartz.SchedulerFactoryBean is a FactoryBean, 
you can get the scheduler instance by calling the getObject() method.

you need to put the camel context instance into the schedulerContextAsMap.

--  
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 January 18, 2015 at 2:12:09 PM, Paul Dailly (pauldaill...@gmail.com) wrote:
 Hi there,
  
 I have a Spring application which defines Camel routes triggered using
 camel-quartz2 (v2.14.0). The Quartz Camel routes I have configured
 successfully trigger when I run a single instance of the app (i.e
 non-clustered, in-memory quartz scheduler).
  
 However, I now want to set this up in a clustered environment, where I can
 have multiple instances of my application and a single mySQL database to
 store the scheduled jobs for the Camel routes. I want only a single instance
 of my app to run when a triggered route fires. I started to follow this
 example
  
 from Camel's GitHub repo in order hook my Camel routes into my clustered
 Quartz scheduler. However I am confused by 2 parts of the bean declarations
 given in this example. The first source of confusion is the bean declaration
 below:
  
  class=org.apache.camel.component.quartz2.QuartzComponent
  
  
  
 The reference above to the scheduler bean is an instance of
 org.springframework.scheduling.quartz.SchedulerFactoryBean. However the
 QuartzComponent class's scheduler property is of type org.quartz.Scheduler.
 Therefore, I receive a ClassCastException when trying to set scheduler
 property to an instance of
 org.springframework.scheduling.quartz.SchedulerFactoryBean.
  
 My second source of confusion is the declaration of schedulerContextAsMap
 map shown below:
  
  
  
  
  value-ref=camelContext2/
  
  
  
 I am using Java configuration rather than XML for my bean declarations.
 Therefore, should I be setting the value of the
 CamelQuartzCamelContext-camelContext key to be an autowired instance of my
 CamelContext?
  
 I am new to Camel/Quartz so apologies if my question is difficult to reason
 about. Please let me know if you need me to provide any further information
 in order to clarify my issue.
  
 Thanks,
  
 Paul
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Spring-Camel-Quartz-cluster-configuration-tp5761825.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: Camel 2.14.2 version

2015-01-29 Thread Willem Jiang
Camel 2.14.2 will be release at the end of Q1 2015.

--  
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 January 20, 2015 at 6:55:41 AM, Kranti Parisa (kranti.par...@gmail.com) 
wrote:
 Hi,
  
 When is Camel 2.14.2 is due for release?
  
 Thanks,
 KP
  



Re: question about mod sec parameters

2015-01-29 Thread Willem Jiang
I don’t think this question is related Apache Camel.

--  
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 January 16, 2015 at 8:41:35 PM, sterngre (stern...@gmail.com) wrote:
 Hello
  
 I tried to look for parameter descriptions in google but I can`t find
 anythin relevant.
 I have following rule
  
 SecRule REQUEST_HEADERS:User-Agent @pmFromFile badbots.txt
 id:350001,rev:1,severity:2,log,msg:'BAD BOT - Detected and Blocked. '
  
  
 and my questions are :
  
 what is ID ?
 what is rev ?
 what is severity ?
  
 Cheers
 Greg
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/question-about-mod-sec-parameters-tp5761792.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: CamelContextLifecycle causes ClassNotFoundException when compiled with java 1.7

2015-01-29 Thread Willem Jiang
Can you check if you build source target is java 1.6?
Camel starts to support Java 1.7 since camel-2.14.x.
You can find more information here[1]

[1]http://camel.apache.org/building.html

--  
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 January 27, 2015 at 6:00:05 PM, yuncil (jonas.stei...@hotmail.de) wrote:
 Hi,
  
 I'm using camel 2.13.0 and WebLogicServer 10.3.6 for my application. Also I
 use the CamelContextLifecycle and there is where the exception occurs.
  
 Everything works well if I compile with Java 1.6, but if I use Java 1.7 this
 Exception occurs during the startup process of the ManagedServer:
  
 
  
 java.lang.RuntimeException: Error creating CamelContextLifecycle class with
 name foo.bar.ContextLifecycle
 at
 org.apache.camel.component.servletlistener.CamelServletContextListener.contextInitialized(CamelServletContextListener.java:114)
   
 at
 weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
   
 at
 weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
   
 at
 weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)  
 at
 weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
   
 at
 weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1870)
 at
 weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3163)
   
 at
 weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1522)  
 at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
 at
 weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
   
 at
 weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
   
 at
 weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
   
 at
 weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
   
 at
 weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
   
 at
 weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
   
 at
 weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
   
 at
 weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
   
 at
 weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
   
 at
 weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:671)  
 at
 weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
   
 at
 weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
   
 at
 weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:44)
   
 at
 weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
   
 at
 weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
 at
 weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:187)
   
 at
 weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:379)
   
 at
 weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
   
 at
 weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
   
 at
 weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
   
 at
 weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:261)
   
 at
 weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:246)
   
 at
 weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
   
 at
 weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
   
 at
 weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
   
 at
 weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
   
 at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
 Caused By: java.lang.ClassNotFoundException: foo.bar.ContextLifecycle
 at
 org.apache.camel.impl.DefaultClassResolver.resolveMandatoryClass(DefaultClassResolver.java:61)
   
 at
 org.apache.camel.component.servletlistener.CamelServletContextListener.contextInitialized(CamelServletContextListener.java:111)
   
 at
 

Re: Issue setting property on the object which in the exchange body

2015-01-29 Thread Willem Jiang
You can use the bean method return the message body just like this

public class Bar {
 
    @Handler
    public Foo doSomething(@Header(age)Integer age, @Body Foo foo) {
        foo.setAge(age);
return foo;
   }

from(activemq:someQueue).
  bean(Bar.class);

You can find more information about Bean Binding here[1]

[1]https://camel.apache.org/bean-binding.html



--  
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 January 21, 2015 at 4:27:37 AM, gilboy (josephoto...@gmail.com) wrote:
 Hi
  
 In my route, I have a header property on the exchange called age. In the
 body of the exchange I have a person object. I want to set the age property
 on the person object.
  
 If I do something like the following in my route and have the setAge
 property on the Person bean use the header annotation(e.g.
 setAge(@Header(age)Integer age)) the property will get correctly set.
 However, the setter message is void, hence the body on the exchange gets
 wiped. I can have the setter method return *this* but it feels wrong
  
  
 ${body.setAge}
  
  
 Any other solution?
 Thanks
 Joe
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Issue-setting-property-on-the-object-which-in-the-exchange-body-tp5761960.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



skipDuplicate/removeOnFailure flags for file2 component

2015-01-29 Thread David Karlsen
The docs on http://camel.apache.org/file2.html says it contains support
for idempotent-consumer built directly into the component - but it does not
expose the flags skipDuplicate/removeOnFailure which the idempotent
consumer does:
http://camel.apache.org/idempotent-consumer.html

is there any chance to add support for this - or is there a reason for it?

-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: mvn clean install -Pvalidate

2015-01-29 Thread Willem Jiang
I just checked the http://scriptengines.googlecode.com/svn/m2-repo/“, it can 
be accessed now.

--  
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 January 21, 2015 at 2:16:02 PM, shreyas (shreyas.puro...@hotmail.com) wrote:
 Hello,
  
 When I run 'mvn clean install -Pvalidate' command on master in platforms 
 directory,  
 it fails with below message (No connector available to access repository 
 google.script.repo  
 (htt
 p://scriptengines.googlecode.com/svn/m2-repo/) of type default using the 
 available  
 factories WagonRepositoryConnectorFactory).
  
 Please help if anybody has any idea on getting this to run. Thanks a lot!
  
 [INFO] 
   
 [INFO] Reactor Summary:
 [INFO]
 [INFO] Camel :: Platforms  SUCCESS [1.469s]
 [INFO] Camel :: Platforms :: Catalog . SUCCESS [3.760s]
 [INFO] Camel :: Platforms :: Commands  SUCCESS [0.070s]
 [INFO] Camel :: Platforms :: Commands :: Core  SUCCESS [3.782s]
 [INFO] Camel :: Platforms :: Commands :: Jolokia . SUCCESS [2.266s]
 [INFO] Camel :: Platforms :: Apache Karaf  SUCCESS [0.067s]
 [INFO] Camel :: Platforms :: Apache Karaf :: Commands  SUCCESS [1.695s]
 [INFO] Camel :: Platforms :: Apache Karaf :: Features  FAILURE [1.460s]
 [INFO] 
   
 [INFO] BUILD FAILURE
 [INFO] 
   
 [INFO] Total time: 15.429s
 [INFO] Finished at: Tue Jan 20 22:03:57 PST 2015
 [INFO] Final Memory: 35M/991M
 [INFO] 
   
 [ERROR] Failed to execute goal 
 org.apache.karaf.tooling:features-maven-plugin:2.4.1:validate  
 (validate) on project apache-camel: Unable to validate F:
 \Projects\Java\camel\platforms\karaf\features\target\classes\features.xml:  
 Could not transfer artifact org.apache.cxf.karaf:apache-cxf:xml:features:3.  
 0.3 from/to google.script.repo 
 (http://scriptengines.googlecode.com/svn/m2-repo/):  
 No connector available to access repository google.script.repo (htt
 p://scriptengines.googlecode.com/svn/m2-repo/) of type default using the 
 available  
 factories WagonRepositoryConnectorFactory
 [ERROR] org.apache.cxf.karaf:apache-cxf:xml:3.0.3
 [ERROR]
 [ERROR] from the specified remote repositories:
 [ERROR] google.script.repo (http://scriptengines.googlecode.com/svn/m2-repo/, 
  
 releases=true, snapshots=false),
 [ERROR] com.springsource.repository.bundles.release 
 (http://repository.springsource.com/maven/bundles/release,  
 releases=true, snapshots=true),
 [ERROR] com.springsource.repository.bundles.external 
 (http://repository.springsource.com/maven/bundles/external,  
 releases=true, snapshots=true),
 [ERROR] apache.snapshots (http://repository.apache.org/snapshots/, 
 releases=false,  
 snapshots=true),
 [ERROR] central (http://repo.maven.apache.org/maven2, releases=true, 
 snapshots=false)  
 [ERROR] - [Help 1]
 [ERROR]
 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
 switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR]
 [ERROR] For more information about the errors and possible solutions, please 
 read the  
 following articles:
 [ERROR] [Help 1] 
 http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException  
 [ERROR]
 [ERROR] After correcting the problems, you can resume the build with the 
 command
 [ERROR] mvn -rf :apache-camel



Re: Possibility to track (monitor) inbound/outbound messages (request/response)

2015-01-29 Thread hanusto
Thanks Willem, I did it via onComplete and onFailure as implementation of
Processor, Synchronization.

Tomas



--
View this message in context: 
http://camel.465427.n5.nabble.com/Possibility-to-track-monitor-inbound-outbound-messages-request-response-tp5761583p5762237.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: skipDuplicate/removeOnFailure flags for file2 component

2015-01-29 Thread Claus Ibsen
Hi

The built in idempotent is intended for regular use cases. If you need
more configuration and whatnot then the EIP pattern is the way to go.

On Thu, Jan 29, 2015 at 1:11 PM, David Karlsen davidkarl...@gmail.com wrote:
 The docs on http://camel.apache.org/file2.html says it contains support
 for idempotent-consumer built directly into the component - but it does not
 expose the flags skipDuplicate/removeOnFailure which the idempotent
 consumer does:
 http://camel.apache.org/idempotent-consumer.html

 is there any chance to add support for this - or is there a reason for it?

 --
 --
 David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen



-- 
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: http caller's IP address

2015-01-29 Thread Tim Dudgeon
Thanks. For reference this is how it can be done (for Jetty at least, 
but probs most others too) using a simple expression:


simple(${header.CamelHttpServletRequest?.remoteAddr})

Tim

On 29/01/2015 16:56, Claus Ibsen wrote:

Hi

Depending on which component you use, you can get access to its native
type, such as HttpRequest, and use that to get the caller ip, just as
you would have to do if you use the components without rest-dsl.

On Thu, Jan 29, 2015 at 5:41 PM, Tim Dudgeon tdudgeon...@gmail.com wrote:

When using REST DSL with jetty/restlet/etc is it possible to know the
caller's IP address?
I can't see any header property for this.

Tim







Re: HTTP consumer - Terminology confusing

2015-01-29 Thread muell01
thank you. Glad to know the config is good.

The polling consumer is what we intended. 
camel 2.12/activemq 5.9 (we love the Hawtio), war file deployed onto EAP6.3

The original reason for this post is because the client will stall w/o
warnings. No polling activity. no warnings or errors. Sometimes the route
can be stopped/restarted (which we do with a separate route that uses the
controllbus) and sometimes we have to undeploy/deploy. I know, it sounds
like memory issues or too many threads, but the JVM stats show this is not
the case. We're still investigating.

So the warnings in the docs had me concerned. (maybe they should be removed
for us w/limited experience to camel and are basically rule followers)

Code snippet:
from
uri=http://api.application.com/v1/pull?id={{stream}}amp;api_key={{api_key}}amp;username={{username}}/
choice
when
simple${header.CamelHttpResponseCode} == 200/simple
convertBodyTo type=java.lang.String/
to uri=activemq:queue:preQ/
...

But why does the camel doc. say not to use HTTP as consumer to the route? I
understand Clause's suggestion of the Timer to manage the poll. But w/the
timer it is invoked whether the route is complete or not. In our situation,
we suppress this multi threaded behaviour.

Thanks

Rob



--
View this message in context: 
http://camel.465427.n5.nabble.com/HTTP-consumer-Terminology-confusing-tp5762190p5762234.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: F5 load balancer w/ SSL M/A termination in front of Camel

2015-01-29 Thread Claus Ibsen
Hi

If the custom http header is not a soap header, then you would need to
dig a bit to access it.

I think you can do it using the spring api

WebServiceMessage ws =
exchange.getIn(SpringWebserviceMessage.class).getWebServiceMessage();

And then see what WebServiceMessage has in the api to access the http headers.

On Thu, Jan 29, 2015 at 4:23 PM, clinton clint.pe...@ionep.com wrote:
 We are planning on using F5 LTM to terminate SSL sessions that are mutually
 authenticated.  Our receiving endpoints are using the Spring-ws component.
 The F5 is going to put the identity info from the caller's certificate into
 a custom HTTP header before forwarding.
 How can I get access to this header so we can do the authorization check?
 Thanks
 Clint



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/F5-load-balancer-w-SSL-M-A-termination-in-front-of-Camel-tp5762236.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
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: Input directory with multiple file consumers

2015-01-29 Thread ravi.4indra
I ran into a similar issue and exploring options for this.
does reducing the delay between polls to very low value (10) increases with
file consumption on both the nodes?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Input-directory-with-multiple-file-consumers-tp5713788p5762241.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel JPA/JTA/Jboss - You cannot commit with autocommit set

2015-01-29 Thread mattmadhavan
Hello,
I have a simple route with Hibernate/JPA. The application is running inside
the JBoss and using the JTA Transaction manager. I keep getting the error
when the route executes. I didn't face this issue when I ran the same out
side of JBoss but with Bitronix JTA.

I am not even sure if its a Camel issue. But I am sure some one else has
encountered this before.

Any ideas please?

Thanks
Matt'M





-
Thanks
Matt G. Madhavan
--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JPA-JTA-Jboss-You-cannot-commit-with-autocommit-set-tp5762242.html
Sent from the Camel - Users mailing list archive at Nabble.com.