Re: Quartz job data deletion in clustered quartz2

2014-10-22 Thread lakshmi.prashant
Hi Willem,

 Hi,

 Quartz2_Mig_Test1 is the camelcontext id that we set in our blueprint xml
configuration. I had earlier attached the beans.xml in my earlier message
for reference.

camel:camelContext id=Quartz2_Mig_Test1 streamCache=true

 Camel calculates the name for the camel context by calling getName() of
DefaultManagementNameStrategy in line no. 76 of addTrigger() method in
QuartzEndpoint.java.

Thanks,
Lakshmi



--
View this message in context: 
http://camel.465427.n5.nabble.com/Quartz-job-data-deletion-in-clustered-quartz2-tp5757508p5757880.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Quartz job data deletion in clustered quartz2

2014-10-22 Thread lakshmi.prashant
Hi Willem, 
 Quartz2_Mig_Test1 is the camelcontext id that we set in our blueprint xml
configuration. I had earlier attached the beans.xml in my earlier message
for reference.

camel:camelContext id=Quartz2_Mig_Test1 streamCache=true

 Camel calculates the name for the camel context by calling getName() of
DefaultManagementNameStrategy in line no. 76 of addTrigger() method in
QuartzEndpoint.java.

Thanks,
Lakshmi



--
View this message in context: 
http://camel.465427.n5.nabble.com/Quartz-job-data-deletion-in-clustered-quartz2-tp5757508p5757881.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Setting maximumPoolSize in camel-netty component

2014-10-22 Thread Viral Gohel
Hi All, 

This is my first post here.
I have been playing around with camel-netty and camel-netty-http components,
and trying to figure out what the setting maximumPoolSize does.

I referred to this, 
http://camel.465427.n5.nabble.com/Load-test-on-camel-netty-td5737221.html
http://camel.465427.n5.nabble.com/Load-test-on-camel-netty-td5737221.html  

However, from what i observe based on this is that, the OrderPool always
processes 16 concurrent requests. I am trying to change the maximumPoolSize
to a value of 5 like the route as below, 

bean id=nettyBean class=com.redhat.NettyTestImpl
property name=message value=Viral's Netty maximumPoolSize
test/
/bean

camelContext trace=false
xmlns=http://camel.apache.org/schema/blueprint; autoStartup=true
route
from
uri=netty-http:http://localhost:8080/hello?maximumPoolSize=5amp;sync=true/

log message=Forwarding to Netty component ./
setBody
method ref=nettyBean method=sayHi/
/setBody
delay
constant3000/constant
/delay

log message=The body contains : ${body}/
/route
/camelContext

But it seems that i cannot get the maximumPoolSize to set to a value. So,
what am i doing wrong ? How can i get the maximumPoolSize set ?

I check this by load testing with 20 concurrent requests and all are
processed.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Setting-maximumPoolSize-in-camel-netty-component-tp5757882.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Web service SOAP fault handling

