Re: WebSocket Jetty on the same port at the same time?

2014-08-27 Thread Charles Moulliard
Hi Deven,

As we are using 2 different camel components to expose the websocket and
jetty servers, then you can't use the same port between the 2 components.
But you can imagine to share also your web code with the websocket
component like I have done here  :

https://github.com/FuseByExample/websocket-activemq-camel/tree/master/camel-ws/src/main/resources/webapp
https://github.com/FuseByExample/websocket-activemq-camel/blob/master/camel-ws/src/main/java/com/fusesource/examples/camel/websocket/WebSocketStockPricesRoute.java
https://github.com/FuseByExample/websocket-activemq-camel#camel

WebServer  WebSocket use the same port : 9090 !

Regards,

Charles


On Tue, Aug 26, 2014 at 11:05 PM, Deven Phillips deven.phill...@gmail.com
wrote:

 I have seen some discussions elsewhere, but I was hoping I could get a
 definitive answer here:

 Is it possible to have a camel-websocket endpoint listening with a URL
 like:

 websocket://localhost:2080/replication

 AND also have a camel-jetty endpoint listening with a URL like:

 jetty://http://localhost:2080/rest/;

 When I have tried to accomplish this, I get an error that the port is
 already in use. Is there a way to make this work?

 Thanks in advance!

 Deven




-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io


Re: Camel Netty component bind failure

2014-08-27 Thread edmondo1984
I am extending the BaseNettyTest. I forked the git repo and checked out the
2.13.2 tag

public class NettyCustomLocalPortProducerTest extends BaseNettyTest {

@Test
public void routeFails() throws Exception{
template.sendBody(direct:testEndpoint, Hello world);
}

protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {

from(direct:testEndPoint).to(netty:tcp://
www.google.com:80);

}
};
}
}

Hopefully once I will be able to run this I can contribute myself with the
fix to use a different port :))

Best




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755751.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Netty component bind failure

2014-08-27 Thread Willem Jiang
You used different direct endpoint name.
The first one is “direct:testEndpoint” and the second one is 
“direct:testEndPoint”.
You should use the same direct endpoint name here. 

--  
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 August 27, 2014 at 2:56:58 PM, edmondo1984 (edmondo.po...@gmail.com) wrote:
 I am extending the BaseNettyTest. I forked the git repo and checked out the
 2.13.2 tag
  
 public class NettyCustomLocalPortProducerTest extends BaseNettyTest {
  
 @Test
 public void routeFails() throws Exception{
 template.sendBody(direct:testEndpoint, Hello world);
 }
  
 protected RouteBuilder createRouteBuilder() {
 return new RouteBuilder() {
 public void configure() {
  
 from(direct:testEndPoint).to(netty:tcp://
 www.google.com:80);
  
 }
 };
 }
 }
  
 Hopefully once I will be able to run this I can contribute myself with the
 fix to use a different port :))
  
 Best
  
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755751.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.



Request-reply concurrency with jms in older Camel versions

2014-08-27 Thread Pointless
Hello,

I have a problem with concurrently sending messages to InOut jms destination
and processing replies using Camel 2.6.0. I cannot upgrade because of java
1.5. As I undestand, in such case there is only 1 consumer listening for the
replies. I tried using thread dsl, but it didn't help, probably because
there is still only 1 DefaultMessageListenerContainer which listens for the
replies sinchronously and thread dsl creates threads only for processing
those replies afterwards, am I right?

My route:
camel:route id=esbDirectRoute
camel:from uri=direct:esbRoute/
camel:setExchangePattern pattern=InOut /

camel:to uri=log:beforeSendingToEsb/
camel:to
uri=jmsIBM:queue:REQ_QUEUE?exchangePattern=InOutamp;timeToLive=6amp;requestTimeout=6amp;receiveTimeout=100amp;concurrentConsumers=20amp;maxConcurrentConsumers=20
/
camel:threads poolSize=20 maxPoolSize=20 
threadName=esb-pool-thread
camel:to uri=log:afterSendingToEsb/
/camel:threads
/camel:route

