Re: jdbc component streamList, last row

2014-12-02 Thread Claus Ibsen
Hi

I suggest to dive into the code to see if there is anything for that.
And if not, if that would be possible to add?

On Mon, Dec 1, 2014 at 5:01 PM, dermoritz  wrote:
> I am using jdbc component with streamList as output type. Is there a way to
> know when last row arrived? (probably there is a special exchange
> property?!)
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/jdbc-component-streamList-last-row-tp5759876.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/


Delayed request processing with Camel Restlet 2.14.0

2014-12-02 Thread Thomas Günter
Hi, 
  
we moved a restful application based on the RESTLET component from Camel 2.13.3 
to 2.14.0 and discovered severe perfomance problems with the latter version. 
Whereas requests with 2.13.3 were countinuously replied within a few (10) 
milliseconds, with 2.14.0 the requests took longer than 200ms (up to 500ms). 
The strange thing is, that the time passes by between the moment the request 
reaches the server and the moment the first log appears on server side. 
  
Has anyone experienced the same issue or an explanation/solution for this? 
  
Thanks in advance, 
Thomas 
  
  
Client side log: 
TEST 02.27.14 - 08:27:26.170 DEBUG c.i.c.h.c.f.FailoverLbHttpClient - Executing 
request [http://localhost:9000/siggw] to host [http://localhost:9000] 
TEST 02.27.14 - 08:27:26.677 DEBUG c.i.s.s.c.r.i.SigGwRsRequestExecutor - 
Received response from SIGGW [response] 
  
Server side log: 
02.12.2014 08:27:26.669 [Thread-2] DEBUG o.r.C.LogService [] [] [] [] - 
Processing request to: "http://localhost:9000/siggw"; 
02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.C.ServerRouter [] [] [] [] - Call 
score for the "org.restlet.routing.VirtualHost@7a3c388e" host: 1.0 
02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.C.ServerRouter [] [] [] [] - 
Default virtual host selected 
02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.C.ServerRouter [] [] [] [] - Base 
URI: "http://localhost:9000";. Remaining part: "/siggw" 
02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - Call 
score for the "/hc" URI pattern: 0.0 
02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - Call 
score for the "/siggw" URI pattern: 1.0 
02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - Selected 
route: "/siggw" -> 
org.apache.camel.component.restlet.MethodBasedRouter@790b3d68 
02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - 6 
characters were matched 
02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - New base 
URI: "http://localhost:9000/siggw";. No remaining part to match 
02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - 
Delegating the call to the target Restlet 
02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.C.ChallengeAuthenticator [] [] [] 
[] - Authentication succeeded. Valid credentials provided for identifier: 
siggw.user. 
02.12.2014 08:27:26.671 [Thread-2] DEBUG o.r.C.ChallengeAuthenticator [] [] [] 
[] - The authentication succeeded for the identifer "siggw.user" using the 
HTTP_Basic scheme. 
02.12.2014 08:27:26.671 [Thread-2] DEBUG 
c.i.s.s.a.r.r.JsonToMapMessageTransformer [] [] [] [] - Received request: 
{request1} 
02.12.2014 08:27:26.672 [Thread-2]  INFO 
c.i.s.s.a.r.r.JsonToMapMessageTransformer [1] [testClient] 
[testClient@localhost] [998571731] - Message received: [message1] 
02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.r.CommonMessageValidator [1] 
[testClient] [testClient@localhost] [998571731] - Applying common validations 
02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.r.GetInfoRequestValidator 
[1] [testClient] [testClient@localhost] [998571731] - Executing 
GetInfoRequestValidator 
02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
[testClient] [testClient@localhost] [998571731] - GsmMap Producer called 
02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
[testClient] [testClient@localhost] [998571731] - Message created 
02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
[testClient] [testClient@localhost] [998571731] - Requests checked 
02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
[testClient] [testClient@localhost] [998571731] - Requested infos prepared 
02.12.2014 08:27:26.673 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
[testClient] [testClient@localhost] [998571731] - Sending request 
02.12.2014 08:27:26.674 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
[testClient] [testClient@localhost] [998571731] - Request answered successfully 
02.12.2014 08:27:26.674 [Thread-2] DEBUG c.i.s.s.a.r.ResponseHandler [1] 
[testClient] [testClient@localhost] [998571731] - Response Handler called 
02.12.2014 08:27:26.674 [Thread-2]  INFO c.i.s.s.a.r.ResponseHandler [1] 
[testClient] [testClient@localhost] [998571731] - Message returned: [message 1] 
02.12.2014 08:27:26.675 [Thread-2] DEBUG 
c.i.s.s.a.r.r.MapMessageToJsonTransformer [] [] [] [] - Returning response: 
{response1} 
02.12.2014 08:27:26.675 [Thread-2]  INFO o.r.C.LogService [] [] [] [] - 
2014-12-0208:27:26127.0.0.1siggw.user-9000POST
/siggw-2004103416http://localhost:9000
Apache-HttpClient/4.2 (java 1.5)- 
  
TCP-Trace: 
862014-12-02 09:27:26.171193127.0.0.1127.0.0.1HTTP601
POST /siggw HTTP/1.1  (application/json) 
902014-12-02 09:27:26.677193127.0.0.1127.0.0.1HTTP450
HTTP/1.1 200 OK  (application/json) 
  
Restlet component configuration: 

Re: Servlet component matchOnUriPrefix is not working as documented

2014-12-02 Thread Claus Ibsen
Try flipping the order the routes are defined, not the startup order attribute

On Mon, Dec 1, 2014 at 6:18 PM, Amit  wrote:
> I still need to check with 2.14.0 version, but we did try to change the route
> order by specifying startupOrder="1" for exact match and  startupOrder="2"
> to   matchOnUriPrefix route but it does not work in
> Apache Camel 2.11.4?
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Servlet-component-matchOnUriPrefix-is-not-working-as-documented-tp5759604p5759880.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: Rest DSL - OutType in case of error message problem

2014-12-02 Thread Claus Ibsen
Hi

Yeah well spotted. We should improve rest-dsl to support these
use-cases where you prepare a response message yourself and set the
http status code to some error code etc.

I guess if the status code is >= 300+ then we should assume its an
error, and use the message body as-is as the response.

On Mon, Dec 1, 2014 at 2:25 PM, panzerhans  wrote:
> I have a setup with Swagger and the Rest DSL. Swagger uses the
> OutType(MyType.class) to annotate the API with the return type. However,
> there are times when I wish to return something else to the caller, e.g. an
> error message with a HTTP response code.
>
> Take the following Route as an example:
>
> RestDefinition privateAPI =
> rest(ServiceConstants.PRIVATE_API_VERSION_1).description("Private (internal)
> REST services for MyServices.");
>
> privateAPI.get("/fetchsomething").description("Lists stuff from some
> service")
> .outTypeList(MyPojoForSomething.class)
> .route().routeId("A descriptive ID")
> .choice()
>
> .when(header(ServiceConstants.REQUEST_VALIDATED).isEqualTo("TRUE"))
>.bean(GoAheadAndFillAMyPojoForSomething-into-body.class)
> .otherwise().bean(ErrorMessageConstructor.class);
>
> ---
>
> * An Interceptor validates the incoming message and sets the Header constant
> to TRUE or FALSE.
> * The ErrorMessageConstructor constructs a proper message and puts it as a
> String into the body together with a correct HTTP code (E.g. Not-Found).
>
> Problem: The marshaller, uses outTypeList to determine the way to convert
> the Message body to Json. If in the above example, the request was "FALSE",
> the marshaller (I am using Jackson) tries to marshall a String to a
> MyPojoForSomething.class.
>
> The content of the String I have constructed for the error is in this case:
> "Missing properties in HTTP Header."
>
> This results in an error:
> com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Missing':
> was expecting ('true', 'false' or 'null')
>  at [Source: java.io.ByteArrayInputStream@67618968; line: 1, column: 9]
> at
> com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1419)
> 
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Rest-DSL-OutType-in-case-of-error-message-problem-tp5759864.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: Delayed request processing with Camel Restlet 2.14.0

2014-12-02 Thread Claus Ibsen
Hi

Try set synchronous=true on the restlet uris.
 Also you can try downgraded restlet itself as we upgraded it too.

On Tue, Dec 2, 2014 at 10:57 AM, Thomas Günter
 wrote:
> Hi,
>
> we moved a restful application based on the RESTLET component from Camel 
> 2.13.3 to 2.14.0 and discovered severe perfomance problems with the latter 
> version.
> Whereas requests with 2.13.3 were countinuously replied within a few (10) 
> milliseconds, with 2.14.0 the requests took longer than 200ms (up to 500ms).
> The strange thing is, that the time passes by between the moment the request 
> reaches the server and the moment the first log appears on server side.
>
> Has anyone experienced the same issue or an explanation/solution for this?
>
> Thanks in advance,
> Thomas
>
>
> Client side log:
> TEST 02.27.14 - 08:27:26.170 DEBUG c.i.c.h.c.f.FailoverLbHttpClient - 
> Executing request [http://localhost:9000/siggw] to host 
> [http://localhost:9000]
> TEST 02.27.14 - 08:27:26.677 DEBUG c.i.s.s.c.r.i.SigGwRsRequestExecutor - 
> Received response from SIGGW [response]
>
> Server side log:
> 02.12.2014 08:27:26.669 [Thread-2] DEBUG o.r.C.LogService [] [] [] [] - 
> Processing request to: "http://localhost:9000/siggw";
> 02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.C.ServerRouter [] [] [] [] - 
> Call score for the "org.restlet.routing.VirtualHost@7a3c388e" host: 1.0
> 02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.C.ServerRouter [] [] [] [] - 
> Default virtual host selected
> 02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.C.ServerRouter [] [] [] [] - 
> Base URI: "http://localhost:9000";. Remaining part: "/siggw"
> 02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - Call 
> score for the "/hc" URI pattern: 0.0
> 02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - Call 
> score for the "/siggw" URI pattern: 1.0
> 02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - 
> Selected route: "/siggw" -> 
> org.apache.camel.component.restlet.MethodBasedRouter@790b3d68
> 02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - 6 
> characters were matched
> 02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - New 
> base URI: "http://localhost:9000/siggw";. No remaining part to match
> 02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.VirtualHost [] [] [] [] - 
> Delegating the call to the target Restlet
> 02.12.2014 08:27:26.670 [Thread-2] DEBUG o.r.C.ChallengeAuthenticator [] [] 
> [] [] - Authentication succeeded. Valid credentials provided for identifier: 
> siggw.user.
> 02.12.2014 08:27:26.671 [Thread-2] DEBUG o.r.C.ChallengeAuthenticator [] [] 
> [] [] - The authentication succeeded for the identifer "siggw.user" using the 
> HTTP_Basic scheme.
> 02.12.2014 08:27:26.671 [Thread-2] DEBUG 
> c.i.s.s.a.r.r.JsonToMapMessageTransformer [] [] [] [] - Received request: 
> {request1}
> 02.12.2014 08:27:26.672 [Thread-2]  INFO 
> c.i.s.s.a.r.r.JsonToMapMessageTransformer [1] [testClient] 
> [testClient@localhost] [998571731] - Message received: [message1]
> 02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.r.CommonMessageValidator 
> [1] [testClient] [testClient@localhost] [998571731] - Applying common 
> validations
> 02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.r.GetInfoRequestValidator 
> [1] [testClient] [testClient@localhost] [998571731] - Executing 
> GetInfoRequestValidator
> 02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
> [testClient] [testClient@localhost] [998571731] - GsmMap Producer called
> 02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
> [testClient] [testClient@localhost] [998571731] - Message created
> 02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
> [testClient] [testClient@localhost] [998571731] - Requests checked
> 02.12.2014 08:27:26.672 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
> [testClient] [testClient@localhost] [998571731] - Requested infos prepared
> 02.12.2014 08:27:26.673 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
> [testClient] [testClient@localhost] [998571731] - Sending request
> 02.12.2014 08:27:26.674 [Thread-2] DEBUG c.i.s.s.a.c.g.GsmMapProducer [1] 
> [testClient] [testClient@localhost] [998571731] - Request answered 
> successfully
> 02.12.2014 08:27:26.674 [Thread-2] DEBUG c.i.s.s.a.r.ResponseHandler [1] 
> [testClient] [testClient@localhost] [998571731] - Response Handler called
> 02.12.2014 08:27:26.674 [Thread-2]  INFO c.i.s.s.a.r.ResponseHandler [1] 
> [testClient] [testClient@localhost] [998571731] - Message returned: [message 
> 1]
> 02.12.2014 08:27:26.675 [Thread-2] DEBUG 
> c.i.s.s.a.r.r.MapMessageToJsonTransformer [] [] [] [] - Returning response: 
> {response1}
> 02.12.2014 08:27:26.675 [Thread-2]  INFO o.r.C.LogService [] [] [] [] - 
> 2014-12-0208:27:26127.0.0.1siggw.user-9000POST
> /siggw-2004103416http://localhost:9000
> Apache-HttpClient/4.2 (ja

Re: Quartz clustering in camel spring DSL - JIRA CAMEL-8076

2014-12-02 Thread selva
Hi Willem,

I have downloaded(2.14.x from github) and debugged the camel quartz
component source code and found the reason for the issue i am facing.

As i already posted i am facing issue in the cluster environment, deployed
the camel application as stand alone program running 2 instances. While
executing a route if one instance goes down the other instance should
trigger the same route immediately as we have configured
*recoverableJob=true* in the quartz2 endpoint .

The issue i was facing like the second instance is triggering quartz2
endpoint but not executing my process(QueryBuilderProcessor) .

Example :



  



While debugging i found that in camelJob.java, the triggerkey in the normal
and the triggerykey during recovery is different,so the below condition is
failing and going else block(Please check the highlighted else block).


   public void execute(JobExecutionContext context) throws
JobExecutionException {
Exchange exchange = null;
try {
if (LOG.isDebugEnabled()) {
LOG.debug("Running CamelJob jobExecutionContext={}",
context);
}

CamelContext camelContext = getCamelContext(context);
QuartzEndpoint endpoint = lookupQuartzEndpoint(camelContext,
context);//*  Step 1 : * 
exchange = endpoint.createExchange();
exchange.setIn(new QuartzMessage(exchange, context));
endpoint.getConsumerLoadBalancer().process(exchange);//*Step :2* 



*  Step 1 : * Quartz endpoint creation


  if (triggerKey.equals(checkTriggerKey){
 return quartzEndpoint;
   }

 
if (camelContext.hasEndpoint(endpointUri) != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Getting Endpoint from camelContext.");
}
result = camelContext.getEndpoint(endpointUri,
QuartzEndpoint.class);
} else {
LOG.warn("Cannot find existing QuartzEndpoint with uri: {}.*
Creating new endpoint instance.", endpointUri);*
result = camelContext.getEndpoint(endpointUri,
QuartzEndpoint.class);
}



Since its creating new quartz endpoint , the consumerLoadBalancer Object is
null.

So as next step its executing the below code and creating *New *
consumerLoadBalancer Object

*Step :2* 


 public LoadBalancer getConsumerLoadBalancer() {
if (consumerLoadBalancer == null) {
consumerLoadBalancer = new RoundRobinLoadBalancer();
}
return consumerLoadBalancer;
}

 Since its creating as a new Object ,the  processors property is empty so
not calling my QueryBuilderProcessor Processor.

In normal flow(not recovery) i can see list of processors details in the
processors property of consumerLoadBalancer .

*Temporary Fix for Testing:* Below Code working fine in Recovery flow with
immediate retry.

As a temporary fix we have modified code in the camelJob.java ,
lookupQuartzEndpoint method like below
(Please check the highlighted text)

protected QuartzEndpoint lookupQuartzEndpoint(CamelContext camelContext,
JobExecutionContext quartzContext) throws JobExecutionException {
TriggerKey triggerKey = quartzContext.getTrigger().getKey();
   * JobDetail jobDetail = quartzContext.getJobDetail();
JobKey jobKey =  jobDetail.getKey();
*
if (LOG.isDebugEnabled()) {
LOG.debug("Looking up existing QuartzEndpoint with
triggerKey={}", triggerKey);
}

// check all active routes for the quartz endpoint this task matches
// as we prefer to use the existing endpoint from the routes
for (Route route : camelContext.getRoutes()) {
if (route.getEndpoint() instanceof QuartzEndpoint) {
QuartzEndpoint quartzEndpoint = (QuartzEndpoint)
route.getEndpoint();
TriggerKey checkTriggerKey = quartzEndpoint.getTriggerKey();
if (LOG.isTraceEnabled()) {
LOG.trace("Checking route endpoint={} with
checkTriggerKey={}", quartzEndpoint, checkTriggerKey);
}
   if
(triggerKey.equals(checkTriggerKey)*||(jobDetail.requestsRecovery()== true
&&
jobKey.getGroup().equals(checkTriggerKey.getGroup())&&jobKey.getName().equals(checkTriggerKey.getName(
{*
return quartzEndpoint;
   }
}
}
return quartzEndpoint;
   }


Except the triggerKey remaning all jobdetails are same in the existing
quartzEndpoint so we put the condition check to return the existing quartz
endpoint instead creating new quartz endpoint in the recoveryflow.

* Summary :* 
The problem we found is while creating new quartz endpoint the
consumerLoadBalancer is null.

Please let us know the right way  to get the consumerLoadBalancer values
while creating new quartz endpoint in case of recovery flow.

Thanks,
selva





--
View this message in context: 
http://camel.

Re: Setting rest response json directly

2014-12-02 Thread Claus Ibsen
Hi

>From Camel 2.14.1 onwards we have made this easier with
https://issues.apache.org/jira/browse/CAMEL-8104

So if you have a custom error message you just set the HTTP error code
to a value 300+ and rest-dsl will not do output binding. There is a
new option that is turned on by default, you can turn it off to use
the old behavior.

And the rest-dsl documentation has a little example in the bottom
https://cwiki.apache.org/confluence/display/CAMEL/Rest+DSL

On Sun, Nov 9, 2014 at 11:24 PM, Gary Kennedy  wrote:
> I changed the way I used the servlet/rest component and it works for me now.
>
> I'm still using the same bean setup as before:
>  interface="org.osgi.service.http.HttpService"/>
> 
>  init-method="register" destory-method="unregister">
> 
> 
> 
> 
> 
>
> But now I've dropped the rest part, and using servlet endpoints to start the
> routes:
> 
> 
> 
> 
> 
> 
> 
> < !-- lots of magic -->
> 
> net.me.MyException
> true
> < !-- more magic -->
> 
> application/json
> 
> 
> { "error": "${exception.message}" }
> 
> 
> 
> 
>
> The bonus to using this method is that the unmarshalling is covered by the
> in-route onException block as well.
>
> The downside is that now I have to work on the http method filtering (ie,
> making the route POST/GET specific). It might be easier to play with the
> consumes/produces part of the rest dsl to bring the above theory used above
> into the rest dsl. Anyways,
>
> Cheers,
> Gary
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Setting-rest-response-json-directly-tp5758518p5758801.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: Rest DSL - OutType in case of error message problem

2014-12-02 Thread Claus Ibsen
Hi

I logged, and fixed this for next release
https://issues.apache.org/jira/browse/CAMEL-8104

On Tue, Dec 2, 2014 at 11:38 AM, Claus Ibsen  wrote:
> Hi
>
> Yeah well spotted. We should improve rest-dsl to support these
> use-cases where you prepare a response message yourself and set the
> http status code to some error code etc.
>
> I guess if the status code is >= 300+ then we should assume its an
> error, and use the message body as-is as the response.
>
> On Mon, Dec 1, 2014 at 2:25 PM, panzerhans  wrote:
>> I have a setup with Swagger and the Rest DSL. Swagger uses the
>> OutType(MyType.class) to annotate the API with the return type. However,
>> there are times when I wish to return something else to the caller, e.g. an
>> error message with a HTTP response code.
>>
>> Take the following Route as an example:
>>
>> RestDefinition privateAPI =
>> rest(ServiceConstants.PRIVATE_API_VERSION_1).description("Private (internal)
>> REST services for MyServices.");
>>
>> privateAPI.get("/fetchsomething").description("Lists stuff from some
>> service")
>> .outTypeList(MyPojoForSomething.class)
>> .route().routeId("A descriptive ID")
>> .choice()
>>
>> .when(header(ServiceConstants.REQUEST_VALIDATED).isEqualTo("TRUE"))
>>.bean(GoAheadAndFillAMyPojoForSomething-into-body.class)
>> .otherwise().bean(ErrorMessageConstructor.class);
>>
>> ---
>>
>> * An Interceptor validates the incoming message and sets the Header constant
>> to TRUE or FALSE.
>> * The ErrorMessageConstructor constructs a proper message and puts it as a
>> String into the body together with a correct HTTP code (E.g. Not-Found).
>>
>> Problem: The marshaller, uses outTypeList to determine the way to convert
>> the Message body to Json. If in the above example, the request was "FALSE",
>> the marshaller (I am using Jackson) tries to marshall a String to a
>> MyPojoForSomething.class.
>>
>> The content of the String I have constructed for the error is in this case:
>> "Missing properties in HTTP Header."
>>
>> This results in an error:
>> com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Missing':
>> was expecting ('true', 'false' or 'null')
>>  at [Source: java.io.ByteArrayInputStream@67618968; line: 1, column: 9]
>> at
>> com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1419)
>> 
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Rest-DSL-OutType-in-case-of-error-message-problem-tp5759864.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/



-- 
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: JMS Put to WebsphereMQ destionation using a Qmgr name - how to specify?

2014-12-02 Thread clinton
Unfortunately, that only controls which Qmgr I am connected to.
If I want to send messages through that one to other Qmgrs, that has to be
specified at the point of the send of the message.  Just like email.  You
connect to your "local" email server, but then send to people both local and
remote to it.



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Put-to-WebsphereMQ-destionation-using-a-Qmgr-name-how-to-specify-tp5759882p5759945.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Problem with getting SOAP Header from response for spring-ws

2014-12-02 Thread hanusto
Hello,

we have problem with getting SOAP Header
(SpringWebserviceConstants.SPRING_WS_SOAP_HEADER) from response. For
communication we use spring-ws.

Response looks like:

http://schemas.xmlsoap.org/soap/envelope/";
xmlns:test="http://www.test.com";>
   
  asdasdasd
   
   
  
   


when we call
exchange.getIn().getHeader(SpringWebserviceConstants.SPRING_WS_SOAP_HEADER),
we retrieve SOAP Header for request, no for response. In source code of
spring-ws component I see that this is not at all solved. Please is there
any solution how to get SOAP Header from response?

Tomas





--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-getting-SOAP-Header-from-response-for-spring-ws-tp5759949.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RabbitMQ convert body

2014-12-02 Thread Marc Tudor
Hi,

I recently upgraded from using bluelock with camel 1.x to camel 2.14 and
rabbitmq component.

My route:
   public static class CustomRouteBuilder extends RouteBuilder {
   public static String toEndPoint =
"rabbitmq://localhost/someExchange?queue=queueName&routingKey=customKey&exchangeType=direct&durable=false&autoDelete=true";
@Override
public void configure() throws Exception {
  from("some route")
  .id("customId")
  .setExchangePattern(ExchangePattern.InOut)
  .unmarshal().json(JsonLibrary.Jackson, Firm.class)
  .to(toEndPoint );
   }

When I use this route i get the following exception:
org.apache.camel.InvalidPayloadException: No body available of type: byte[]
but has value: {Firm :{}}
I think the problem is when the route is trying to send to the toEndPoint.
It does the unmarshalling without problems.
The toEndPoint is the starting point for another route.
How can I configure the second route to take as body custom objects instead
of byte[]?

Thank you,
Tudor





--
View this message in context: 
http://camel.465427.n5.nabble.com/RabbitMQ-convert-body-tp5759955.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS Put to WebsphereMQ destionation using a Qmgr name - how to specify?

2014-12-02 Thread edhansen42
The 'remote' queue definition is actually defined on your local queue
manager, so what about just this?

  



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Put-to-WebsphereMQ-destionation-using-a-Qmgr-name-how-to-specify-tp5759882p5759954.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Why doesn't camel throw an error for invalid file or invalid ftp?

2014-12-02 Thread brianlmartino
What is wrong with my code?  I have tried two ways to get this to fail with
errors.  I am expecting camel to have a problem connecting to the bogus ftp
site and not finding the file in question.


== Using CamelContext and main method ===

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;

public class FtpCamelContext extends RouteBuilder  {

@Override
public void configure() throws Exception {
from("file://NoSuchFile.txt").
to("ftp://ftp.NoSuchDomain.com";);
}

public static void main (String[] args) throws Exception {
CamelContext camelContext = new DefaultCamelContext();
camelContext.addRoutes(new FtpCamelContext());
camelContext.start();
}
}

= Using Camel Main ===

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;

public class FtpCamelMain extends RouteBuilder {

private FtpCamelMain() {
}

@Override
public void configure() throws Exception {
from("file://NoSuchFile.txt").
  to("ftp://ftp.NoSuchDomain.com";);
}

public static void main(String[] args) throws Exception {
Main main = new Main();
main.addRouteBuilder(new FtpCamelMain());
main.enableHangupSupport();
main.start();
main.run();
}

Console output from Camel:

[simulators.FtpCamelMain.main()] MainSupportINFO  Apache
Camel 2.13.2 starting
[simulators.FtpCamelMain.main()] DefaultCamelContextINFO  Apache
Camel 2.13.2 (CamelContext: camel-1) is starting
[simulators.FtpCamelMain.main()] ManagedManagementStrategy  INFO  JMX is
enabled
[simulators.FtpCamelMain.main()] DefaultTypeConverter   INFO  Loaded
178 type converters
[simulators.FtpCamelMain.main()] DefaultCamelContextINFO 
AllowUseOriginalMessage is enabled. If access to the original message is not
needed, then its recommended to turn this option off as it may improve
performance.
[simulators.FtpCamelMain.main()] DefaultCamelContextINFO 
StreamCaching is not in use. If using streams then its recommended to enable
stream caching. See more details at
http://camel.apache.org/stream-caching.html
[simulators.FtpCamelMain.main()] FtpEndpointDEBUG
Created FTPClient [connectTimeout: 1, soTimeout: 0, dataTimeout: 3]:
org.apache.commons.net.ftp.FTPClient@292f062b
[simulators.FtpCamelMain.main()] RemoteFileProducer DEBUG
Starting
[simulators.FtpCamelMain.main()] RemoteFileProducer TRACE
Starting producer: RemoteFileProducer[ftp://ftp.NoSuchDomain.com]
[simulators.FtpCamelMain.main()] DefaultCamelContextINFO  Route:
route1 started and consuming from: Endpoint[file://NoSuchFile.txt]
[simulators.FtpCamelMain.main()] DefaultCamelContextINFO  Total
1 routes, of which 1 is started.
[simulators.FtpCamelMain.main()] DefaultCamelContextINFO  Apache
Camel 2.13.2 (CamelContext: camel-1) started in 0.843 seconds



--
View this message in context: 
http://camel.465427.n5.nabble.com/Why-doesn-t-camel-throw-an-error-for-invalid-file-or-invalid-ftp-tp5759957.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic routing to a XSL file

2014-12-02 Thread sathiyaraja
Thanks Guru..

Its propertyName inside setProperty.. wrongly typed in this post.

I could able to log the property also.

Inside recipientlist i cant able to use any camel exchange
properties(headers or property). But i tried with xpath and its working fine
But in my case it should read from the property.

In stacktrace im getting cannot locate the file.

Warm regards,
Sathiya



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-routing-to-a-XSL-file-tp5759884p5759958.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel Websocket

2014-12-02 Thread Duong, Minh
Hi,
  Does Camel Websocket support Websocket JSR 356 API (JDK 7)?   If not, is 
there a plan to do that?  The current camel-websocket uses Jetty server but I 
need a websocket component that can be run in a container environment e.g. 
Jboss EAP 6.   Can Camel atmostphere-websocket do that?  What's the difference 
between Camel websocket and atmostsphere-websocket.  Thanks!


Re: Why doesn't camel throw an error for invalid file or invalid ftp?

2014-12-02 Thread brianlmartino
Using camel 2.0 , passing just a single file needs special syntax.  Camel
will ignore the route if the file isn't found.

@Override
public void configure() throws Exception {
from("file:.?fileName=pom.xml").
to("ftp://noone@nowhere:22/wth?password=test";);
}

This post is now closed.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Why-doesn-t-camel-throw-an-error-for-invalid-file-or-invalid-ftp-tp5759957p5759963.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS Put to WebsphereMQ destionation using a Qmgr name - how to specify?

2014-12-02 Thread clinton
Realized that CamelJmsDestinationName will take the provider-specific format. 
Problem solved.



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Put-to-WebsphereMQ-destionation-using-a-Qmgr-name-how-to-specify-tp5759882p5759964.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS Put to WebsphereMQ destionation using a Qmgr name - how to specify?

2014-12-02 Thread clinton
Thank you for responding edhansen42 and Henrique

ed, if a "remote q def" is setup on the local qmgr, you are right that I
would not need to reference the remote queue manager name.  However, that
requires admin activity on the local qmgr to keep it in sync with the remote
one, and worse, usually these queue names (for reply-to type process) are
dynamic, so an admin action isn't feasible.  WMQ will route anything it
doesn't see a home for locally, to the "transmit" queue that carries a name
matching the Qmgr I indicate.  This transmit queue is the staging for the
connection to the target qmgr, which will actually enqueue the msg to the
queue I name.
thanks again.



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Put-to-WebsphereMQ-destionation-using-a-Qmgr-name-how-to-specify-tp5759882p5759965.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel kafka - provider no partition key

2014-12-02 Thread tapdur
Hi,

i use the camel-kafka component and when i send a message to a topic it
raise an error :No partition key set.   
t is due to the new api of the component. on the wiki page there is a sample
for the consumer xml dsl but 
none for the provider, 



any idea ?

thx
Best Regards
Bruno 



Message History
---
RouteId  ProcessorId  Processor 
  
Elapsed (ms)
[route7] [route7]
[servlet:///customers/neworder?httpMethodRestrict=POST
] [10]
[route7] [restBinding3  ] [ 

] [ 3]
[route7] [to4   ] [direct:customerNewOrder  

] [ 4]
[route3] [log1  ] [log  

] [ 1]
[route3] [to1   ]
[kafka:localhost:9092?topic=orders&zookeeperHost=localhost&zookeeperPort=2181 
] [ 2]

Exchange
---
Exchange[
Id  ID-P-7ZZ3CGBI-58294-1417540637830-1-2
ExchangePattern InOut
Headers {accept=*/*, accept-encoding=gzip,deflate,sdch,
accept-language=fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4,
breadcrumbId=ID-P-7ZZ3CGBI-58294-1417540637830-1-1,
CamelHttpCharacterEncoding=UTF-8, CamelHttpMethod=POST, CamelHttpPath=,
CamelHttpQuery=null,
CamelHttpServletRequest=org.apache.catalina.connector.RequestFacade@1350201,
CamelHttpServletResponse=org.apache.catalina.connector.ResponseFacade@116b42c,
CamelHttpUri=/customers/neworder,
CamelHttpUrl=http://localhost:8080/customers/neworder,
CamelRedelivered=false, CamelRedeliveryCounter=0,
CamelServletContextPath=/customers/neworder, connection=keep-alive,
content-length=55, Content-Type=application/json,
cookie=_pk_id.2.1fff=026a212c399ad03f.1410797639.15.1411684275.1411681543.,
dnt=1, host=localhost:8080,
origin=chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo,
user-agent=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/35.0.1916.153 Safari/537.36}
BodyTypeorg.apache.camel.converter.stream.InputStreamCache
Body[Body is instance of org.apache.camel.StreamCache]
]

Stacktrace
---

org.apache.camel.CamelExchangeException: No partition key set.
Exchange[Message: [Body is instance of org.apache.camel.StreamCache]]
at
org.apache.camel.component.kafka.KafkaProducer.process(KafkaProducer.java:67)




 



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-kafka-provider-no-partition-key-tp5759971.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Websphere MQ setting targetClient=1

2014-12-02 Thread barry.barnett
Being that Camel is using the JMS API to write a message to an MQ queue, MQ 
will use the RHQ2 header to store information about the message, etc.  However, 
the reading app is a non-JMS app, which cannot read the RFH2 header.  We would 
like to strip the header by utilizing the targetClient=MQ in our put call, but 
this isn't working.  We tried targetClient=1 as well and this failed.  Any 
ideas on what we need to do to configure Camel?

Regards,

Barry Barnett



Re: Websphere MQ setting targetClient=1

2014-12-02 Thread Andrew Block
Barry,

You can use a DestinationResolver to accomplish this. 

An example of this is found in the JMS component documentation in the section 
"Setting JMS provider options on the destination"

http://camel.apache.org/jms.html

- Andy

-- 
Andrew Block
On December 2, 2014 at 11:38:16 AM, barry.barn...@wellsfargo.com 
(barry.barn...@wellsfargo.com) wrote:

Being that Camel is using the JMS API to write a message to an MQ queue, MQ 
will use the RHQ2 header to store information about the message, etc. However, 
the reading app is a non-JMS app, which cannot read the RFH2 header. We would 
like to strip the header by utilizing the targetClient=MQ in our put call, but 
this isn't working. We tried targetClient=1 as well and this failed. Any ideas 
on what we need to do to configure Camel?  

Regards,  

Barry Barnett  



RE: Websphere MQ setting targetClient=1

2014-12-02 Thread barry.barnett
We made this change in the route and it works to remove the RFH header now:


  
  
  
  queue:///qname?targetClient=1
  


On the MQ queue, you can also set the propctl to NONE, and that will strip the 
header as well.


Regards,

Barry

From: Andrew Block [mailto:andy.bl...@gmail.com]
Sent: Tuesday, December 02, 2014 1:37 PM
To: users@camel.apache.org; Barnett, Barry F
Cc: Myers, Tom T
Subject: Re: Websphere MQ setting targetClient=1

Barry,

You can use a DestinationResolver to accomplish this.

An example of this is found in the JMS component documentation in the section 
"Setting JMS provider options on the destination"

http://camel.apache.org/jms.html

- Andy

--
Andrew Block

On December 2, 2014 at 11:38:16 AM, barry.barn...@wellsfargo.com 
(barry.barn...@wellsfargo.com) wrote:
Being that Camel is using the JMS API to write a message to an MQ queue, MQ 
will use the RHQ2 header to store information about the message, etc. However, 
the reading app is a non-JMS app, which cannot read the RFH2 header. We would 
like to strip the header by utilizing the targetClient=MQ in our put call, but 
this isn't working. We tried targetClient=1 as well and this failed. Any ideas 
on what we need to do to configure Camel?

Regards,

Barry Barnett


Getting over the Performance Hump with Camel @Ticketmaster

2014-12-02 Thread rodneypbarlow
We've launched a new post on our Ticketmaster tech blog regarding our
performance improvements with Camel integrations, specifically Camel's
transform API and Spring DSLs:

http://tech.ticketmaster.com/2014/12/01/getting-over-the-performance-hump-with-apache-camel/

  

Hope you enjoy!

Rod.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Getting-over-the-Performance-Hump-with-Camel-Ticketmaster-tp5759991.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: rest client - post a json content to and http enpoint

2014-12-02 Thread salemi
I have two questions:

How can implement basic authentication?

Is there a way to accept all certificates using HTTPS protocol?

Ali



-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/rest-client-post-a-json-content-to-and-http-enpoint-tp5759600p5759988.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel - xsd

2014-12-02 Thread smilevasu6
Hi All,

I have created one router to read the xsd and to fetch the element name
(table) and load the txt file data into the table.

But its not giving me any error and the data not inserted into table.

Please advice.

Here is router

from("timer://foo?period=6")


.bean(TestDemo.class,"parseElement(/home/cloudera/Desktop/Sample.xsd)")

.to("mock:abc")
.setHeader("tablename", simple("abc")).

// setBody(constant("load data local inpath 
'/sri/address.txt' OVERWRITE
into table ${in.header.tablename}")).


setBody(constant("load data  local inpath 
'/sri/address.txt' OVERWRITE
into table abc"))
.end();



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


Camel file2 - get notified when the file is deleted from a directory in the idempontent mode

2014-12-02 Thread salemi
Hi,

is it possible to get notified when the file is deleted from a directory in
the idempotent mode

Thanks,
Ali



-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-file2-get-notified-when-the-file-is-deleted-from-a-directory-in-the-idempontent-mode-tp5760003.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel - xsd

2014-12-02 Thread smilevasu6
Any one there to help on this issue
pleaseee??



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


Re: camel - xsd

2014-12-02 Thread Claus Ibsen
Hi

You should use simple language instead of constant if you want to
refer to headers with ${ } etc
http://camel.apache.org/simple

On Wed, Dec 3, 2014 at 4:51 AM, smilevasu6  wrote:
> Hi All,
>
> I have created one router to read the xsd and to fetch the element name
> (table) and load the txt file data into the table.
>
> But its not giving me any error and the data not inserted into table.
>
> Please advice.
>
> Here is router
>
> from("timer://foo?period=6")
>
> 
> .bean(TestDemo.class,"parseElement(/home/cloudera/Desktop/Sample.xsd)")
>
> .to("mock:abc")
> .setHeader("tablename", simple("abc")).
>
> // setBody(constant("load data local inpath 
> '/sri/address.txt' OVERWRITE
> into table ${in.header.tablename}")).
>
>
> setBody(constant("load data  local inpath 
> '/sri/address.txt' OVERWRITE
> into table abc"))
> .end();
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-xsd-tp576.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: Camel file2 - get notified when the file is deleted from a directory in the idempontent mode

2014-12-02 Thread Claus Ibsen
Hi

What do you mean? Do you mean that some 3rd party delete a file, and
you want Camel to "notify" about this event?

If so then no. But you can use the java api to get file notifications.
Java 7 has the new api for that.

On Wed, Dec 3, 2014 at 5:54 AM, salemi  wrote:
> Hi,
>
> is it possible to get notified when the file is deleted from a directory in
> the idempotent mode
>
> Thanks,
> Ali
>
>
>
> -
> Alireza Salemi
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-file2-get-notified-when-the-file-is-deleted-from-a-directory-in-the-idempontent-mode-tp5760003.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/


ACK and NAK using MINA Component

2014-12-02 Thread madhuri@atrium
Hi,

I am new to socket programming as well as camel. Here is the flow I want to
implement. Please guide me to appropriate documentation.

I am using MINA component to do InOut communication over TCPIP port.

I am writing a client to send request to TCPIP port. 
Once the request is received, the server listening on the port is to send
ACK back.  
After the ACK, the server is to send the response back to client.(my
application).
After client receives response, and the response is valid, client sends ACK
back to the server.
After client receives response, and the response is not valid, client sends
NAK back to the server.

I am not very clear on how to configure MINA to do this for me. Any help
will be greatly appreciated.

Madhuri



--
View this message in context: 
http://camel.465427.n5.nabble.com/ACK-and-NAK-using-MINA-Component-tp5760006.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel - xsd

2014-12-02 Thread smilevasu6
Hi Claus,

i used this 

 setBody(constant("load data local inpath '/sri/address.txt' OVERWRITE into
table ${in.header.tablename}"))

but still its not finding the table name.

Please help 



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


Re: camel - xsd

2014-12-02 Thread Claus Ibsen
 setBody(simple("load data local inpath '/sri/address.txt' OVERWRITE into
table ${in.header.tablename}"))

On Wed, Dec 3, 2014 at 7:43 AM, smilevasu6  wrote:
> Hi Claus,
>
> i used this
>
>  setBody(constant("load data local inpath '/sri/address.txt' OVERWRITE into
> table ${in.header.tablename}"))
>
> but still its not finding the table name.
>
> Please help
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-xsd-tp576p5760009.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: camel - xsd

2014-12-02 Thread smilevasu6
Claus, see the console,


Dec 02, 2014 10:46:19 PM
org.springframework.jdbc.datasource.DriverManagerDataSource
setDriverClassName
INFO: Loaded JDBC driver: org.apache.hive.jdbc.HiveDriver
%%CamelContext(camel-1)
%%Routes: []
22:46:19.634 [main] DEBUG o.a.camel.impl.DefaultCamelContext - Adding routes
from builder: Routes: []
22:46:19.746 [main] INFO  o.a.camel.impl.DefaultCamelContext - Apache Camel
2.12.5 (CamelContext: camel-1) is starting
22:46:19.747 [main] DEBUG o.a.camel.impl.DefaultCamelContext - Using
ClassResolver=org.apache.camel.impl.DefaultClassResolver@c299bbd,
PackageScanClassResolver=org.apache.camel.impl.DefaultPackageScanClassResolver@7faf9b87,
ApplicationContextClassLoader=sun.misc.Launcher$AppClassLoader@15e565bd
22:46:19.748 [main] INFO  o.a.c.m.ManagedManagementStrategy - JMX is enabled
22:46:19.748 [main] DEBUG o.a.c.m.DefaultManagementAgent - Starting JMX
agent on server: com.sun.jmx.mbeanserver.JmxMBeanServer@301f417
22:46:19.937 [main] DEBUG o.a.c.m.DefaultManagementAgent - Registered MBean
with ObjectName:
org.apache.camel:context=quickstart.cloudera/camel-1,type=context,name="camel-1"
22:46:19.938 [main] DEBUG o.a.c.support.TimerListenerManager - Added
TimerListener: org.apache.camel.management.mbean.ManagedCamelContext@ce0d675
22:46:19.998 [main] DEBUG o.a.c.m.DefaultManagementAgent - Registered MBean
with ObjectName:
org.apache.camel:context=quickstart.cloudera/camel-1,type=services,name=DefaultTypeConverter
22:46:20.014 [main] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - Found 3
packages with 15 @Converter classes to load
22:46:20.098 [main] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - Loading
file META-INF/services/org/apache/camel/TypeConverter to retrieve list of
packages, from url:
jar:file:/home/cloudera/Desktop/sri_share/Camel-Jars/camel-context-2.12.5.jar!/META-INF/services/org/apache/camel/TypeConverter
22:46:20.100 [main] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - Loading
file META-INF/services/org/apache/camel/TypeConverter to retrieve list of
packages, from url:
jar:file:/home/cloudera/Desktop/sri_share/Camel-Jars/camel-core-2.12.5.jar!/META-INF/services/org/apache/camel/TypeConverter
22:46:20.100 [main] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - Loading
file META-INF/services/org/apache/camel/TypeConverter to retrieve list of
packages, from url:
jar:file:/home/cloudera/Desktop/sri_share/Camel-Jars/camel-hbase-2.12.5.jar!/META-INF/services/org/apache/camel/TypeConverter
22:46:20.103 [main] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - Loading
file META-INF/services/org/apache/camel/TypeConverter to retrieve list of
packages, from url:
jar:file:/home/cloudera/Desktop/sri_share/Camel-Jars/camel-spring-2.12.5.jar!/META-INF/services/org/apache/camel/TypeConverter
22:46:20.129 [main] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - Loaded 3
@Converter classes
22:46:20.130 [main] WARN  o.a.c.i.c.DefaultTypeConverter - Overriding type
converter from: StaticMethodTypeConverter: public static byte[]
org.apache.camel.converter.IOConverter.toByteArray(java.lang.String,org.apache.camel.Exchange)
throws java.io.IOException to: StaticMethodTypeConverter: public static
byte[]
org.apache.camel.component.hbase.converter.HBaseModelConverter.stringToBytes(java.lang.String)
22:46:20.132 [main] WARN  o.a.c.i.c.DefaultTypeConverter - Overriding type
converter from: StaticMethodTypeConverter: public static java.lang.String
org.apache.camel.converter.IOConverter.toString(byte[],org.apache.camel.Exchange)
throws java.io.IOException to: StaticMethodTypeConverter: public static
java.lang.String
org.apache.camel.component.hbase.converter.HBaseModelConverter.bytesToString(byte[])
22:46:20.137 [main] INFO  o.a.c.i.c.DefaultTypeConverter - Loaded 189 type
converters
22:46:20.180 [main] DEBUG o.a.c.m.DefaultManagementAgent - Registered MBean
with ObjectName:
org.apache.camel:context=quickstart.cloudera/camel-1,type=services,name=EndpointRegistry
22:46:20.189 [main] DEBUG o.a.c.m.DefaultManagementAgent - Registered MBean
with ObjectName:
org.apache.camel:context=quickstart.cloudera/camel-1,type=services,name=DefaultExecutorServiceManager
22:46:20.202 [main] DEBUG o.a.c.m.DefaultManagementAgent - Registered MBean
with ObjectName:
org.apache.camel:context=quickstart.cloudera/camel-1,type=services,name=SharedProducerServicePool
22:46:20.208 [main] DEBUG o.a.c.impl.SharedProducerServicePool - Starting
service pool: org.apache.camel.impl.SharedProducerServicePool@7acd381
22:46:20.213 [main] DEBUG o.a.c.m.DefaultManagementAgent - Registered MBean
with ObjectName:
org.apache.camel:context=quickstart.cloudera/camel-1,type=services,name=DefaultInflightRepository
22:46:20.224 [main] DEBUG o.a.c.m.DefaultManagementAgent - Registered MBean
with ObjectName:
org.apache.camel:context=quickstart.cloudera/camel-1,type=services,name=DefaultShutdownStrategy
22:46:20.230 [main] DEBUG o.a.c.m.DefaultManagementAgent - Registered MBean
with ObjectName:
org.apache.camel:context=quickstart.

Re: Camel Websocket

2014-12-02 Thread Claus Ibsen
Hi

I would assume atmosphere would support that JSR. You can check out its website.

camel-websocket was the first websocket component and its using Jetty,
and that was not JSR compliant back then.
So for JBoss EAP or Tomcat or other containers I would use atomosphere.

But there is also a new camel-ahc-ws that use AHC / Netty and websocket.
http://camel.apache.org/ahc-ws

On Tue, Dec 2, 2014 at 5:18 PM, Duong, Minh  wrote:
> Hi,
>   Does Camel Websocket support Websocket JSR 356 API (JDK 7)?   If not, is 
> there a plan to do that?  The current camel-websocket uses Jetty server but I 
> need a websocket component that can be run in a container environment e.g. 
> Jboss EAP 6.   Can Camel atmostphere-websocket do that?  What's the 
> difference between Camel websocket and atmostsphere-websocket.  Thanks!



-- 
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: Getting over the Performance Hump with Camel @Ticketmaster

2014-12-02 Thread Claus Ibsen
Hi

Thanks for sharing your findings.

I have logged a ticket to look into if we can improve this in camel-core
https://issues.apache.org/jira/browse/CAMEL-8113

And potential in camel-cxf as that MessageContextList is a "pain".

On Wed, Dec 3, 2014 at 1:12 AM, rodneypbarlow  wrote:
> We've launched a new post on our Ticketmaster tech blog regarding our
> performance improvements with Camel integrations, specifically Camel's
> transform API and Spring DSLs:
>
> http://tech.ticketmaster.com/2014/12/01/getting-over-the-performance-hump-with-apache-camel/
> 
>
> Hope you enjoy!
>
> Rod.
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Getting-over-the-Performance-Hump-with-Camel-Ticketmaster-tp5759991.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: camel kafka - provider no partition key

2014-12-02 Thread Claus Ibsen
Hi

You can try take a look in the unit tests of camel-kafka and see how
the producer works there.
But there may indeed be a mistake in the code or the documentation
page. If that is the case, you are welcome to log a JIRA

On Tue, Dec 2, 2014 at 6:26 PM, tapdur  wrote:
> Hi,
>
> i use the camel-kafka component and when i send a message to a topic it
> raise an error :No partition key set.
> t is due to the new api of the component. on the wiki page there is a sample
> for the consumer xml dsl but
> none for the provider,
>
>  uri="kafka:localhost:9092?topic=orders&zookeeperHost=localhost&zookeeperPort=2181&groupId=orders"/>
>
> any idea ?
>
> thx
> Best Regards
> Bruno
>
>
>
> Message History
> ---
> RouteId  ProcessorId  Processor
> Elapsed (ms)
> [route7] [route7]
> [servlet:///customers/neworder?httpMethodRestrict=POST
> ] [10]
> [route7] [restBinding3  ] [
> ] [ 3]
> [route7] [to4   ] [direct:customerNewOrder
> ] [ 4]
> [route3] [log1  ] [log
> ] [ 1]
> [route3] [to1   ]
> [kafka:localhost:9092?topic=orders&zookeeperHost=localhost&zookeeperPort=2181
> ] [ 2]
>
> Exchange
> ---
> Exchange[
> Id  ID-P-7ZZ3CGBI-58294-1417540637830-1-2
> ExchangePattern InOut
> Headers {accept=*/*, accept-encoding=gzip,deflate,sdch,
> accept-language=fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4,
> breadcrumbId=ID-P-7ZZ3CGBI-58294-1417540637830-1-1,
> CamelHttpCharacterEncoding=UTF-8, CamelHttpMethod=POST, CamelHttpPath=,
> CamelHttpQuery=null,
> CamelHttpServletRequest=org.apache.catalina.connector.RequestFacade@1350201,
> CamelHttpServletResponse=org.apache.catalina.connector.ResponseFacade@116b42c,
> CamelHttpUri=/customers/neworder,
> CamelHttpUrl=http://localhost:8080/customers/neworder,
> CamelRedelivered=false, CamelRedeliveryCounter=0,
> CamelServletContextPath=/customers/neworder, connection=keep-alive,
> content-length=55, Content-Type=application/json,
> cookie=_pk_id.2.1fff=026a212c399ad03f.1410797639.15.1411684275.1411681543.,
> dnt=1, host=localhost:8080,
> origin=chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo,
> user-agent=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
> like Gecko) Chrome/35.0.1916.153 Safari/537.36}
> BodyTypeorg.apache.camel.converter.stream.InputStreamCache
> Body[Body is instance of org.apache.camel.StreamCache]
> ]
>
> Stacktrace
> ---
>
> org.apache.camel.CamelExchangeException: No partition key set.
> Exchange[Message: [Body is instance of org.apache.camel.StreamCache]]
> at
> org.apache.camel.component.kafka.KafkaProducer.process(KafkaProducer.java:67)
>
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-kafka-provider-no-partition-key-tp5759971.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: camel - xsd

2014-12-02 Thread smilevasu6
i given that only claus

 setBody(simple("load data local inpath '/sri/address.txt' OVERWRITE into 
table ${in.header.tablename}"))

its not loading into table



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