2014-10-22 Thread Jaishankar
Hi All, 
This is the route code. 
.dotry() 
.beanRef(requestProcessor,beginRequest) 
.setBody(body()) 
.to(cxf:bean:--id--) 
.doCatch(SoapFault.class) 
 .process(new Processor() { 
  @Override 
  public void process(Exchange exchange) throws Exception{ 
   SoapFault fault =
exchange.getProperty(Exchange.EXCEPTION_CAUGHT, SoapFault.class); 
LOG.info(fault : + fault); 
   } 
   .to(seda:rollbackOperation) 

Here I’m sending the SOAP request to the to() endpoint, if I get soap fault
response then doCatch() will catch it but after that I need the SOAP fault
message which was the response. 
I tried LOG messge : fault is null, tried exchange.getException() even this
it’s showing null, printed body, null. 

Question:
I’m able catch the exception but need soapfault response message in catch
block? 

I don't want to use SoapFaultIntercepter in CXF. 




--
View this message in context: 
http://camel.465427.n5.nabble.com/Web-service-SOAP-fault-handling-tp5757883.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How do i control my soap foult back to the client ?

2014-10-22 Thread ABouchama
Here's how we generate a SOAP Fault:

public void process(Exchange exchange) throws Exception
  {
// Setup the SOAP fault
SoapFault fault = buildFault(exchange);
fault.setFaultCode(Soap11.getInstance().getSender());
//B2BException_Exception fault = buildFault(exchange);
exchange.getOut().setHeaders(exchange.getIn().getHeaders());

exchange.getOut().setBody(fault);
exchange.getOut().setFault(true);
  }



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-do-i-control-my-soap-foult-back-to-the-client-tp5755111p5757897.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel - JAAS / Fuse

2014-10-22 Thread ABouchama
I think that you have to update your Import package in the pom.xml of your
project :


Import-Package
javax.security.auth,
javax.security.auth.callback,
javax.security.auth.login,
javax.security.auth.spi,
org.apache.karaf.jaas.modules,
missing -- org.apache.karaf.jaas.boot.principal,
org.eclipse.jetty.plus.jaas;version=${jetty-version},
org.eclipse.jetty.security;version=${jetty-version},
*
/Import-Package



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JAAS-Fuse-tp5757390p5757900.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Web service SOAP fault handling

2014-10-22 Thread Aida
Hi Jaishankar,

Have you tried with the Exchange.EXCEPTION_CAUGHT property?

If I remember well, when you catch an exception, as is supposed that you are
controlling the situation, the exception moves to this property. The
exception won´t be anymore in the exchange.getException() (otherwise the
channel would detect that an exception happened and the message will be
redirected to the corresponding error handler)

You can access directly to this property using in your bean this as an
argument:

@Property(value=Exchange.EXCEPTION_CAUGHT) Exception exceptionCaught

Hope that helps you.

Greetings,

  Aida.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Web-service-SOAP-fault-handling-tp5757883p5757906.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camelContext.hasEndpoint() returns null when endpoint (apparently) exists

2014-10-22 Thread Aida
Hello,

I'm working with Camel 2.12.3

I have three routebuilders that consist of consuming messages from a seda
queue and sending them to a destination endpoint, like this:

from(seda:syncronizedMyQueue)
 .to(myDestinationEndpoint);

 
When a message must be sent to one of these queues, I use the
camelContext.hasEndpoint() method (to verify that we are going to send a
message to an endpoint that exists, because I create these routebuilders
dynamically). The problem is that when a message is sent to one of these
queues that haven´t been used for a while, a null is retrieved (the API says
that if the endpoint does not exist, null is returned). Nevertheless, using
the JConsole I can see that the endpoint associated to that queue do exist.

Example:
I have the queues MyQueue1 and MyQueue2 (different routebuilders)

RouteBuilder1:
from(seda:syncronizedMyQueue1)
 .to(myDestinationEndpoint1);

RouteBuilder2:   
from(seda:syncronizedMyQueue2)
 .to(myDestinationEndpoint2);

If, after camel context is up and both routebuilders are available, I start
sending messages to MyQueue1, no problem arises.

If after a while without sending a message (days or weeks) to MyQueue2 I
start sending messages to it, the method camelContext.hasEndpoint() returns
null.

In both cases I can see the endpoints of both queues available using the
JConsole. Both queues are active and have, apparently, the same values in
each attribute.

I wanted to ask if there is any known issue (or expected behaviour) that can
cause that a seda queue endpoint that is not used for a while (days or even
weeks) stops being recognised by the camel context)

Thanks in advance.

QR.

  Aida.



--
View this message in context: 
http://camel.465427.n5.nabble.com/camelContext-hasEndpoint-returns-null-when-endpoint-apparently-exists-tp5757907.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel cxfrs with swagger.

2014-10-22 Thread jack atwork
Hi,

Did you find any solution to this? As I'm faced with a similar problem?

I'm trying to setup swagger with the rest dsl and camel-jetty but there
appears to be no way to plug them together.

Am I missing something or is this camel-swagger component only intended for
traditional web applications (with a web.xml)?

As far as I can see the camel-swagger essentially provides a servlet that
discovers the api from the cametContext and a filter for cors.
Potentially these could be programmatically wired in but I don't see any
neat 'camel' solution to this.

Thanks

Jack


On 17 October 2014 17:44, Sergey Beryozkin sberyoz...@gmail.com wrote:

 This is a link Freeman kindly shared with me earlier on

 http://svn.apache.org/viewvc?view=revisionrevision=r1537442

 It refers to a ServiceMix demo, though I haven't tested the demo.
 I guess you'd register it the same way with cxfrs

 Cheers, Sergey

 On 17/10/14 16:19, atg roxx wrote:

 Hi Matt/Sergey,

 Thanks for replying.

 Sergey,

 I was not sure where and how to user your SwaggerFeature.. not sure where
 it will fit.

 Matt,

 In your approach too, could not see the use of camel cxfrs and also there
 are not camel routes to server the request.

 In Swagger config, could not see any resource location to search for
 resources class.

 Could you if possible , kindly let me know where how to use these in your
 sample program.

 -Regards,
 atg roxx

 On Fri, Oct 17, 2014 at 3:08 PM, Matt Raible m...@raibledesigns.com
 wrote:

  Here's how I did it.

 Application.java (to register Camel's servlet):
 
 import org.apache.camel.component.servlet.CamelHttpTransportServlet;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.builder.SpringApplicationBuilder;
 import
 org.springframework.boot.context.embedded.ConfigurableEmbeddedServletCon
 tainer;
 import
 org.springframework.boot.context.embedded.EmbeddedServletContainerCustom
 izer;
 import org.springframework.boot.context.embedded.ErrorPage;
 import org.springframework.boot.context.embedded.
 ServletRegistrationBean;
 import org.springframework.boot.context.web.
 SpringBootServletInitializer;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.HttpStatus;

 @Configuration
 @ComponentScan
 @EnableAutoConfiguration
 public class Application extends SpringBootServletInitializer {
  private static final String CAMEL_URL_MAPPING = /rest/*;
  private static final String CAMEL_SERVLET_NAME = CamelServlet;

  public static void main(String[] args) {
  SpringApplication.run(Application.class, args);
  }

  @Override
  protected SpringApplicationBuilder
 configure(SpringApplicationBuilder application) {
  return application.sources(Application.class);
  }

  @Bean
  public ServletRegistrationBean servletRegistrationBean() {
  ServletRegistrationBean registration =
  new ServletRegistrationBean(new
 CamelHttpTransportServlet(), CAMEL_URL_MAPPING);
  registration.setName(CAMEL_SERVLET_NAME);
  return registration;
  }

  @Bean
  public EmbeddedServletContainerCustomizer
 containerCustomizer() {
  return new EmbeddedServletContainerCustomizer() {
  @Override
  public void
 customize(ConfigurableEmbeddedServletContainer container) {
  ErrorPage error401Page = new
 ErrorPage(HttpStatus.UNAUTHORIZED, /401.html);
  ErrorPage error404Page = new
 ErrorPage(HttpStatus.NOT_FOUND, /404.html);
  ErrorPage error500Page = new
 ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, /500.html);

  container.addErrorPages(error401Page,
 error404Page, error500Page);
  }
  };
  }
 }

 SwaggerConfig.java:
 
 @Configuration
 public class SwaggerConfig implements EnvironmentAware {

  private RelaxedPropertyResolver propertyResolver;

  @Override
  public void setEnvironment(Environment environment) {
  this.propertyResolver = new RelaxedPropertyResolver(
 environment,
 swagger.);
  }

  /**
   * Swagger Camel Configuration
   */
  @Bean
  public ServletRegistrationBean swaggerServlet() {
  ServletRegistrationBean swagger = new
 ServletRegistrationBean(new
 SpringRestSwaggerApiDeclarationServlet(), /swagger/*);
  MapString, String params = new HashMap();
  params.put(base.path, https://localhost:8443/rest;);
  params.put(api.title, propertyResolver.getProperty(title));
  

Re: camel cxfrs with swagger.

2014-10-22 Thread Matt Raible
I created an example application to show how I got Camel's REST + Swagger to 
work together in a Spring environment with no web.xml.

https://github.com/mraible/camel-rest-swagger

Specifically, see Application.java (for configuring the CamelServlet) and 
SwaggerConfig.java (for the Swagger servlet):

https://github.com/mraible/camel-rest-swagger/blob/master/src/main/java/com/raibledesigns/camel/Application.java
https://github.com/mraible/camel-rest-swagger/blob/master/src/main/java/com/raibledesigns/camel/config/SwaggerConfig.java

Hope this helps,

Matt

On Oct 22, 2014, at 10:38 AM, jack atwork jrmpatw...@gmail.com wrote:

 Hi,
 
 Did you find any solution to this? As I'm faced with a similar problem?
 
 I'm trying to setup swagger with the rest dsl and camel-jetty but there
 appears to be no way to plug them together.
 
 Am I missing something or is this camel-swagger component only intended for
 traditional web applications (with a web.xml)?
 
 As far as I can see the camel-swagger essentially provides a servlet that
 discovers the api from the cametContext and a filter for cors.
 Potentially these could be programmatically wired in but I don't see any
 neat 'camel' solution to this.
 
 Thanks
 
 Jack
 
 
 On 17 October 2014 17:44, Sergey Beryozkin sberyoz...@gmail.com wrote:
 
 This is a link Freeman kindly shared with me earlier on
 
 http://svn.apache.org/viewvc?view=revisionrevision=r1537442
 
 It refers to a ServiceMix demo, though I haven't tested the demo.
 I guess you'd register it the same way with cxfrs
 
 Cheers, Sergey
 
 On 17/10/14 16:19, atg roxx wrote:
 
 Hi Matt/Sergey,
 
 Thanks for replying.
 
 Sergey,
 
 I was not sure where and how to user your SwaggerFeature.. not sure where
 it will fit.
 
 Matt,
 
 In your approach too, could not see the use of camel cxfrs and also there
 are not camel routes to server the request.
 
 In Swagger config, could not see any resource location to search for
 resources class.
 
 Could you if possible , kindly let me know where how to use these in your
 sample program.
 
 -Regards,
 atg roxx
 
 On Fri, Oct 17, 2014 at 3:08 PM, Matt Raible m...@raibledesigns.com
 wrote:
 
 Here's how I did it.
 
 Application.java (to register Camel's servlet):
 
 import org.apache.camel.component.servlet.CamelHttpTransportServlet;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.builder.SpringApplicationBuilder;
 import
 org.springframework.boot.context.embedded.ConfigurableEmbeddedServletCon
 tainer;
 import
 org.springframework.boot.context.embedded.EmbeddedServletContainerCustom
 izer;
 import org.springframework.boot.context.embedded.ErrorPage;
 import org.springframework.boot.context.embedded.
 ServletRegistrationBean;
 import org.springframework.boot.context.web.
 SpringBootServletInitializer;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.HttpStatus;
 
 @Configuration
 @ComponentScan
 @EnableAutoConfiguration
 public class Application extends SpringBootServletInitializer {
 private static final String CAMEL_URL_MAPPING = /rest/*;
 private static final String CAMEL_SERVLET_NAME = CamelServlet;
 
 public static void main(String[] args) {
 SpringApplication.run(Application.class, args);
 }
 
 @Override
 protected SpringApplicationBuilder
 configure(SpringApplicationBuilder application) {
 return application.sources(Application.class);
 }
 
 @Bean
 public ServletRegistrationBean servletRegistrationBean() {
 ServletRegistrationBean registration =
 new ServletRegistrationBean(new
 CamelHttpTransportServlet(), CAMEL_URL_MAPPING);
 registration.setName(CAMEL_SERVLET_NAME);
 return registration;
 }
 
 @Bean
 public EmbeddedServletContainerCustomizer
 containerCustomizer() {
 return new EmbeddedServletContainerCustomizer() {
 @Override
 public void
 customize(ConfigurableEmbeddedServletContainer container) {
 ErrorPage error401Page = new
 ErrorPage(HttpStatus.UNAUTHORIZED, /401.html);
 ErrorPage error404Page = new
 ErrorPage(HttpStatus.NOT_FOUND, /404.html);
 ErrorPage error500Page = new
 ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, /500.html);
 
 container.addErrorPages(error401Page,
 error404Page, error500Page);
 }
 };
 }
 }
 
 SwaggerConfig.java:
 
 @Configuration
 public class SwaggerConfig implements EnvironmentAware {
 
 private 

custom netty decoder in OSGi

2014-10-22 Thread Mark Webb
I have created a custom netty decoder using Camel 2.13.2 in ServiceMix
5.1.2.  I would like to register the decoder as a service in ServiceMix.
All goes well, except that when I try and use the decoder in a separate
bundles blueprint, I get the error message:

14:21:21,830 | WARN  | mix-5.1.2/deploy | NettyConfiguration
| 214 - org.apache.camel.camel-netty - 2.13.2 | The decoder
com.x.y.z.MyFrameD
ecoder@1f2293f6 is not @Shareable or an ChannelHandlerFactory instance. The
decoder cannot safely be used.

I added the annotation @Sharable to the decoder and get the same error
message after redeploying.  I even tried creating a class that implements
ChannelHandlerFactory and got the same message.

Is there a better approach to get this working?

Thanks,
Mark


Camel example builds in net bean but java class source shows error

2014-10-22 Thread sab12in
Hi All,

I am very new to camel, i just took the example Report Incident that comes
with camel download and opened using NetBeans 8. Then compiled the POM.
Everything shows success but then i look at the generated source from wsdl
at
reportincident\target\generated\src\main\java\org\apache\camel\example\reportincident
then files like ReportIncidentEndpoint.java has error for
OutputReportIncident,InputReportIncident,ObjectFactory as can not defined
symbol. Though all these clasess are present in the same package.

Could some one please help what is the issue and how to resolve it.

http://camel.465427.n5.nabble.com/file/n5757912/Screenshot.png 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-example-builds-in-net-bean-but-java-class-source-shows-error-tp5757912.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel example builds in net bean but java class source shows error

2014-10-22 Thread sab12in
Ok i found something which will add the generated classes to the build
location, so now if you use any of the generated classes in your
implementation you wont see the objects underlined in red.


   plugin 
groupIdorg.codehaus.mojo/groupId 
artifactIdbuild-helper-maven-plugin/artifactId  
   
executions 
execution 
idadd-source/id 
phasegenerate-sources/phase 
goals 
goaladd-source/goal 
/goals 
configuration 
sources 
   
source${basedir}/target/generated/src/main/java/source  
   
/sources 
/configuration 
/execution 
/executions 
/plugin 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-example-builds-in-net-bean-but-java-class-source-shows-error-tp5757912p5757913.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: LoadBalance for pollenrich

2014-10-22 Thread Willem Jiang
How about use “direct” endpoint to connect those route?

.loadBalance().failover().to(“direct:jpa”) 
…

from(“direct:jpa”).pollEnrich(“jpa:xxx”);

--  
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 October 21, 2014 at 3:56:24 PM, imranrazakhan (imranrazak...@gmail.com) 
wrote:
 Hi,
  
 I have following route and i want to apply loadbalance with failover for
 pollenrich in route
  
 from(jpa:com.test.VasRequest?consumeDelete=falseconsumer.delay=2consumer.namedQuery=selectLoanRequestspersistenceUnit=VasServicePU)
   
 .choice()
 .when(simple(${body.VasRequest.getMessage}=='Y'))
 .loadBalance().failover()
  
 .pollEnrich(jpa:VasRequest?consumer.namedQuery=verifyRequestspersistenceUnit=VasServicePU1)
   
 .otherwise()
 .to(direct:verifyOffer)
 .endChoice()
 .to(jpa:com.test.VasResponse?persistenceUnit=VasServicePU)
 .end();
  
 Now if i couldnt get response from pollEnrich, i would like to query on
 other jpa endpoint, but pollenrich is showing error if i provide other
 endpoint by comma separation.
  
 Regards
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/LoadBalance-for-pollenrich-tp5757837.html  
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: LoadBalance for pollenrich

2014-10-22 Thread imranrazakhan
Hi,

I want to implement something like below, How direct support this, i want to
query second JPA if first database dont respond.

.loadBalance().failover().
pollEnrich(jpa:VasRequest?consumer.namedQuery=verifyRequestspersistenceUnit=VasServicePU1,
 
jpa:VasRequest?consumer.namedQuery=verifyRequestspersistenceUnit=VasServicePU2)



--
View this message in context: 
http://camel.465427.n5.nabble.com/LoadBalance-for-pollenrich-tp5757837p5757926.html
Sent from the Camel - Users mailing list archive at Nabble.com.


[VOTE] Release Apache Camel 2.12.5

2014-10-22 Thread Christian Müller
This is a vote to release Apache Camel 2.12.5, a patch release coming with
about 74 issues fixed.

Release notes:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311211version=12327166

Staging repo:
https://repository.apache.org/content/repositories/orgapachecamel-1017

Tarballs:
https://repository.apache.org/content/repositories/orgapachecamel-1017/org/apache/camel/apache-camel/2.12.5/

Tag:
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=tag;h=42850495b5a53878ceb1aec40f57b0b636e96e58

Please test this release candidate and cast your vote.
[ ] +1 Release the binary as Apache Camel 2.12.3
[ ] -1 Veto the release (provide specific comments)
Vote is open for at least 72 hours.

Thanks,
Christian