There are multiple threads calling this route. When testing with only 1
working  thread the time between 2 log statemments is 1-2 s (jms provider
system response time). When there are many threads like 10-20 - time between
log statements increases up to 15 s. Here is log showing the start of this
test:
2014-08-27 10:26:22 INFO beforeSendingToEsb
2014-08-27 10:26:22 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:23 INFO beforeSendingToEsb
2014-08-27 10:26:24 INFO afterSendingToEsb 
2014-08-27 10:26:24 INFO beforeSendingToEsb
2014-08-27 10:26:25 INFO afterSendingToEsb
2014-08-27 10:26:26 INFO beforeSendingToEsb
2014-08-27 10:26:26 INFO afterSendingToEsb
2014-08-27 10:26:27 INFO beforeSendingToEsb
2014-08-27 10:26:28 INFO afterSendingToEsb
2014-08-27 10:26:28 INFO beforeSendingToEsb
...

Is there any way to use concurrent response listener with Camel 1.6.0? Any
way to control how Camel creates
org.springframework.jms.listener.DefaultMessageListenerContainer or
org.springframework.jms.listener.SimpleMessageListenerContainer in this
case?

Excerpt from camel jms docs:
Camel will automatic setup a consumer which listen on the reply queue, so
you should not do anything.
This consumer is a Spring DefaultMessageListenerContainer which listen for
replies. However it's fixed to 1 concurrent consumer.
That means replies will be processed in sequence as there are only 1 thread
to process the replies. If you want to process replies faster, then we need
to use concurrency. But not using the concurrentConsumer option. We should
use the threads from the Camel DSL instead

Seems that this issue is addressed in Camel 2.10.3:
Allows to process reply messages concurrently using concurrent message
listeners in use. You can specify a range using the concurrentConsumers and
maxConcurrentConsumers options. Notice: That using Shared reply queues may
not work as well with concurrent listeners, so use this option with care.

Thank you,
Igor



--
View this message in context: 
http://camel.465427.n5.nabble.com/Request-reply-concurrency-with-jms-in-older-Camel-versions-tp5755769.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Came 2.13.1 Reading ZipInputStream EOFException

2014-08-27 Thread sandp
Hi Ibsen,
I created a ticket and attached path at  CAMEL-7757
https://issues.apache.org/jira/browse/CAMEL-7757  



--
View this message in context: 
http://camel.465427.n5.nabble.com/Came-2-13-1-Reading-ZipInputStream-EOFException-tp5755726p5755779.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Came 2.13.1 Reading ZipInputStream EOFException

2014-08-27 Thread sage . es


Enviado desde mi smartphone BlackBerry 10.
  Mensaje original  
De: sandp
Enviado: miércoles, 27 de agosto de 2014 14:42
Para: users@camel.apache.org
Responder a: users@camel.apache.org
Asunto: Re: Came 2.13.1 Reading ZipInputStream EOFException

Hi Ibsen,
I created a ticket and attached path at CAMEL-7757
https://issues.apache.org/jira/browse/CAMEL-7757 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Came-2-13-1-Reading-ZipInputStream-EOFException-tp5755726p5755779.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: HTTP Unspecified length

2014-08-27 Thread Claus Ibsen
How much data are we talking about, as you can get the data and then
use the splitter.

On Wed, Aug 27, 2014 at 5:12 PM, Mark Webb elihusma...@gmail.com wrote:
 I would like to pull data from a webserver has an unknown length.  I send
 the server a GET command and it sends data continuously, each record on a
 separate line.  I would like each record in a separate Camel exchange.  Not
 sure if this is allowed in the HTTP spec, but the server does this.

 Is there a way to handle this using a Camel endpoint?  This could be done
 using a custom Netty handler, but I'd rather use and existing component.

 Thank you,
 Mark



-- 
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 Unspecified length

2014-08-27 Thread Mark Webb
It will go on forever.  You connect, send a GET and it streams data to
you.

There are no headers sent.




On Wed, Aug 27, 2014 at 11:22 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 How much data are we talking about, as you can get the data and then
 use the splitter.

 On Wed, Aug 27, 2014 at 5:12 PM, Mark Webb elihusma...@gmail.com wrote:
  I would like to pull data from a webserver has an unknown length.  I send
  the server a GET command and it sends data continuously, each record on a
  separate line.  I would like each record in a separate Camel exchange.
 Not
  sure if this is allowed in the HTTP spec, but the server does this.
 
  Is there a way to handle this using a Camel endpoint?  This could be done
  using a custom Netty handler, but I'd rather use and existing component.
 
  Thank you,
  Mark



 --
 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 Unspecified length

2014-08-27 Thread Peter Hicks

Hi Mark

On 27/08/14 16:12, Mark Webb wrote:

I would like to pull data from a webserver has an unknown length.  I send
the server a GET command and it sends data continuously, each record on a
separate line.  I would like each record in a separate Camel exchange.  Not
sure if this is allowed in the HTTP spec, but the server does this.

Is there a way to handle this using a Camel endpoint?  This could be done
using a custom Netty handler, but I'd rather use and existing component.
This appears similar to something I posted about a while ago at 
http://camel.465427.n5.nabble.com/Processing-data-from-a-long-lived-HTTP-streaming-URL-td5753758.html 
- but I never found a solution to it.



Peter



No web.xml CamelHttpTransportServlet configuration with Spring Java Config

2014-08-27 Thread nickwong
Hey guys,

Tomcat 7
Java 7
Camel 2.13.2
Spring 4.0.6

Spring Java Config enthusiast here. I am just starting out with Camel and
I'd like to keep my projects as XML free as possible. I'm planning on doing
an HTTP endpoint in the project and I've got a web.xml setting up the
CamelHttpTransportServlet and a WebApplicationInitializer setting up the
Spring Context through java config config scan. It's possible with Spring to
setup a Dispatcher Servlet and add it dynamically in the
WebApplicationInitializer, but setting up the CamelHttpTransportServlet
requires a ServletConfig class. I set some of this stuff up, but ran into
issues with the ContextLoaderListener trying to kick off Spring after the
servlet initialized it already, then had other issues getting the Spring
context to refresh at the right lifecycle so the servlet was part of the
spring context, etc. 

Anyway, I figured I'd just ask if anyone had successfully gotten this
working with Spring (since I'm having trouble finding any documentation on
this).

Code snipit in WebApplicationInitializer:

@Override
public void onStartup(final ServletContext servletContext) throws
ServletException {

...

CamelHttpTransportServlet camelHttpTransportServlet = new
CamelHttpTransportServlet();
camelHttpTransportServlet.init(new ServletConfig() {
@Override
public String getServletName() {
return CamelServlet;
}

@Override
public ServletContext getServletContext() {
return servletContext;
}

@Override
public String getInitParameter(final String s) {
return null;
}

@Override
public EnumerationString getInitParameterNames() {
return null;
}
});

// Create a new Servlet so we can listen for requests
ServletRegistration.Dynamic appServlet = servletContext.addServlet(
CamelServlet,
camelHttpTransportServlet );

// Listen for request patterns
appServlet.addMapping(SERVLET_MAPPING);




--
View this message in context: 
http://camel.465427.n5.nabble.com/No-web-xml-CamelHttpTransportServlet-configuration-with-Spring-Java-Config-tp5755790.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Netty component bind failure

2014-08-27 Thread edmondo1984
Thanks, how stupid. Now that I am trying a tcp connection on port 80, I get
the following:

2014-08-27 21:26:41,968 [el Thread #1 - NettyClientTCPWorker] ERROR
DefaultErrorHandler- Failed delivery for (MessageId:
ID-mbp-di-edmondo-54810-1409171153699-0-1 on ExchangeId:
ID-mbp-di-edmondo-54810-1409171153699-0-2). Exhausted after delivery
attempt: 1 caught: org.apache.camel.CamelExchangeException: No response
received from remote server: www.google.com:80. Exchange[Message: GET
index.htm]

Message History
---
RouteId  ProcessorId  Processor
   Elapsed (ms)
[route1] [route1] [direct://testEndPoint
  ] [ 44118]
[route1] [to1   ] [netty:tcp://
www.google.com:80?requestTimeout=1000 ] [
44113]

Exchange
---
Exchange[
Id  ID-mbp-di-edmondo-54810-1409171153699-0-2
ExchangePattern InOnly
Headers
{breadcrumbId=ID-mbp-di-edmondo-54810-1409171153699-0-1,
CamelRedelivered=false, CamelRedeliveryCounter=0}
BodyTypeString
BodyGET index.htm
]

Stacktrace
---
org.apache.camel.CamelExchangeException: No response received from remote
server: www.google.com:80. Exchange[Message: GET index.htm]
at
org.apache.camel.component.netty.handlers.ClientChannelHandler.channelClosed(ClientChannelHandler.java:118)
at
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:88)
at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss

Can you please advice? I tried to connect through telnet on port 80 and
perform a GET index.htm on my mac and worked

thank you





2014-08-27 9:23 GMT+01:00 Willem.Jiang [via Camel] 
ml-node+s465427n5755760...@n5.nabble.com:

 You used different direct endpoint name.
 The first one is “direct:testEndpoint” and the second one is
 “direct:testEndPoint”.
 You should use the same direct endpoint name here.

 --
 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 August 27, 2014 at 2:56:58 PM, edmondo1984 ([hidden email]
 http://user/SendEmail.jtp?type=nodenode=5755760i=0) wrote:

  I am extending the BaseNettyTest. I forked the git repo and checked out
 the
  2.13.2 tag
 
  public class NettyCustomLocalPortProducerTest extends BaseNettyTest {
 
  @Test
  public void routeFails() throws Exception{
  template.sendBody(direct:testEndpoint, Hello world);
  }
 
  protected RouteBuilder createRouteBuilder() {
  return new RouteBuilder() {
  public void configure() {
 
  from(direct:testEndPoint).to(netty:tcp://
  www.google.com:80);
 
  }
  };
  }
  }
 
  Hopefully once I will be able to run this I can contribute myself with
 the
  fix to use a different port :))
 
  Best
 
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755751.html

  Sent from the Camel - Users mailing list archive at Nabble.com.



 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755760.html
  To unsubscribe from Camel Netty component bind failure, click here
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5755683code=ZWRtb25kby5wb3JjdUBnbWFpbC5jb218NTc1NTY4M3w1ODk2MDQ2MzY=
 .
 NAML
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml





--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755791.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: HTTP Unspecified length

2014-08-27 Thread Mark Webb
As a bandaid approach, I'm using wget along with netcat to a Camel Netty
endpoint.  It's working for now :)


On Wed, Aug 27, 2014 at 1:50 PM, Peter Hicks peter.hi...@poggs.co.uk
wrote:

 Hi Mark


 On 27/08/14 16:12, Mark Webb wrote:

 I would like to pull data from a webserver has an unknown length.  I send
 the server a GET command and it sends data continuously, each record on a
 separate line.  I would like each record in a separate Camel exchange.
 Not
 sure if this is allowed in the HTTP spec, but the server does this.

 Is there a way to handle this using a Camel endpoint?  This could be done
 using a custom Netty handler, but I'd rather use and existing component.

 This appears similar to something I posted about a while ago at
 http://camel.465427.n5.nabble.com/Processing-data-from-a-
 long-lived-HTTP-streaming-URL-td5753758.html - but I never found a
 solution to it.


 Peter




RE: camel-cxfrs and AsyncResponse

2014-08-27 Thread Michael Bannii
Tried with synchronous=true, no change in behavior, hangs as earlier:

camel:camelContext id=camel
camel:route
camel:from 
uri=cxfrs://bean://testRsServer?bindingStyle=SimpleConsumer /
..
/camel:route
.
/camel:camelContext
camelcxf:rsServer id=testRsServer address=/1.0/main 
serviceClass=asynctest.MainResource
camelcxf:serviceBeans
ref bean=mainResourceBean/
/camelcxf:serviceBeans
camelcxf:providers
ref bean=jacksonProvider/
/camelcxf:providers
camelcxf:properties
entry key=synchronous value=true/
/camelcxf:properties
/camelcxf:rsServer


PS.
BTW I made a small issue-reproducing maven project and submitted it to the 
defect mentioned by Sergey: 
https://issues.apache.org/jira/secure/attachment/12664675/camel-async-response-test-that-hangs.zip



-Original Message-
From: Raul Kripalani [mailto:r...@evosent.com] 
Sent: 27 серпня 2014 р. 1:28
To: users@camel.apache.org
Subject: Re: camel-cxfrs and AsyncResponse

Hey Michael,

Can you try setting the 'synchronous' property to 'true' in the rsServer bean? 
This will force the component to take the sync execution path and circumvent 
using Continuations.

You need to use a cxf:properties / block. I don't have any examples handy and 
I cannot write source code now, but you'll find examples online.

Thanks,
Raúl.

Sent from my iPad

 On 26 Aug 2014, at 17:05, Michael Bannii michael.ban...@evry.com wrote:

 It appears I already have SelectChannelConnector set up in my pom.xml and 
 still have the issue...

 I use  jetty-maven-plugin 8.1.15.v20140411 with CXF 2.7.11 and Camel v2.13.2.
 The processing chain appears to be:  jetty - some filters - cxf - cxfrs - 
 camel.

 Also when I set a breakpoint inside my processor I see that a whole HTTP 
 thread gets blocked by it (which is probably not what I want, and I want to 
 arrange a threadless wait when calling backend in my processor), and in stack 
 there is
   CxfRsInvoker.performInvocation(Exchange, Object, Method, Object[]) 
 line: 56 and the continuation object there is an instance of 
 org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuation.
  So at least some Continuation is being used.


 -Original Message-
 From: Raul Kripalani [mailto:r...@evosent.com]
 Sent: 26 серпня 2014 р. 17:51
 To: users@camel.apache.org
 Subject: Re: camel-cxfrs and AsyncResponse

 I came across this issue recently and the culprit was the default 
 etc/jetty.xml configuration packaged with Apache ServiceMix, which by default 
 uses the BlockingChannelConnector, as explained in the inline XML comment.

 This connector does not support Jetty Continuations, therefore it is not 
 capable of handling an async response.

 You don't specify what runtime container you're using, but if you use Apache 
 ServiceMix or Apache Karaf with Pax Web you can be facing the same problem.

 If you swap the BlockingChannelConnector for a SelectChannelConnector, it 
 should work.

 Regards,

 *Raúl Kripalani*
 Apache Camel PMC Member  Committer | Enterprise Architect, Open 
 Source Integration specialist http://about.me/raulkripalani | 
 http://www.linkedin.com/in/raulkripalani
 http://blog.raulkr.net | twitter: @raulvk

 On Tue, Aug 26, 2014 at 3:21 PM, Michael Bannii 
 michael.ban...@evry.com
 wrote:

 Hi,

 I use camel-cxfrs with a JAX-RS2 resource java class having a method 
 declared in async way using AsyncResponse, like this:

camel:route
camel:from
 uri=cxfrs://bean://testRsServer?bindingStyle=SimpleConsumer /
.a code here that finally does 
 exchange.getOut().setBody(response);
/camel:route

camelcxf:rsServer id=testRsServer address=/test
 serviceClass=foo.bar.TestResource

@Path(/) @Produces({MediaType.APPLICATION_JSON})
public class TestResource {
@POST @Path(/something)
public void addAccount(@Multipart(value = myDomainObject) 
 final String myDomainObject, @Suspended final AsyncResponse ar) {
throw new RuntimeException(Camel does not call it anyway);
}
}


 When I invoke the resource, Camel invokes the route, however no REST 
 response is sent back to client for some reason... Looks like Camel 
 is not calling AsyncResponse.resume()?

 If I change the resource declaration to sync-way like below, i.e. 
 drop AsyncResponse and change response type from void to MyResponse, 
 then REST response is sent back as expected.

@POST @Path(/something)
public MyResponse addAccount(@Multipart(value =
 myDomainObject) final String myDomainObject) {
throw new RuntimeException(Camel does not call it anyway);
}

 Why is such behavior? Am I missing something?


 --
 Best regards




Camel 2.13.1 multicast stream to endpoints

2014-08-27 Thread sandp
I have a scenario where I :

1) Receive a zipfile as byte[] from Restlet service
2) Save the zip file 
3) Unmarshall the zip file

I receive the zipfile from the service successfully, then, I try to
multicast the message to endpoints  2) and 3) above.

2) succeeds, the zip file is saved, but 3) Fails with
org.apache.camel.RuntimeCamelException: java.io.IOException: Stream closed.
The same happened when I used pipeline() too.


I tried multicast().parallelProcessing() , 2) succeeds , but 3) always fails
with a timeout. 

*Multicast allows to route the same message* to a number of endpoints and
process them in a different way. But from the failure, it  looks like 3) is
not receiving a copy of the original message from 1).
*
Suggestions appreciated.*


*
-Routes-*

from(direct:start)
.to(restlet:+ constant(RestURLs.TEST_BY_ID+?restletMethod=GET))
.multicast().to(direct:saveZip,direct:unmarshallZip);
.end();

*   from(direct:saveZip)*
.to(file:C:/logs/zip?fileName=DAOPZip.zip)
 .process(new TestProcessor())
.end();

*from(direct:unmarshallZip)*
.split(new ZipSplitter())
 .streaming()
 .process(new TestProcessor())
 .to(file:C:/logs/zip)
  .end();



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-13-1-multicast-stream-to-endpoints-tp5755793.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Load capacity of Apache camel

2014-08-27 Thread ciril
Hi,

is there any limit on capacity of apache camel??



--
View this message in context: 
http://camel.465427.n5.nabble.com/Load-capacity-of-Apache-camel-tp5755792.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Netty component bind failure

2014-08-27 Thread Willem Jiang
It’s not make sense to start a TCP connection and send to web server without a 
validate HTTP request. You may consider to use netty-http[1] component to send 
that kind of request. 

[1]http://camel.apache.org/netty-http

--  
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 August 28, 2014 at 4:31:53 AM, edmondo1984 (edmondo.po...@gmail.com) wrote:
 Thanks, how stupid. Now that I am trying a tcp connection on port 80, I get
 the following:
  
 2014-08-27 21:26:41,968 [el Thread #1 - NettyClientTCPWorker] ERROR
 DefaultErrorHandler - Failed delivery for (MessageId:
 ID-mbp-di-edmondo-54810-1409171153699-0-1 on ExchangeId:
 ID-mbp-di-edmondo-54810-1409171153699-0-2). Exhausted after delivery
 attempt: 1 caught: org.apache.camel.CamelExchangeException: No response
 received from remote server: www.google.com:80. Exchange[Message: GET
 index.htm]
  
 Message History
 ---
   
 RouteId ProcessorId Processor
 Elapsed (ms)
 [route1 ] [route1 ] [direct://testEndPoint
 ] [ 44118]
 [route1 ] [to1 ] [netty:tcp://
 www.google.com:80?requestTimeout=1000 ] [
 44113]
  
 Exchange
 ---
   
 Exchange[
 Id ID-mbp-di-edmondo-54810-1409171153699-0-2
 ExchangePattern InOnly
 Headers
 {breadcrumbId=ID-mbp-di-edmondo-54810-1409171153699-0-1,
 CamelRedelivered=false, CamelRedeliveryCounter=0}
 BodyType String
 Body GET index.htm
 ]
  
 Stacktrace
 ---
   
 org.apache.camel.CamelExchangeException: No response received from remote
 server: www.google.com:80. Exchange[Message: GET index.htm]
 at
 org.apache.camel.component.netty.handlers.ClientChannelHandler.channelClosed(ClientChannelHandler.java:118)
   
 at
 org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:88)
   
 at
 org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
   
 at org.jboss
  
 Can you please advice? I tried to connect through telnet on port 80 and
 perform a GET index.htm on my mac and worked
  
 thank you
  
  
  
  
  
 2014-08-27 9:23 GMT+01:00 Willem.Jiang [via Camel] 
 ml-node+s465427n5755760...@n5.nabble.com:
  
  You used different direct endpoint name.
  The first one is “direct:testEndpoint” and the second one is
  “direct:testEndPoint”.
  You should use the same direct endpoint name here.
 
  --
  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 August 27, 2014 at 2:56:58 PM, edmondo1984 ([hidden email]
  ) wrote:
 
   I am extending the BaseNettyTest. I forked the git repo and checked out
  the
   2.13.2 tag
  
   public class NettyCustomLocalPortProducerTest extends BaseNettyTest {
  
   @Test
   public void routeFails() throws Exception{
   template.sendBody(direct:testEndpoint, Hello world);
   }
  
   protected RouteBuilder createRouteBuilder() {
   return new RouteBuilder() {
   public void configure() {
  
   from(direct:testEndPoint).to(netty:tcp://
   www.google.com:80);
  
   }
   };
   }
   }
  
   Hopefully once I will be able to run this I can contribute myself with
  the
   fix to use a different port :))
  
   Best
  
  
  
  
   --
   View this message in context:
  http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755751.html

 
   Sent from the Camel - Users mailing list archive at Nabble.com.
 
 
 
  --
  If you reply to this email, your message will be added to the discussion
  below:
 
  http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755760.html

  To unsubscribe from Camel Netty component bind failure, click here
   
  .
  NAML
   
 
  
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755791.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: No web.xml CamelHttpTransportServlet configuration with Spring Java Config

2014-08-27 Thread Willem Jiang
Hi,

I don’t think you need to call the camelHttpTransportServlet.init(new 
ServletConfig() {…} there.
The init method can be called by the spring framework finally.

--  
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 August 28, 2014 at 3:11:10 AM, nickwong (nickwong...@gmail.com) wrote:
 Hey guys,
  
 Tomcat 7
 Java 7
 Camel 2.13.2
 Spring 4.0.6
  
 Spring Java Config enthusiast here. I am just starting out with Camel and
 I'd like to keep my projects as XML free as possible. I'm planning on doing
 an HTTP endpoint in the project and I've got a web.xml setting up the
 CamelHttpTransportServlet and a WebApplicationInitializer setting up the
 Spring Context through java config config scan. It's possible with Spring to
 setup a Dispatcher Servlet and add it dynamically in the
 WebApplicationInitializer, but setting up the CamelHttpTransportServlet
 requires a ServletConfig class. I set some of this stuff up, but ran into
 issues with the ContextLoaderListener trying to kick off Spring after the
 servlet initialized it already, then had other issues getting the Spring
 context to refresh at the right lifecycle so the servlet was part of the
 spring context, etc.
  
 Anyway, I figured I'd just ask if anyone had successfully gotten this
 working with Spring (since I'm having trouble finding any documentation on
 this).
  
 Code snipit in WebApplicationInitializer:
  
 @Override
 public void onStartup(final ServletContext servletContext) throws
 ServletException {
  
 ...
  
 CamelHttpTransportServlet camelHttpTransportServlet = new
 CamelHttpTransportServlet();
 camelHttpTransportServlet.init(new ServletConfig() {
 @Override
 public String getServletName() {
 return CamelServlet;
 }
  
 @Override
 public ServletContext getServletContext() {
 return servletContext;
 }
  
 @Override
 public String getInitParameter(final String s) {
 return null;
 }
  
 @Override
 public Enumeration getInitParameterNames() {
 return null;
 }
 });
  
 // Create a new Servlet so we can listen for requests
 ServletRegistration.Dynamic appServlet = servletContext.addServlet(
 CamelServlet,
 camelHttpTransportServlet );
  
 // Listen for request patterns
 appServlet.addMapping(SERVLET_MAPPING);
  
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/No-web-xml-CamelHttpTransportServlet-configuration-with-Spring-Java-Config-tp5755790.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Problems with jsonpath???

2014-08-27 Thread Deven Phillips
Hi all,

   As an example, I was using a simple JSON document:

{
kind: full,
type: customer
}

I wanted to use a jsonpath predictate in a choice route as shown below:


from(websocket://0.0.0.0:8080/replication)
.choice()
.when()
.jsonpath($(@.kind == 'full')
.log(Full update)
.otherwise()
.log(Not full update)


The problem is that I could not get that to work with jsonpath... I did
however get this workaround functional:


from(websocket://0.0.0.0:7080/replication)
.choice()
.when()

.javaScript(JSON.parse(request.body).kind.toLowerCase() == 'full')
.log(LoggingLevel.INFO, Full Update)
.otherwise()
.log(LoggingLevel.INFO, Patch/Put);

Any ideas as to why the jsonpath method is not working?

Thanks in advance!

Deven Phillips