Re: syslog

2022-02-27 Thread Willem Jiang
Here is the translated question.

"Using netty to receive udp messages using unmashal().syslog() to
parse Chinese message, I got the error encoded message, how should I
solve?"

I think it more like an encoding error, and we need more detail
context information.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Mon, Feb 28, 2022 at 2:31 AM Andrea Cosentino  wrote:
>
> Please, can you translate to English?
>
> Il dom 27 feb 2022, 19:17 花儿与少年, <86744...@qq.com.invalid> ha scritto:
>
> > 使用netty接收udp消息使用unmashal().syslog()解析中文乱码,应该如何解决


Re: Submit your presentation proposals for two ApacheCons!

2021-04-21 Thread Willem Jiang
I think holding a roundtable discussion in the meeting could be a good
idea if we want to share the user experience of Camel or the latest
development of Camel.
Please ping me if you have any ideas like to share.  I can help to set
up a roundtable session like this in ApacheCon Asia 2021.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Apr 21, 2021 at 3:35 PM Zoran Regvart  wrote:
>
> Hi Cameleers,
> a little reminder, there is less than two weeks left to submit. I
> would like to encourage folk that perhaps have't presented at a
> conference to submit for any of the two upcoming ApacheCons, we're
> very welcoming to folk presenting for the first time.
>
> Also I'd like to reach out to the large Camel user base in Asia,
> please consider submitting for ApacheCon Asia and help spread the word
> about Camel there.
>
> zoran
>
> On Wed, Mar 31, 2021 at 2:07 PM Zoran Regvart  wrote:
> >
> > Hi Cameleers,
> > this year we have two virtual Apache Conferences, one ApacheCon Asia
> > (6-8 of August) and the ApacheCon @Home (21-23 of September). This is
> > an excellent opportunity to share your experience, bring up new ideas
> > and start new conversations about them. Last year's ApacheCon @Home
> > was a personal highlight for me and I hope we can make it even better
> > this year.
> >
> > Please submit your presentation proposals, the CFP is open and you
> > have little over a month. Bit more details and the links to the CFP on
> > the Camel website:
> >
> > https://camel.apache.org/blog/2021/03/ApacheCons2021/
> >
> > Please, also share this with your peers and encourage them to present
> > about that neat or quirky Camel solution or idea they had!
> >
> > zoran
> > --
> > Zoran Regvart
>
>
>
> --
> Zoran Regvart


Re: Converting ProcessorDefinition to DSL and interfacing with camel k

2020-05-26 Thread Willem Jiang
I guess you just need to assemble the ProcessorDefintion into a
CamelRoute  with a CamelContext to run it in a JVM.
It's not good way to use these low level Camel APIs as there are too
much details you need to explore.

As we deploy the CamelRoute through Camel-K into K8s. It's more easy
that you just use dumped camel route into XML and deploy it through
Camel-K.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, May 27, 2020 at 9:20 AM Reji Mathews  wrote:
>
> This might be a little wierd question. But, I was wondering if there is a
> way to convert an object of org.apache.camel.model.ProcessorDefinition
> object into an equivalent camel DSLs.
> I have an application which constructs ProcessorDefinition object using low
> level camel api's and create a camel context to start it in a jvm.
>
> If there is a way to convert the same object into DSLs, I could possibly
> think of hooking up with camel-k
>
> Alternatively, does camel k have any interfacing to receive an object of
> ProcessorDefinition object?
>
> Cheers


Re: Custom RouteBuilder instance returned to camelContext.addRoutes() misses out on routeDefinitions

2020-01-09 Thread Willem Jiang
Hi Reji,

Normally common user doesn't need to care about how the RouteBuilder
is added the CamelContext, as Camel already wraps this code up.
But according to your description, it looks like you are creating a
new CamelContext and add a new customized RouteBuilder into it.
Please double check if you are adding the right RouteBuilder into a
right CamelContext.


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Jan 9, 2020 at 11:27 PM Reji Mathews  wrote:
>
> Hello Camel community!
>
> Am currently using camel version 2.24.1.
>
> I have a code which starts a camel context by passing an instance of 
> RouteBuilder to it. It looks as follows.
>
> newCamelContext.addRoutes(new MySmartRouteBuilder(flow));
> newCamelContext.start();
>
>
> Problem : When the application reboots initially, all the routes are 
> successfully started and works great. But once the application is in running 
> state, any updated to existing flows (I stop the old camel context and spin 
> up an updated one with fresh instance of MySmartRouteBuilder), camel context 
> starts successfully but looks like none of those routes which are created get 
> added to the camel context when .addRoutes() method is executed. Hence the 
> log says 0 of 0 routes started when newCamelContext starts.
>
>
> The implementation of MySmartRouteBuilder is as follows
>
> package com.reji.camel.core.route;
>
> public class MySmartRouteBuilder extends RouteBuilder {
>
> private static Logger logger = 
> LoggerFactory.getLogger(MySmartRouteBuilder.class);
> private MyIntegrationDefinition myIntegrationDefinition;
> private ObjectMapper mapper = new ObjectMapper();
> private RouteDefinition routeDef = new RouteDefinition();
>
> public MySmartRouteBuilder(MyIntegrationDefinition 
> myIntegrationDefinition) {
> super();
> this.myIntegrationDefinition = myIntegrationDefinition;
> }
>
> @Override
> public void configure() throws Exception {
> for(Step step : myIntegrationDefinition.steps) {
> NodeHandler nodeHandler = NodeHandlerFactory.get(step.stepType);
> routeDef = nodeHandler.handleNode(routeDef, step);
> routeDef.id(flow.id);
> }
> logger.info("Final route definition : {}", routeDef.toString());
> // This one prints the routeDefinition successfully everytime and it looks 
> fine
> }
> }
>
>
>
> NodeHandler is an interface with implementations for each type of step in 
> MyIntegrationDefinition which analyses steps inside MyIntegrationDefinition 
> and incrementally builds routeDef object. Sample of handler looks something 
> like follows
>
> package com.reji.camel.core.handlers.node;
>
> import com.reji.camel.core.handlers.NodeHandler;
> import com.reji.camel.core.handlers.NodeHandlerFactory;
> import com.reji.camel.core.models.Step;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.model.RouteDefinition;
> import org.springframework.stereotype.Component;
>
> import javax.annotation.PostConstruct;
> @Component
> public class QuartzNodeHandler extends RouteBuilder implements NodeHandler {
> private static final String NAME = "quartz";
> private static final String CRON = "cron";
>
> @PostConstruct
> void init() {
> NodeHandlerFactory.register(NAME, this);
> }
>
> @Override
> public RouteDefinition handleNode(RouteDefinition routeDefinition, Step 
> step) throws Exception {
> String uri = String.format("quartz://apic/quartz?cron=%s", 
> flowStep.configurations.get(CRON));
> return from(uri);
> }
>
>
> @Override
> public void configure() throws Exception {
>
> }
> }
>
> I can see that routeDef gets printed correctly at the logger statement inside 
> MySmartRouteBuilder -> logger.info("Final route definition : {}", 
> routeDef.toString()); (which says all my handlers work great!! )
>
> While running in debug mode, I see that when the object of 
> MySmartRouteBuilder gets returned back to newCamelContext.addRoutes(new 
> MySmartRouteBuilder(flow)); all routeDefs are lost and there are 0 routes in 
> there.
>
> Any help to identify the dynamic behavior of RouteBuilder class would be very 
> helpful! Thanks..


Re: Camel always sending MQRFH2 headers to target WebsphereMQ queue

2019-10-18 Thread Willem Jiang
Which version of JDK are you using?
>From the stack trace, it looks like you cannot cast the
com.ibm.mq.jms.MQSession to com.ibm.mq.jms.MQQueueSession.
I think you need to check the client code for more information.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Oct 18, 2019 at 11:51 PM Wang Yan  wrote:
>
> I have problem , camel is always sending MQRFH2 headers to target
> WebsphereMQ queue
>
> I used below code try to solve the problem but i got
> Setup of JMS message listener invoker failed for destination
>
> - trying to recover. Cause: class com.ibm.mq.jms.MQSession cannot be cast
> to class com.ibm.mq.jms.MQQueueSession (com.ibm.mq.jms.MQSession and
> com.ibm.mq.jms.MQQueueSession are in unnamed module of loader
> org.springframework.boot.loader.LaunchedURLClassLoader @5056dfcb)
>
>
> IBM library i used is
>  // https://mvnrepository.com/artifact/com.ibm.mq/com.ibm.mq.allclient
> implementation 'com.ibm.mq:com.ibm.mq.allclient:9.1.1.0'
>
> What could be the problem? Did I used to wrong libs? any suggestions or
> feedback are more than welcome!
>
>
> JmsComponent wmq = new JmsComponent(connectionFactory);
> wmq.setDestinationResolver(new DestinationResolver() { public Destination
> resolveDestinationName(Session session, String destinationName, boolean
> pubSubDomain) throws JMSException { MQQueueSession wmqSession =
> (MQQueueSession) session; return wmqSession.createQueue("queue:///" +
> destinationName + "?targetClient=1"); } });


Re: too many objects

2019-10-09 Thread Willem Jiang
For the first part of route, it should be fine to remove the
streamCaching setting.
For the second part I'm not sure if we need to enable streamCaching
when message sending failed, maybe you can do a simple test for it.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Oct 10, 2019 at 12:56 AM arshid  wrote:
>
> from(fileURI)
> .to(dataformatURL)
> .split(body())
> .streaming()
> .parallelProcessing()
>  .marshal().json(JsonLibrary.Jackson)
>.to("direct:api");
>
>
>
>from("direct:api")
>   .streamCaching()
>   .onException(Exception.class)
>   .handled(true)
>   .to(errorFormat)
>   .end()
>   .loadBalance()
>   .failover(maxAttempts, false, true)
> .to(hostsArray)
> end()
>
>
> above is stripped down version of my route.
>
>
> If I remove streamcaching the route works fine
>
> Sent from Mail for Windows 10
>
> From: Willem Jiang
> Sent: 09 October 2019 05:58
> To: users@camel.apache.org
> Subject: Re: too many objects
>
> The TempfileManager is used in the CachedOutputStream.java[1].
> If you can provide your route, we can see if disable the stream
> cache[2] have any side effects on your route.
>
> [1]https://github.com/apache/camel/blob/master/core/camel-support/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java
> [2]https://camel.apache.org/manual/latest/stream-caching.html
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Mon, Oct 7, 2019 at 7:34 PM arshid  wrote:
> >
> >
> >
> > Hi all,
> >
> >
> >
> > I am reading a csv file around 300 gb and then splitting it and parsing it 
> > to json and sending it to rest api using http4 provider.
> >
> > The problem whenever I use http4 provider it creates lots of objects of 
> > type TempfileManager. Which results in slow down after running for few 
> > hours.
> >
> > I have attached the screenshot of jvisualvm
> >
> >
> >
> > Can anyone help me understand in what is happening
> >
> >
> >
> >
> >
> >
> >
> > Sent from Mail for Windows 10
> >
> >
>


Re: too many objects

2019-10-08 Thread Willem Jiang
The TempfileManager is used in the CachedOutputStream.java[1].
If you can provide your route, we can see if disable the stream
cache[2] have any side effects on your route.

[1]https://github.com/apache/camel/blob/master/core/camel-support/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java
[2]https://camel.apache.org/manual/latest/stream-caching.html

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Mon, Oct 7, 2019 at 7:34 PM arshid  wrote:
>
>
>
> Hi all,
>
>
>
> I am reading a csv file around 300 gb and then splitting it and parsing it to 
> json and sending it to rest api using http4 provider.
>
> The problem whenever I use http4 provider it creates lots of objects of type 
> TempfileManager. Which results in slow down after running for few hours.
>
> I have attached the screenshot of jvisualvm
>
>
>
> Can anyone help me understand in what is happening
>
>
>
>
>
>
>
> Sent from Mail for Windows 10
>
>


Re: SftpEndpoint + privateKey bytes[] + poolEnrich

2019-08-30 Thread Willem Jiang
How about using .pollEnrichRef(EndpointID, xxx) API.
Using the getEndpointUri() is not handy, I prefer to the endpoint
instance id from the application context.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Aug 30, 2019 at 4:43 AM Shultz, Dmitry
 wrote:
>
> Hi All,
>
> I have an SftpEndpoint, which is configured to use the private key bytes 
> (using SftpConfiguration.setPrivateKey(byte[]),  and the poolEnrich() that is 
> using this endpoint to fetch some file.
>
> The problem I'm facing is that poolEnrich() doesn't accept Endpoint as a 
> parameter (accepts only String), so I have to use  
> SftpEndpoint.getEndpointUri() to pass the url string of configured endpoint. 
> It creates 'safe' URI  with  filename that looks like this:   
> fileName=%24%7Bheader.CamelFileName%7D
> And it seems like poolEnrich().simple(sftpEndpoint.getEndpointUri()) ignores 
> the  filename expression (the wrong file is picked up from sftp), probably 
> because there is  '%24%7' instead of '${'  and '%7D' instead of '}', but I'm 
> not sure.
>
> What would be the good way to make sure the Uri String generated by 
> SftpEndpoint.getEndpointUri() is properly parsed? Or may be there is some way 
> to pass configured Endpoint to poolEnrich?
>
> Cheers,
> Dmitry
>
>
>
>


Re: [ANNOUNCEMENT] Brand new Apache Camel website

2019-08-20 Thread Willem Jiang
Hi Zoran,

It's really a great work, now we have a modernized website.
My question is do we have archived the old website, as I try to look
up some swagger related page[1] with google I just got the link is
broken issue.
It's could be better if we have a fallback redirect to the old
archived website incase the current new website link is broken.

[1]https://camel.apache.org/swagger.html

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Tue, Aug 20, 2019 at 9:03 PM Zoran Regvart  wrote:
>
> Hi Cameleers!
> I'm delighted to announce that the new Apache Camel website is live
> now. This has been a work that many of you contributed to either
> directly by modifying the site content working on the design or
> functionality or indirectly by providing feedback.
>
> Have a look at the new website at:
>
> https://camel.apache.org/
>
> Please feel free to share feedback we're always looking for ways to
> improve, we already have some issues that we're working on[1].
>
> If you find any issues with the website you can either create a an
> JIRA issue and set the component to 'website', or you can use the new
> functionality 'Edit this Page' to suggest improvements yourself!
>
> zoran
>
> [1] 
> https://issues.apache.org/jira/issues/?jql=project%20%3D%20CAMEL%20AND%20component%20%3D%20website
> --
> Zoran Regvart


Re: Persistent MQTT Client Message Lost

2019-08-09 Thread Willem Jiang
I just checked the code of camel-mqtt code, and find a line[1] which
could let to the issue that you face.
If the endpoint is start and consumer is not start yet, the consumers
could be empty, camel cannot send the exchange to right consumer to
use. Maybe you can set a break or add some log to verify it.

[1]https://github.com/apache/camel/blob/24521870b81576b5caf9ff3951cff8a0c2c77ab2/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTEndpoint.java#L256-L263

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Aug 8, 2019 at 2:45 PM Michael Zaugg  wrote:
>
> Hi Willem
>
> It's camel version 2.24.0
>
> We gracefully stopped the whole java process with the same result.
>
> "Sending PUBLISH to testclient" occurs before "Received SUBSCRIBE"
> according to Mosquitto's log:
>
> 1565245897: New client connected from 172.17.0.1 as testclient (p1, c0,
> k30).
> 1565245897: No will message specified.
> 1565245897: Sending CONNACK to testclient (0, 0)
> 1565245897: Sending PUBLISH to testclient (d0, q2, r0, m2, 'testtopic',
> ... (4 bytes))
> 1565245907: Received SUBSCRIBE from testclient
> 1565245907: testtopic (QoS 2)
> 1565245907: testclient 2 testtopic
> 1565245907: Sending SUBACK to testclient
> 1565245907: Received PUBREC from testclient (Mid: 2)
> 1565245907: Sending PUBREL to testclient (m2)
> 1565245907: Received PUBCOMP from testclient (Mid: 2, RC:0)
>
> KR
> Michael
>
> On 08.08.19 03:13, Willem Jiang wrote:
> > Hi
> >
> > Can I know which version of Camel are you using?
> > I just checked the code of  camel-mqtt, there are some changes to fix
> > the connection related issues.
> > I doubt that the connection is not full released in your case.
> > Can you try to stop the camel application instead of stop the camel route?
> >
> >
> > Willem Jiang
> >
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> > On Wed, Aug 7, 2019 at 10:56 PM Michael Zaugg  wrote:
> >>
> >> We're having difficulties with persistent clients (using
> >> cleanSession=false). We would like to get messages that were sent while
> >> our client was disconnected.
> >>
> >> Steps to reproduce:
> >> 1. start route to create the initial subscription for the testclient
> >> from("mqtt:bar?subscribeTopicName=testtopic=false=testclient=tcp://localhost:1883=ExactlyOnce").transform(body().convertToString()).to("mock:test");
> >>
> >> 2. stop route (disconnect from broker)
> >>
> >> 3. send message to testtopic with qos 2 using another client id (e.g.
> >> from cli)
> >>
> >> 4. repeat step 1. to connect and re-subscribe to testtopic
> >>
> >> expected behaviour:
> >> message delivered to mock endpoint (mock:test)
> >>
> >> actual behaviour:
> >> publish (delivery) to testclient is shown in broker log (mosquitto) and
> >> in trace of
> >> fusesource MQTTEndpoint but message is not delivered to mock endpoint.
> >> The subscription and hence the callback is not setup at the connect time.
> >>
> >> More or less same behaviour when paho client is used instead.
>
> --
> Michael Zaugg
> Softwareingenieur
>
> Puzzle ITC GmbH
> www.puzzle.ch
>
> Telefon +41 31 370 22 00
> Direkt  +41 31 370 22 15
> Mobile  +41 79 289 65 88
> Fax +41 31 370 22 01
>
> Werfen Sie einen Blick in unseren Blog:
> <http://www.puzzle.ch/blog>


Re: Persistent MQTT Client Message Lost

2019-08-07 Thread Willem Jiang
Hi

Can I know which version of Camel are you using?
I just checked the code of  camel-mqtt, there are some changes to fix
the connection related issues.
I doubt that the connection is not full released in your case.
Can you try to stop the camel application instead of stop the camel route?


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Aug 7, 2019 at 10:56 PM Michael Zaugg  wrote:
>
> We're having difficulties with persistent clients (using
> cleanSession=false). We would like to get messages that were sent while
> our client was disconnected.
>
> Steps to reproduce:
> 1. start route to create the initial subscription for the testclient
> from("mqtt:bar?subscribeTopicName=testtopic=false=testclient=tcp://localhost:1883=ExactlyOnce").transform(body().convertToString()).to("mock:test");
>
> 2. stop route (disconnect from broker)
>
> 3. send message to testtopic with qos 2 using another client id (e.g.
> from cli)
>
> 4. repeat step 1. to connect and re-subscribe to testtopic
>
> expected behaviour:
> message delivered to mock endpoint (mock:test)
>
> actual behaviour:
> publish (delivery) to testclient is shown in broker log (mosquitto) and
> in trace of
> fusesource MQTTEndpoint but message is not delivered to mock endpoint.
> The subscription and hence the callback is not setup at the connect time.
>
> More or less same behaviour when paho client is used instead.


Re: Need camel jetty http2 support for server

2019-07-16 Thread Willem Jiang
First you need to check how to enable http2 support in Jetty, then you
change the code of camel-jetty to see if we can enable this kind
feature by applying some code change on the jetty engine.  Then we may
need to provide a setup option on the jetty endpoint.

My question is there are some other components[1] which provides the
http2 server side support,  why do you still need to use jetty?

[1]https://developers.redhat.com/blog/2017/12/12/using-camel-undertow-component-supporting-http2-connection/

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Tue, Jul 16, 2019 at 12:43 PM Wang Yan  wrote:
>
> Dear All,
>
> In my current project, we need camel jetty http2 support at the server
> I find the below post which related to my question, could anyone give
> me some hints where or what code should be modified to enable camel
> jetty component to support http2 feature?
>
> https://stackoverflow.com/questions/54180195/camel-jetty-http-2-support
>
> Thanks and Rgds
> W.Y


Re: using camel as proxy to download wsdl file from remote webservice

2019-03-30 Thread Willem Jiang
Can you use sniffer tool to check http request? Maybe something is
wrong with the http header.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Sat, Mar 30, 2019 at 6:04 PM Wang Yan  wrote:
>
> i thought the same, i tried with camel-http , camel-http4, jetty, with
> setting bridgeEndpoint=true
> <http://realserverhostname:8090/webservice?wsdl=true=false>
> ,
> set Basic Authorization in header
> but it does not work with my remote wsdl , no idea why.
> -- Forwarded message -
> From: Willem.Jiang [via Camel] 
> Date: Sat, Mar 30, 2019 at 10:46 AM
> Subject: Re: using camel as proxy to download wsdl file from remote
> webservice
> To: W.Y 
>
>
> Hi,
>
>
> It looks like you just want to proxy the request? using camel-http
> component with bridgeEndpoint option is true should do the trick.
> Not sure if it relates to basic authentication on the remote host.
>
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Sat, Mar 30, 2019 at 2:05 PM Wang Yan <[hidden email]
> <http:///user/SendEmail.jtp?type=node=5832524=0>> wrote:
>
> >
> > I found the solution. it works for me, if you have better way, feel free
> to
> > share 
> >
> > private String proxy(String url) throws IOException {
> > CredentialsProvider provider = new BasicCredentialsProvider();
> > UsernamePasswordCredentials credentials = new
> > UsernamePasswordCredentials("USERNAME", "PASSWORD");
> > provider.setCredentials(AuthScope.ANY, credentials);
> > try (CloseableHttpClient httpClient =
> > HttpClientBuilder.create().setDefaultCredentialsProvider(provider)
> > .build();) {
> > HttpGet request = new HttpGet(url);
> > HttpResponse response = httpClient.execute(request);
> > BufferedReader rd = new BufferedReader(new
> > InputStreamReader(response.getEntity().getContent()));
> > StringBuffer body = new StringBuffer();
> > String line = "";
> > while ((line = rd.readLine()) != null) {
> > body.append(line + System.lineSeparator());
> > }
> > return body.toString();
> > }
> > }
> >
> >
> > @Override
> > public void configure() throws Exception {
> > from("jetty:http://0.0.0.0:8080/myapp?matchOnUriPrefix=true
> > ").routeId("webserviceproxyroute")
> > .process(exchange -> {
> > exchange.getOut()
> > .setBody(proxy("http://remotehost/webservice?wsdl;));
> > }).log(LoggingLevel.INFO, "Response  \n ${body}");
> > }
> >
> >
> > I used below code as proxy to download wsdl file from remote webservice,
> > but it does not work. only get html back instead of wsdl file
> >
> >
> >   
> > 
> > http://realserverhostname:8090/webservice?wsdlbridgeEndpoint=truethrowExceptionOnFailure=false
> <http://realserverhostname:8090/webservice?wsdl=true=false>"/>
>
> >   
> >
> >
> >
> > Ps:
> >
> >
> >
> > Of couse using browser I am able to open
> > http://realserverhostname:8090/webservice?wsdl as wsdl file
> >
> > via camel route It only got something like below
> >  Mocked Interfaces in project  > href="/xxx?WSDL=xxx">xxx > href="/xxx?WSDL">xxx
> >
> >
> > Any hints or ideas?
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/using-camel-as-proxy-to-download-wsdl-file-from-remote-webservice-tp5832511p5832524.html
> To unsubscribe from using camel as proxy to download wsdl file from remote
> webservice, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=5832511=d3lhbmJveEBnbWFpbC5jb218NTgzMjUxMXwxMTU1MzAzODM=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


Re: using camel as proxy to download wsdl file from remote webservice

2019-03-30 Thread Willem Jiang
Hi,


It looks like you just want to proxy the request? using camel-http
component with bridgeEndpoint option is true should do the trick.
Not sure if it relates to basic authentication on the remote host.


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Sat, Mar 30, 2019 at 2:05 PM Wang Yan  wrote:
>
> I found the solution. it works for me, if you have better way, feel free to
> share 
>
> private String proxy(String url) throws IOException {
> CredentialsProvider provider = new BasicCredentialsProvider();
> UsernamePasswordCredentials credentials = new
> UsernamePasswordCredentials("USERNAME", "PASSWORD");
> provider.setCredentials(AuthScope.ANY, credentials);
> try (CloseableHttpClient httpClient =
> HttpClientBuilder.create().setDefaultCredentialsProvider(provider)
> .build();) {
> HttpGet request = new HttpGet(url);
> HttpResponse response = httpClient.execute(request);
> BufferedReader rd = new BufferedReader(new
> InputStreamReader(response.getEntity().getContent()));
> StringBuffer body = new StringBuffer();
> String line = "";
> while ((line = rd.readLine()) != null) {
> body.append(line + System.lineSeparator());
> }
> return body.toString();
> }
> }
>
>
> @Override
> public void configure() throws Exception {
> from("jetty:http://0.0.0.0:8080/myapp?matchOnUriPrefix=true
> ").routeId("webserviceproxyroute")
> .process(exchange -> {
> exchange.getOut()
> .setBody(proxy("http://remotehost/webservice?wsdl;));
> }).log(LoggingLevel.INFO, "Response  \n ${body}");
> }
>
>
> I used below code as proxy to download wsdl file from remote webservice,
> but it does not work. only get html back instead of wsdl file
>
>
>   
> 
>  uri="http://realserverhostname:8090/webservice?wsdlbridgeEndpoint=truethrowExceptionOnFailure=false"/>
>   
>
>
>
> Ps:
>
>
>
> Of couse using browser I am able to open
> http://realserverhostname:8090/webservice?wsdl as wsdl file
>
> via camel route It only got something like below
>  Mocked Interfaces in project  href="/xxx?WSDL=xxx">xxx href="/xxx?WSDL">xxx
>
>
> Any hints or ideas?


Re: Question about Camel Connector

2019-03-25 Thread Willem Jiang
As we are moving to the Camel 3.x,  it is important for the user to
know if they can still keep their investment of Camel Connector, or is
there any replacement of Camel Connector.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Mar 15, 2019 at 10:02 AM Tadayoshi Sato
 wrote:
>
> Could anyone answer this question?  I was also surprised to find Camel
> Connector discontinued in 3.x and would like to get explanation from
> someone knowledgeable on the topic.
>
> I can only find this JIRA other than Claus' commits that deprecated
> connectors, but the JIRA doesn't refer to any background discussions.
> https://issues.apache.org/jira/browse/CAMEL-13052
>
>
> On Thu, Mar 7, 2019 at 12:02 PM Willem Jiang  wrote:
>
> > Hi,
> >
> > I think Camel Connector[1] is quit useful if we have some
> > configuration need to be done on the component or endpoint level.
> > I just found the codes of CamelConnector were removed in the camel
> > 3.x.  But there is not much discussion about it. May I know the reason
> > why do we deprecate these connectors and remove them in Camel 3.x?
> >
> > Thanks,
> >
> > [1]https://issues.apache.org/jira/browse/CAMEL-10721
> >
> > Willem Jiang
> >
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >


Re: [Question] I cannot access Property value with camel

2019-03-25 Thread Willem Jiang
I just answer the question there.
FYI, you can find how to use the camel properties component here[1]

[1]https://github.com/apache/camel/blob/67b3fa5781dec77cb6d908730ef916782785214d/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc#examples-using-properties-component

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Mon, Mar 25, 2019 at 11:46 PM 이성규  wrote:
>
> Hi, guys.
>
> I have some problem for property of camel.
> I registered below url.
>
> https://stackoverflow.com/questions/55335795/property-value-is-not-access
>
> Please check this issue.
> Thank you.


Re: I could not use .transacted() in camel route with SpringBoot, got exception

2019-03-07 Thread Willem Jiang
The transacted DSL is built on top of Spring
PlatformTransactionManager.  If you want to use the transacted with
Spring Boot, you need to make sure you can get
PlatformTransactionManager from the application context.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Mar 8, 2019 at 4:46 AM Wang Yan  wrote:
>
> I could not use  .transacted() in camel route with SpringBoot, got exception
> No bean could be found in the registry of type: PlatformTransactionManager"
> Is it expected behavior for SpringBoot+Camel setup?
>
> below is example of the code
>
> https://github.com/apache/camel/blob/master/components/camel-spring/src/test/java/org/apache/camel/spring/processor/JavaDslTransactedNoTXManagerTest.java
>
>
>
> public class JavaDslTransactedNoTXManagerTest extends ContextTestSupport {
> @Test
> public void testTransactedNoTXManager() throws Exception {
> context.addRoutes(new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> from("direct:start")
> .transacted()
> .to("mock:result");
> }
> });
> try {
> context.start();
> fail("Should have thrown an exception");
> } catch (FailedToCreateRouteException e) {
> NoSuchBeanException cause = assertIsInstanceOf(NoSuchBeanException.class, e.
> getCause());
> assertEquals("No bean could be found in the registry of type:
> PlatformTransactionManager", cause.getMessage());
> }
> }
> @Override
> public boolean isUseRouteBuilder() {
> return false;
> }
> }


Question about Camel Connector

2019-03-06 Thread Willem Jiang
Hi,

I think Camel Connector[1] is quit useful if we have some
configuration need to be done on the component or endpoint level.
I just found the codes of CamelConnector were removed in the camel
3.x.  But there is not much discussion about it. May I know the reason
why do we deprecate these connectors and remove them in Camel 3.x?

Thanks,

[1]https://issues.apache.org/jira/browse/CAMEL-10721

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem


Re: Error building 3.0.0-SNAPSHOT

2019-02-22 Thread Willem Jiang
How did you download the source code?
Did you check out the code from git repo?  I just run the build by
using latest master code, I cannot reproduce the error you faced.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Sat, Feb 23, 2019 at 9:49 AM Darius Cooper  wrote:
>
> I just downloaded 3.0.0-SNAPSHOT, to try the Milestone build.
> While building it, I got an error:
>
> [ERROR] Failed to execute goal
> org.apache.camel:camel-package-maven-plugin:3.0.0-SNAPSHOT:prepare-spring-boot-auto-configuration
> (validate) on project camel-properties: Execution validate of goal
> org.apache.camel:camel-package-maven-plugin:3.0.0-SNAPSHOT:prepare-spring-boot-auto-configuration
> failed: Illegal char <<> at index 14:
> java/util/List.java
> <http://java/util/List%3Corg/apache/camel/component/properties/PropertiesLocation%3E.java>


Re: [DISCUSS] - Apache Camel 3 - A new tagline

2019-02-20 Thread Willem Jiang
+1 for "Integrate Everything!"
it's simple and catchy.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Feb 20, 2019 at 8:41 PM Ashwin Karpe  wrote:
>
> +1 for "Integrate Everything!"
>
> - Ashwin...
>
>
> On Wed, Feb 20, 2019 at 6:32 AM James Carman 
> wrote:
>
> > Apache Camel: Integrate All the Things!
> > On Wed, Feb 20, 2019 at 6:23 AM Valdis Andersons 
> > wrote:
> >
> > > +1 for "Integrate Everything!"
> > >
> > > -Original Message-
> > > From: Francois Papon [mailto:francois.pa...@openobject.fr]
> > > Sent: 20 February 2019 10:19
> > > To: users@camel.apache.org
> > > Subject: Re: [DISCUSS] - Apache Camel 3 - A new tagline
> > >
> > > Hi,
> > >
> > > I'm agree with Guillaume about not focuses too much on cloud, Camel can
> > be
> > > use in many other cases.
> > >
> > > We can also have:
> > >
> > > "Integrate the world" or "Integrate your business"
> > >
> > > It's just ideas and may be too "enterprise"...
> > >
> > > regards,
> > >
> > > François Papon
> > > fpa...@apache.org
> > >
> > > Le 20/02/2019 à 11:38, Guillaume Nodet a écrit :
> > > >> Apache Camel 3 - A full-stack integration framework for building
> > > >> cloud-native micro integrations
> > > >>
> > > > I think the proposed tagline focuses too much on cloud, and even if
> > > > that's definitely something we want to emphasize in the set of
> > > > capabilities that Camel provides, having it in the tag line kinda
> > > > implies that Camel is mainly focusing on cloud and not traditional
> > > integration.
> > > >
> > > >
> > > >> "Integrate everything"
> > > >> "Integrate everything without humps" ;-)
> > > >>
> > > > +1 I like both a lot.
> > > >
> > > > In the same direction, and to keep the versatile side we could have:
> > > >   "Integrate everything everywhere"
> > > > but not sure it's better.
> > > >
> > > > Guillaume
> > > >
> > > > Le mer. 20 févr. 2019 à 08:28, Burkard Stephan
> > > >  a écrit :
> > > >
> > > >> Hi all
> > > >>
> > > >> +1 for "Integrate everything!"
> > > >> because it is short, catchy and it refers to Camels outstanding
> > > >> versatility with its hundreds of components.
> > > >>
> > > >> It is true that Camel has a lot of other noteworthy features like
> > > >> runtime flexibility etc. but as soon as the tagline wants to cover
> > > >> multiple things, it gets "bulky" or "buzzwordy".
> > > >>
> > > >> To link the tagline back to the project name and add a pinch of humor
> > > >> it could also be "Integrate everything without humps" ;-)
> > > >>
> > > >
> > > >> -Ursprüngliche Nachricht-
> > > >> Von: Steve Huston 
> > > >> Gesendet: Dienstag, 19. Februar 2019 18:32
> > > >> An: users@camel.apache.org
> > > >> Betreff: RE: [DISCUSS] - Apache Camel 3 - A new tagline
> > > >>
> > > >> "Integrate everything!"
> > > >>
> > > >>> -Original Message-
> > > >>> From: Claus Ibsen 
> > > >>> Sent: Tuesday, February 19, 2019 10:52 AM
> > > >>> To: users@camel.apache.org
> > > >>> Subject: [DISCUSS] - Apache Camel 3 - A new tagline
> > > >>>
> > > >>> Hi
> > > >>>
> > > >>> As part of Apache Camel 3, we are working on a new modern website
> > > >>> (yeah its long overdue, but work are in progress).
> > > >>>
> > > >>> As part of that, we should get a new front-page with a new short
> > > >>> summary what Apache Camel is (eg a tagline).
> > > >>>
> > > >>> It would be good to get some ideas rolling what such a tagline could
> > > >>> be and for users of Camel to come up with suggestions.
> > > >>>
> > > >>> As Apache Camel has been around for so long, and that it covers so
> > > >>> many different use-cases, then 

Re: Help Accessing Remote SOAP Service with Authentication via CXF

2019-01-10 Thread Willem Jiang
Hi

the wssec.xml and client class are used as client to invoke the camel
route. You can setup the cxfEndpoint in the same way as the test
showed in the spring xml way.

If you want to setup the cxfEndpoint in programical way, you could
just consider to implement CxfEndpointConfigurer[1] yourself to setup
the output interceptors in the method of void
configure(AbstractWSDLBasedEndpointFactory factoryBean);
You can setup the CxfEndpointConfigure on the cxfEndpoint  by setup
the cxf endpoint url just like this
"cxf://xxx?cxfEndpointConfigure=#myConfigure" and you need to put the
instance of CxfEndpointConfigure into the CamelContext registry.

[1]https://github.com/apache/camel/blob/master/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpointConfigurer.java

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Jan 10, 2019 at 5:38 AM Isaiah Inuwa  wrote:
>
> Hello Willem,
>
> Thank you for your response.
>
> Perhaps this could be my ignorance with Spring and CXF, but do it seems that 
> the link you gave shows how to configure the incoming service to accept a 
> username token rather than the outgoing service. Would either the wssec.xml 
> file [1] or the Client [1] class in that same package be what I need?
>
> I have added the spring-boot-starter to my pom.xml and registered my 
> RouteBuilder class as a Component so Spring will automatically run it on 
> startup successfully. However, I don't know how to get the bean definitions 
> from Spring into the Camel route. If I create the CXF endpoint or client bean 
> in Spring, how do I get Camel to reference it? Sorry if it's a stupid 
> question.
>
> [1] 
> https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wssecurity/client/wssec.xml
> [2] 
> https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wssecurity/client/Client.java
>
> Isaiah Inuwa
>
> -Original Message-
> From: Willem Jiang 
> Sent: Tuesday, January 8, 2019 8:15 PM
> To: users@camel.apache.org
> Subject: Re: Help Accessing Remote SOAP Service with Authentication via CXF
>
> Hi,
>
> I think you may need find the right moment to setup the CXFEndpoint.
> It could be meaningless if the camel route is loaded and the CXFConsumer is 
> created.
> Can you try to use the Spring configuration to setup the cxfEndpoint this 
> way[1]?
> [1] 
> https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wssecurity/camel/camel-context.xml
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Wed, Jan 9, 2019 at 5:59 AM Isaiah Inuwa  wrote:
> >
> > Hello everyone,
> >
> > This is my first foray into Camel. I am looking into alternatives to
> > MuleSoft ever since they released Mule 4.0 and dropped tooling for the
> > Community Edition.
> >
> > My main question is how to configure a CXF client in Camel with
> > UsernameToken authentication. (I have more questions besides this, but
> > I'll start here.) My task is to synchronize contact information
> > between our local system and a third-party service using SOAP. Here is the 
> > basic flow:
> >
> > - Read JSON objects from RabbitMQ
> > - Convert Objects to JAXB Objects required for third-party service
> > - POST objects to SOAP service
> >
> > I am able to read from the RabbitMQ instance, but I am confused on how
> > to use CXF to access the remote service. Most of the information I see
> > concerns using CXF as a service rather than as a client. Here is what I 
> > have so far:
> >
> > // Application.java
> > public class Application {
> >
> > private static CamelContext context;
> > public static void main(String args[]) throws Exception {
> > context = new DefaultCamelContext();
> > context.addRoutes(new MyRouteBuilder());
> > context.start();
> > }
> > }
> >
> > //MyRouteBuilder.java
> > public class MyRouteBuilder extends RouteBuilder {
> >
> > @Override
> > public void configure() throws Exception {
> >
> > from("rabbitmq:...")
> > .to("direct:start");
> >
> > JsonDataFormat jsonDataFormat = new JsonDataFormat();
> > jsonDataFormat.setLibrary(JsonLibrary.Jackson);
> > jsonDataFormat.setUnmarshalType(ContactInfo.class);
> >
> > from("direct:start")
> > .unmarshal(jsonDataFormat)
> > .process(new ContactInfoToOSCContactProcessor()) //

Re: Help Accessing Remote SOAP Service with Authentication via CXF

2019-01-08 Thread Willem Jiang
Hi,

I think you may need find the right moment to setup the CXFEndpoint.
It could be meaningless if the camel route is loaded and the
CXFConsumer is created.
Can you try to use the Spring configuration to setup the cxfEndpoint
this way[1]?
[1] 
https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wssecurity/camel/camel-context.xml

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Jan 9, 2019 at 5:59 AM Isaiah Inuwa  wrote:
>
> Hello everyone,
>
> This is my first foray into Camel. I am looking into alternatives to MuleSoft
> ever since they released Mule 4.0 and dropped tooling for the Community
> Edition.
>
> My main question is how to configure a CXF client in Camel with UsernameToken
> authentication. (I have more questions besides this, but I'll start here.) My
> task is to synchronize contact information between our local system and a
> third-party service using SOAP. Here is the basic flow:
>
> - Read JSON objects from RabbitMQ
> - Convert Objects to JAXB Objects required for third-party service
> - POST objects to SOAP service
>
> I am able to read from the RabbitMQ instance, but I am confused on how to use
> CXF to access the remote service. Most of the information I see concerns using
> CXF as a service rather than as a client. Here is what I have so far:
>
> // Application.java
> public class Application {
>
> private static CamelContext context;
> public static void main(String args[]) throws Exception {
> context = new DefaultCamelContext();
> context.addRoutes(new MyRouteBuilder());
> context.start();
> }
> }
>
> //MyRouteBuilder.java
> public class MyRouteBuilder extends RouteBuilder {
>
> @Override
> public void configure() throws Exception {
>
> from("rabbitmq:...")
> .to("direct:start");
>
> JsonDataFormat jsonDataFormat = new JsonDataFormat();
> jsonDataFormat.setLibrary(JsonLibrary.Jackson);
> jsonDataFormat.setUnmarshalType(ContactInfo.class);
>
> from("direct:start")
> .unmarshal(jsonDataFormat)
> .process(new ContactInfoToOSCContactProcessor()) // returns a JAXB 
> Object generated by service WSDL
> .choice()
>   ...
> .to("direct:updatecontact");
>
> String contactServiceUri = 
> "cxf://https://thirdparty.example.com/ContactService;
> + "?serviceClass=" + ContactService.class.getCanonicalName()
> + "=contactservice.wsdl";
>
> from("direct:updatecontact")
> .setHeader("operationName", constant("updateContact"))
> .to(contactServiceUri)
> .unmarshal(soapDF)
> .log("The response was ${body[0]}");
> }
> }
>
>
>
> From here, I get an error:
> > org.apache.cxf.ws.policy.PolicyException: A encryption username needs to be 
> > declared.
>
> Makes sense, because I need to set the UsernameToken for the request. I am
> pretty sure that with CXF, I need to add an outgoing interceptors like this, 
> so
> I tried creating a CXF Endpoint from the Camel Context and modifying it there:
>
>   ...
>   CxfEndpoint contactServiceEndpoint = (CxfEndpoint) 
> getContext().getEndpoint(contactServiceUri);
>   Map outProps = new HashMap<>();
>   outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN + 
> " " + WSHandlerConstants.TIMESTAMP);
>   outProps.put(WSHandlerConstants.PASSWORD_TYPE, "PasswordDigest");
>   outProps.put(WSHandlerConstants.USER, "psadmin");
>   outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, 
> UTPasswordCallback.class.getName());
>   WSS4JOutInterceptor outInterceptor = new WSS4JOutInterceptor(outProps);
>   contactServiceEndpoint.getOutInterceptors().add(outInterceptor);
>
>   ...
>
>   from("direct:updatecontact")
>   .setHeader("operationName", constant("updateContact"))
>   .to(contactServiceEndpoint)
>   .unmarshal(soapDF)
>   .log("The response was ${body[0]}");
>
>
> but I get the same error. So I have two questions:
>  1) Is using the cxf: component in this way the canonical way of accessing a
> remote client?
>  2) How do I configure a CXF client endpoint with authentication?
>
> I hope that shows what I am talking about; trying to learn Camel and CXF at 
> the
> same time is confusing. (Note that I am not using Spring in my example since I
> haven't had much experience with it yet am trying to learn one thing at a 
> time.
> But if using Spring in this case is the better way to go, then I'm all for 
> it.)
>
> Thank you in advance for your help!
>
> Isaiah Inuwa


Re: how to browse / search message in topic by consumertemplate

2018-11-14 Thread Willem Jiang
You cannot brower the message in a JMS topic[1].

[1]http://activemq.apache.org/can-you-browse-a-topic.html

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem
On Wed, Nov 7, 2018 at 11:09 PM Wang Yan  wrote:
>
> Hey All,
>
> I need to use consumertemplate to search message
>
> i did something like below. but i have two concerns
>
> 1) it could not search particular message based on messageid
>
> 2) i just want to search or browse message, i dont want to digest it
>
> any suggestions or hints are more than welcome!
>
> @Override
> public void process(Exchange exchange) throws Exception {
> Result result = new Result();
> try {
> result.setMessageBody("MESSAGE NOT FOUND");
> if (exchange != null && exchange.getIn() != null) {
> String operationName =
> exchange.getIn().getHeader(CxfConstants.OPERATION_NAME, String.class);
> MessageContentsList msgList = (MessageContentsList)
> exchange.getIn().getBody();
> if (operationName.equalsIgnoreCase("getMessageFromTopic")) {
> String topic = (String) msgList.get(0);
> String messagid = (String) msgList.get(1);
>  Exchange ex = consumerTemplate.receive("activemq:topic:"+topic);
>  String messageid=  (String)ex.getIn().getHeader("JMSMessageID");
>  String messageBody=ex.getIn().getBody(String.class);
>  result.setMessageId(messageid);
>  result.setMessageBody(messageBody);
> }
> }
> } catch (Exception e) {
> LOG.error("erorr happened ", e);
> throw e;
> }
> exchange.getOut().setBody(result);


Re: soap inboud does not get soap outbound 's response

2018-11-01 Thread Willem Jiang
I think you can use the jetty or other component as a plain HTTP
engine to send the response back.
If you want CXF to do more work (such as provides WS-* work), you can
setup the route like you did.
I guess it may cause bay the message body is not set rightly for the
CXF_MESSAGE.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Oct 25, 2018 at 11:14 PM Wang Yan  wrote:
>
> I have two routes in camel, route1 will send soap request to route2
> What I am expecting route1 will get reponse from route2
> But Altough route2 can send response (i see it in log ), but route1 could
> not get it.
>
> Any idea ? how to let route1 get response from route2?
>
> route1
>
> // SOAP_InBound -> XQuery(InBound-OutBound)->Soap_OutBound_Request
> from(SOAP_ENDPOINT_IN_URI + "=CXF_MESSAGE")
> .convertBodyTo(String.class)
> .to("xquery:createRequest.xq" )
> .to(SOAP_ENDPOINT_OUT_URI + "=MESSAGE");
> route2
> // Soap_OutBound->DummyResponse(OutBound->InBound)
> from(SOAP_ENDPOINT_OUT_URI +
> "=CXF_MESSAGE").convertBodyTo(String.class)
> .setBody(simple("resource:classpath:dummyResponse.xml"))
> .log(LoggingLevel.INFO, "#  Response {body}  #");


Re: camel soap endpoint only WSDL but without serviceClass, is it possible?

2018-11-01 Thread Willem Jiang
Yeah, you can just specify the WSDL, but you have to provide more
information such as the service name and endpoint name to let CXF to
look up right endpoint for you.

Please check out this test file[1] as an example.

[1]https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreeterEndpointCxfMessageWithoutSEIBeans.xml

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem
On Mon, Oct 22, 2018 at 10:00 PM Wang Yan  wrote:
>
> camel soap endpoint only using wsdl , not using serviceClass , is it
> possbile?
>
> private static final String SOAP_ENDPOINT_URI = "cxf://
> http://0.0.0.0:9009/create?serviceClass=com.xyz.CreateService;;
>
> I tried like below, but it does not work, it looks like the endpoint really
> expecting serviceClass
>
> private static final String SOAP_ENDPOINT_URI = "cxf://
> http://0.0.0.0:9009/create?wsdlURL=wsdl/createService.wsdl;;
>
> the reason why not using POJO, because the system which providing WSDL is
> old. we just want to using soap  with dataformat as message not as POJO


Re: is transaction (required) by default enabled for the route sending message from one jms endpoint to another endpoint

2018-11-01 Thread Willem Jiang
As the transaction is bit complicated, you need to setup the
transaction manager yourself on the jms component first, then you can
apply the policy. So I don't think we can provide the transaction
policy out of box.

Please check out this document[1] for more information about setting
the transaction policy between the jms component.

[1]https://github.com/apache/camel/blob/master/camel-core/src/main/docs/eips/transactional-client.adoc

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem
On Sun, Oct 21, 2018 at 2:27 PM Wang Yan  wrote:
>
> is transaction (required) by default enabled for the route sending message
> from one jms endpoint to another endpoint like below
>
>  from("activemq:queue:foo").to("activemq:queue:bar");
>
> or i have to explicitly do like  below ?
> Policy requried = bean(SpringTransactionPolicy.class,
> "PROPAGATION_REQUIRED"));
>  from("activemq:queue:foo").policy(required).to("activemq:queue:bar");
>
> Any hints or suggestions are more than welcome!


Re: how to get operationName for Soap Message dataFormat=MESSAGE

2018-10-27 Thread Willem Jiang
The header is set once you set the defaultOperationName parameter, but
it doesn't effect the cxf consumer or producer when the dataformate is
MESSAGE.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Sat, Oct 27, 2018 at 2:03 PM Wang Yan  wrote:
>
> Hey,
>
> I did change as document described add defaultOperationName=getUserName as
> below , it should work but
> i still could not get operationName, why?
> String OPERATIONNAME="=getUserName";
> from(SOAP_ENDPOINT_IN_URI + "=MESSAGE"+OPERATIONNAME)
> .log(LoggingLevel.INFO,   "## headers
> in.headers.headers.operationName -> ${in.headers.operationName} ")
>
>
>
> On Sat, Oct 27, 2018 at 2:05 AM Willem.Jiang [via Camel] <
> ml+s465427n5825133...@n5.nabble.com> wrote:
>
> > Hi,
> >
> > When you use MESSAGE dataformat, camel-cxf component doesn't read the
> > message, so it makes sense that you cannot operationName header.
> >
> > Willem Jiang
> >
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> > On Fri, Oct 26, 2018 at 4:07 PM Wang Yan <[hidden email]
> > <http:///user/SendEmail.jtp?type=node=5825133=0>> wrote:
> >
> > >
> > > when i use
> > > from(SOAP_ENDPOINT_IN_URI +
> > > "=CXF_MESSAGE").removeHeaders("CamelHttp*")
> > >
> > > I can  get operationName  by  ${in.headers.operationName}
> > > but I could not get   operationName  when useing
> > > dataFormat=MESSAGE
> > >
> > > from(SOAP_ENDPOINT_IN_URI + "=MESSAGE").
> > >
> > > any idea or suggestion ?
> >
> >
> > --
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> > http://camel.465427.n5.nabble.com/how-to-get-operationName-for-Soap-Message-dataFormat-MESSAGE-tp5825110p5825133.html
> > To unsubscribe from how to get operationName for Soap Message
> > dataFormat=MESSAGE, click here
> > <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=5825110=d3lhbmJveEBnbWFpbC5jb218NTgyNTExMHwxMTU1MzAzODM=>
> > .
> > NAML
> > <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> >


Re: how to get operationName for Soap Message dataFormat=MESSAGE

2018-10-26 Thread Willem Jiang
Hi,

When you use MESSAGE dataformat, camel-cxf component doesn't read the
message, so it makes sense that you cannot operationName header.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Oct 26, 2018 at 4:07 PM Wang Yan  wrote:
>
> when i use
> from(SOAP_ENDPOINT_IN_URI +
> "=CXF_MESSAGE").removeHeaders("CamelHttp*")
>
> I can  get operationName  by  ${in.headers.operationName}
> but I could not get   operationName  when useing
> dataFormat=MESSAGE
>
> from(SOAP_ENDPOINT_IN_URI + "=MESSAGE").
>
> any idea or suggestion ?


Re: [HEADS UP] Camel K is here!

2018-10-17 Thread Willem Jiang
Yeah,  it's great to see we can use Camel more easily with K8S.
It's awesome that camel-k can be a part of Camel 3 :)

Regards,

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Oct 17, 2018 at 6:24 AM Nicola Ferraro  wrote:
>
> Hi folks,
> after some months of brainstorming with the community and a bit more than
> one month of development, our Camel K project has reached a good level of
> stability and I've published the first blog post about it yesterday.
>
> For those of you who haven't heard of Camel K, it's now a subproject of
> Apache Camel (https://github.com/apache/camel-k) with the target of
> building a lightweight runtime for running integration code directly on
> cloud platforms like Kubernetes and Openshift. It was inspired by
> "serverless" principles and it will also target Knative shortly.
>
> With the exception of the runtime code, that remains the good old Camel
> Java framework with 200+ components and full of EIPs, most of the
> "operator" code in Camel K is written in Go. But the new language has not
> stopped many adventurer Camel developers that have actively contributed to
> the project during last month. We still have a long way in front of us,
> let's continue to make Camel great!
>
> So, please.. check the project out! Spread it to the world!
> And provide your feedback, so we can make it always better. We love any
> kind of contribution!
>
> Links follow..
>
> Announcement: https://twitter.com/ni_ferraro/status/1051872786946363392
> Article: https://www.nicolaferraro.me/2018/10/15/introducing-camel-k/
> Home: https://github.com/apache/camel-k
>
> Nicola


Re: Camel HeaderFilterStrategy Bean Registration in Spring

2018-07-19 Thread Willem Jiang
Hi,

You don't need to add @Bean annotation on the applyFilterToCamelHeaders
method,
Just keep @Component there should be fine.


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Thu, Jul 19, 2018 at 9:22 PM, Peck, Sean  wrote:

> I am having difficulty with Spring-Camel getting a HeaderFilterStrategy
> class registered as a Bean so it can be found by the Camel Route. My
> attempts to annotate the HeaderFilterStrategy custom class seem futile...
> so how do I register this thing so it gets found at run time?
>
> I have a camel application with a route utilizing a custom
> HeaderFilterStrategy
> The Strategy Class looks like :
>
> public class HeaderFilter implements HeaderFilterStrategy {
> @Override
> public boolean applyFilterToCamelHeaders(String s, Object o, Exchange
> exchange) {
>   return false;
> }
>
>@Override
>public boolean applyFilterToExternalHeaders(String s, Object o,
> Exchange exchange) {
> return true;
>}
> }
>
> I register it with camel using a simple registry:
>
> SimpleRegistry registry = new SimpleRegistry();
> registry.put("HeaderFilter" ,new HeaderFilter());
> .
> .
> final CamelContext ctx = new DefaultCamelContext(registry);
>
> And I reference it in my Route in
>
> .to("https://myhost/endpoint=#HeaderFilter;)
>
> And all like Ralphy on Christmas night with his trusty Red Rider BB Gun,
> all is right with the world.
>
> So, now I am trying to take this pure camel app and put it under Spring. I
> make sure all the appropriate Camel, and Spring-Camel and Spring things are
> imported.. However, when I attempt to annotate my HeaderStrategy as a Bean
> for Spring and it fails:
>
> @Component
> public class HeaderFilter implements HeaderFilterStrategy {
>
> @Bean
>   @Override
>   public boolean applyFilterToCamelHeaders(String s, Object o, Exchange
> exchange) {
> return false;
>   }
>   @Override
>   public boolean applyFilterToExternalHeaders(String s, Object o,
> Exchange exchange) {
> return true;
>   }
> }
>
> Now when I do this, the IDE basically tells me it can't autowire any of
> the parameters in the method calls because there is more than one bean of
> type String or Object and no beans of type Exchange found..
> At Runtime, Camel does attempt to interpret the route, but throws a
> failure with "No Qualifying bean type of "java.lang.String" available,
> since this is the first parameter in the method call...
> So, How do I get this thing to be able register with annotations
> correctly? Or manually register this bean without it attempting to
> autowire? All I need is the class to be registered as a BEAN so it can be
> found by camel at runtime... Or at least that is what I understand needs to
> happen... so how the heck to I do this?
>
>


Re: MailConsumer replacing identical filename attachments

2018-06-25 Thread Willem Jiang
Hi,

I just checked the code of MailBinding, it checked the filename[1] and log
warning message for it.
I'm not sure if this is  the best way to resolve this issue as we have to
rename the filename (such as add a number after the name) to make sure
there is no conflict between the keys.)



[1]
https://github.com/apache/camel/blob/5ebd2f11c25a36bb3ed6d6b556ae3bb96a23aa0a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java#L331


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Jun 20, 2018 at 8:02 PM, Joery Vreijsen 
wrote:

> Hi there!
>
> I’m struggling with the camel-mail consumer, when it reads the MailMessage
> and extracts the multipart attachments.
> Looking at the implementation of MailBinding.java I notice that the
> multipart attachments are put in an Map() causing
> attachments
> with the same filename to be overwritten by the Map#put method.
>
> I was wondering if this is a known issue, or something we could possibly
> fix?
>
> Any advice is welcome!
>
> Greetings,
>
> - Joery Vreijsen
>


Re: camel route fails to AWS s3 with newer versions of java

2018-06-19 Thread Willem Jiang
I just went through the issue[1] of aws java sdk.

Can you try to override the  joda-time to 2.8.1 ?

[1]https://github.com/aws/aws-sdk-java/issues/484


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Jun 20, 2018 at 1:40 AM, Palmer, Eric  wrote:

> Hi,
>
> Using camel 2.21.1 with xml routes.
>
> I have a case where sending a file to aws s3 fails on newer versions of
> Java but succeeds on older versions.  I have googled this and all of the
> suggestions seem to center on having a later version of joda-time.  Since I
> have camel 2.21.1 the Joda-time version is  2.9.9 but the route still fails.
>
> I build with IntelliJ and have cleared the cache and have cleaned the
> local maven repo and reimported the modules and bebuilt the artifact.
>
> Fails on:
>
> 1.8.0_101-b13
> 1.8.0_171-b11
>
> Succeeds on:
>
> build 1.8.0_51-b31
>
> Stack Trace
>
> Exception in thread "main" org.apache.camel.RuntimeCamelException:
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> test_s3_date_issue at: >>> To[aws-s3://hermesassets.
> richmond.edu?amazonS3Client=#amazonS3Client] <<< in route:
> Route(test_s3_date_issue)[[From[file:/WWW/users/epalmer/s3te... because
> of Failed to resolve endpoint: 
> aws-s3://valids3bucketname?amazonS3Client=%23amazonS3Client
> due to: AWS authentication requires a valid Date or x-amz-date header
> (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request
> ID: 0366245E9DFB4A02)
> at org.apache.camel.util.ObjectHelper.
> wrapRuntimeCamelException(ObjectHelper.java:1619)
> at org.apache.camel.spring.SpringCamelContext.
> onApplicationEvent(SpringCamelContext.java:123)
> at org.apache.camel.spring.CamelContextFactoryBean.
> onApplicationEvent(CamelContextFactoryBean.java:332)
> at org.springframework.context.event.
> SimpleApplicationEventMulticaster.invokeListener(
> SimpleApplicationEventMulticaster.java:151)
> at org.springframework.context.event.
> SimpleApplicationEventMulticaster.multicastEvent(
> SimpleApplicationEventMulticaster.java:128)
> at org.springframework.context.support.
> AbstractApplicationContext.publishEvent(AbstractApplicationContext.
> java:331)
> at org.springframework.context.support.
> AbstractApplicationContext.finishRefresh(AbstractApplicationContext.
> java:773)
> at org.springframework.context.support.
> AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
> at org.springframework.context.support.
> FileSystemXmlApplicationContext.(FileSystemXmlApplicationContex
> t.java:140)
> at org.springframework.context.support.
> FileSystemXmlApplicationContext.(FileSystemXmlApplicationContex
> t.java:84)
> at edu.richmond.webservices.MyMain.main(MyMain.java:48)
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to
> create route test_s3_date_issue at: >>> To[aws-s3://hermesassets.
> richmond.edu?amazonS3Client=#amazonS3Client] <<< in route:
> Route(test_s3_date_issue)[[From[file:/WWW/users/epalmer/s3te... because
> of Failed to resolve endpoint: aws-s3:// valids3bucketname?
> amazonS3Client=%23amazonS3Client due to: AWS authentication requires a
> valid Date or x-amz-date header (Service: Amazon S3; Status Code: 403;
> Error Code: AccessDenied; Request ID: 0366245E9DFB4A02)
> at org.apache.camel.model.RouteDefinition.addRoutes(
> RouteDefinition.java:1028)
> at org.apache.camel.model.RouteDefinition.addRoutes(
> RouteDefinition.java:185)
>
>
> Any help would be very much appreciated.
>
> --
> Eric Palmer
> University of Richmond
>
>
>


Re: Camel 2.21.1 HttpComponent

2018-06-19 Thread Willem Jiang
You need to update the camel-core version at the same time :)


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Tue, Jun 19, 2018 at 9:44 PM, Binole, William J <
william.j.bin...@questdiagnostics.com> wrote:

> Willem thank you for your response. Yes,  all the jars were updated at the
> same time and all have 2.21.1 in their names.  Dependencies from the pom
> are listed below.
>
>   
>  org.apache.camel
>  camel-core
>  2.19.5
>   
>
>   
> org.apache.camel
> camel-mina2
> 2.21.1
> 
>   
>
>   
>  org.apache.camel
>  camel-ftp
>  2.21.1 
>   
>
>   
>  org.apache.camel
>  camel-hl7
>  2.21.1 
>   
>
> 
> org.apache.camel
> camel-http-common
> 2.21.1
> 
>
>   
>  org.apache.camel
>  camel-http
>  2.21.1
>   
>
>
>
>   
>  org.apache.camel
>  camel-jms
>  2.21.1
>   
>
>   
>  org.apache.camel
>  camel-spring
>  2.21.1
>   
>
> -Original Message-
> From: Willem Jiang [mailto:willem.ji...@gmail.com]
> Sent: Tuesday, June 19, 2018 12:28 AM
> To: users@camel.apache.org
> Subject: Re: Camel 2.21.1 HttpComponent
>
> CAUTION: This email originated from outside of the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
>
>
> The registerExtension method is provided by camel-core.
> Please check if you updated the camel-core jar at the same time.
>
> As the major version upgrade could introduce internal API change. We don't
> suggest user just upgrade the version of camel-component unless it's a
> patch release, such as 2.19.4 -> 2.19.5.
>
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Tue, Jun 19, 2018 at 5:24 AM, Binole, William J < William.J.Binole@
> questdiagnostics.com> wrote:
>
> > We recently upgraded our camel libs to the latest version (2.21.1) and
> > have found that we can no longer instantiate HttpComponent. This is
> > due to the constructor calling the registerExetnsion method which we
> > have yet to find in the source.
> >
> > public HttpComponent(Class endpointClass) {
> > super(endpointClass);
> >
> > registerExtension(HttpComponentVerifierExtension::new);
> > }
> > The above constructor fails with a no such method error on
> > registerExtension. I dropped back to camel 2.19.5 and things work as
> > that method is not being used. I would prefer to use the latest
> > release 2.21.1 but we have not been able to find a way around the
> > problem with registerExtension. Since there does not appear to be any
> > documentation around this any information on how to now instantiate
> > HttpComponent would be appreciated.
> >
> > Bill
> >
> > __
> > The contents of this message, together with any attachments, are
> > intended only for the use of the person(s) to which they are addressed
> > and may contain confidential and/or privileged information. Further,
> > any medical information herein is confidential and protected by law.
> > It is unlawful for unauthorized persons to use, review, copy,
> > disclose, or disseminate confidential medical information. If you are
> > not the intended recipient, immediately advise the sender and delete
> this message and any attachments.
> > Any distribution, or copying of this message, or any attachment, is
> > prohibited.
>
> __
> The contents of this message, together with any attachments, are intended
> only for the use of the person(s) to which they are addressed and may
> contain confidential and/or privileged information. Further, any medical
> information herein is confidential and protected by law. It is unlawful for
> unauthorized persons to use, review, copy, disclose, or disseminate
> confidential medical information. If you are not the intended recipient,
> immediately advise the sender and delete this message and any attachments.
> Any distribution, or copying of this message, or any attachment, is
> prohibited.
>


Re: Camel 2.21.1 HttpComponent

2018-06-18 Thread Willem Jiang
The registerExtension method is provided by camel-core.
Please check if you updated the camel-core jar at the same time.

As the major version upgrade could introduce internal API change. We don't
suggest user just upgrade the version of camel-component unless it's a
patch release, such as 2.19.4 -> 2.19.5.


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Tue, Jun 19, 2018 at 5:24 AM, Binole, William J <
william.j.bin...@questdiagnostics.com> wrote:

> We recently upgraded our camel libs to the latest version (2.21.1) and
> have found that we can no longer instantiate HttpComponent. This is due to
> the constructor calling the registerExetnsion method which we have yet to
> find in the source.
>
> public HttpComponent(Class endpointClass) {
> super(endpointClass);
>
> registerExtension(HttpComponentVerifierExtension::new);
> }
> The above constructor fails with a no such method error on
> registerExtension. I dropped back to camel 2.19.5 and things work as that
> method is not being used. I would prefer to use the latest release 2.21.1
> but we have not been able to find a way around the problem with
> registerExtension. Since there does not appear to be any documentation
> around this any information on how to now instantiate HttpComponent would
> be appreciated.
>
> Bill
>
> __
> The contents of this message, together with any attachments, are intended
> only for the use of the person(s) to which they are addressed and may
> contain confidential and/or privileged information. Further, any medical
> information herein is confidential and protected by law. It is unlawful for
> unauthorized persons to use, review, copy, disclose, or disseminate
> confidential medical information. If you are not the intended recipient,
> immediately advise the sender and delete this message and any attachments.
> Any distribution, or copying of this message, or any attachment, is
> prohibited.


Re: Type converter misbehavior with camel-cxf and camel-mail

2018-06-14 Thread Willem Jiang
Camel uses the traditional Java SPI loading mechanism.
camel-core just loads the type converters by looking up the type convert
file from the class path.
It cannot tell which one is prioritized unless we add an order number into
the converter, but the number cannot be changed by user.


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Jun 15, 2018 at 12:25 AM, Bagwell, Allen F <
afba...@sandia.gov.invalid> wrote:

> I would have never known I needed a String -> Object[] converter for the
> body unless I stepped through the CfxRsProducer code with a debugger.
> Therefore I’m not sure that handing some kind of control/override mechanism
> to the developer via a configuration would not have helped me.
>
> Fundamentally, this seems to be an issue where the camel component in
> question needs to be able to prioritize its own type converters first.
> Camel-cxf has the classes in the package: org.apache.camel.component.
> cxf.converter
>
> and camel-mail has the class org.apache.camel.component.
> mail.MailConverters
>
> Is there any way to tell the Type Converter search code to prioritize a
> component’s own converters first?
>
> -Allen
>
> From: Willem.Jiang [via Camel] [mailto:ml+s465427n5820564...@n5.nabble.com
> ]
> Sent: Wednesday, June 13, 2018 2:30 AM
> To: Bagwell, Allen F 
> Subject: [EXTERNAL] Re: Type converter misbehavior with camel-cxf and
> camel-mail
>
> Hi Bagwell,
>
> Thank you for share your experience of using the camel type converter.
>
> Most time the embedded type converter just work as it is designed, but we
> cannot guarantee it works in different combinations.
> as we don't provide the override mechanism which could introduce some
> trouble for user to resolve the type convert conflict.
> Maybe we could introduce some option in the application context to give
> user a chance to get back control of which converter can work.
>
> The first thing came into my mind is configuration file which ship with the
> application to decide the order of the type converter.
> But I'm not sure if it can work across all the deployment that camel
> supports.
>
> any thought?
>
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Wed, Jun 13, 2018 at 3:25 AM, Bagwell, Allen F <
> [hidden email]> wrote:
>
> > I'm trying to integrate a CXF REST client into my camel route that
> already
> > has a SMTP endpoint incorporated into it via camel-mail. (This is using
> > Camel 2.18.5)
> >
> > When the client is invoked (this is configured via a blueprint), the
> > CxfRsProducer class in camel-cxf has the resource class loaded that I
> have
> > defined and using the proxy (CxfConstants.CAMEL_CXF_RS_USING_HTTP_API =
> > false, CxfConstants.OPERATION_NAME = "putStatus") it successfully looks
> up
> > the method the client needs, which in this case will use the String body
> of
> > the in-message to set as a parameter.
> >
> > This is where it gets weird. The CxfRsProducer needs to find a converter
> > to take the String body and turn it into an Object[]. In every other case
> > where I've done this, it finds the appropriate type converter and life is
> > good.  However when camel-mail is present in the classpath the converter
> > search method picks:
> >
> > com.sun.mail.imap.SortTerm[] org.apache.camel.component.
> > mail.MailConverters.toSortTerm(String msg)
> >
> > This converter fails to produce the desired result and then a list of
> > fallback converters are tried. None of these work either and so the final
> > decision is to not use the in-message body but rather the in-message
> object
> > itself (DefaultMessage).  This of course isn't the correct solution, so
> the
> > whole CxfRsProducer bombs on a NoSuchMethodException because it can't
> find
> > the correct type parameter (String) that my resource class method needs.
> >
> > If I remove camel-mail, the CXF client works exactly as expected because
> > it finds the right String -> Object[] converter.
> >
> > I have never really had to muck around explicitly with converters before,
> > but is there a way to get these two dependencies to cooperate and pick
> the
> > correct converter? My current workaround is in my preparation of the
> > exchange just before the rest client is invoked I put the String I need
> to
> > send into an Object[] and set that as the new in-message body. Seems a
> bit
> > of a kluge, but it allows me to continue.
> >
> > Thanks!
> > -Allen
> >
>
> 
> If you reply to this email, your message will be added to th

Re: Type converter misbehavior with camel-cxf and camel-mail

2018-06-13 Thread Willem Jiang
Hi Bagwell,

Thank you for share your experience of using the camel type converter.

Most time the embedded type converter just work as it is designed, but we
cannot guarantee it works in different combinations.
as we don't provide the override mechanism which could introduce some
trouble for user to resolve the type convert conflict.
Maybe we could introduce some option in the application context to give
user a chance to get back control of which converter can work.

The first thing came into my mind is configuration file which ship with the
application to decide the order of the type converter.
But I'm not sure if it can work across all the deployment that camel
supports.

any thought?


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Jun 13, 2018 at 3:25 AM, Bagwell, Allen F <
afba...@sandia.gov.invalid> wrote:

> I'm trying to integrate a CXF REST client into my camel route that already
> has a SMTP endpoint incorporated into it via camel-mail. (This is using
> Camel 2.18.5)
>
> When the client is invoked (this is configured via a blueprint), the
> CxfRsProducer class in camel-cxf has the resource class loaded that I have
> defined and using the proxy (CxfConstants.CAMEL_CXF_RS_USING_HTTP_API =
> false, CxfConstants.OPERATION_NAME = "putStatus") it successfully looks up
> the method the client needs, which in this case will use the String body of
> the in-message to set as a parameter.
>
> This is where it gets weird. The CxfRsProducer needs to find a converter
> to take the String body and turn it into an Object[]. In every other case
> where I've done this, it finds the appropriate type converter and life is
> good.  However when camel-mail is present in the classpath the converter
> search method picks:
>
> com.sun.mail.imap.SortTerm[] org.apache.camel.component.
> mail.MailConverters.toSortTerm(String msg)
>
> This converter fails to produce the desired result and then a list of
> fallback converters are tried. None of these work either and so the final
> decision is to not use the in-message body but rather the in-message object
> itself (DefaultMessage).  This of course isn't the correct solution, so the
> whole CxfRsProducer bombs on a NoSuchMethodException because it can't find
> the correct type parameter (String) that my resource class method needs.
>
> If I remove camel-mail, the CXF client works exactly as expected because
> it finds the right String -> Object[] converter.
>
> I have never really had to muck around explicitly with converters before,
> but is there a way to get these two dependencies to cooperate and pick the
> correct converter? My current workaround is in my preparation of the
> exchange just before the rest client is invoked I put the String I need to
> send into an Object[] and set that as the new in-message body. Seems a bit
> of a kluge, but it allows me to continue.
>
> Thanks!
> -Allen
>


Re: host not found when using http4 in docker container

2018-06-05 Thread Willem Jiang
Can  you add a link  to the camel container just like this ?

camel:
image: "camel:0.3.0-SNAPSHOT"
hostname: camel
links:
- "otherHost"
- "zipkin:zipkin.io"


Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Jun 6, 2018 at 4:40 AM, Tim Dudgeon  wrote:

> On 05/06/18 20:40, Robin Vanderhallen wrote:
>
>> Are both containers in the same network in the docker compose file?
>>
> Yes. Both are in the same network environment, but this is not the default
> network.
>
> networks:
> - xxx
>
> Tim
>


Re: Jackson vulnerabilities CVE-2017-17485 & CVE-2018-7489

2018-05-05 Thread Willem Jiang
Hi Grzegorz,

Is there any updated for this issue?
We may need a JIRA to track this kind of issue.


Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Tue, Apr 17, 2018 at 3:04 PM, Grzegorz Grzybek <gr.grzy...@gmail.com>
wrote:

> Hello
>
>
> > It may look like Jackson has not provided CVE fixes for these reports
> > on their 2.8.x versions. That version is what is in use for Camel
> > 2.20.x and 2.21.x and therefore its more tricky to do something about
> > it. Camel users can try to switch to use Jackson 2.9.5 with their
> > Camel 2.20.x or 2.21.x as its just a matter of selecting the JARs in
> > their classpath/application.
> >
>
> (Always) remember about swagger dependencies... Swagger quite loosely
> treats semantic versioning.
> Between 1.5.17 and 1.5.18 there was jackson upgrade from 2.8.x to 2.9.x
>
> Just my heads-up that this should be checked.
>
> regards
> Grzegorz Grzybek
>
>
> > And as Jackson is also used by Spring Boot then we are trying to align
> > with the supported version of Jackson that Spring Boot uses. And Camel
> > 2.20.x and 2.21.x is using Spring Boot 1.5.x.
> >
> > And Jackson has sometimes in-compatability issues so its not always an
> > easy upgrade.
> >
> >
> >
> >
> > On Mon, Apr 16, 2018 at 1:00 PM, David Atkins <davidatkin...@gmail.com>
> > wrote:
> > > Hello,
> > >
> > > I've recently ran a dependency check on the camel-jackson 2.21.0 and
> > > it appears that the version of jackson being used (2.8.10) has two
> > > High/Severe vulnerabilities.
> > >
> > > To fix this for camel-jackson we'll need to upgrade as follows:
> > >
> > > CVE-2017-17485 - Jackson 2.9.3 or greater
> > > CVE-2018-7489 - Jackson 2.9.5 or greater
> > >
> > > I can see that the parent pom on the mainline has been upgraded to
> > > 2.9.4 (as part of spring boot 2 migration), so that covers
> > > CVE-2017-17485 'for free'
> > >
> > > More information available here:
> > >
> > > https://nvd.nist.gov/vuln/detail/CVE-2017-17485
> > > https://nvd.nist.gov/vuln/detail/CVE-2018-7489
> > >
> > > Shall I raise a JIRA to address this (possible as two separate tickets
> > > to track both issues?)
> > >
> > > Thanks,
> > >
> > > David
> >
> >
> >
> > --
> > Claus Ibsen
> > -
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>


Re: Apache camel and IBM MQ

2018-05-05 Thread Willem Jiang
Hi,
It could be a while, I'm not sure if you already find a way to resolve this
kind question.
Here are some pointers which may help you out:
1.You can take a look at the camel-jms component[1] or camel-sjms[2] which
supports the stand JMS message, which could be use to connect the IBM MQ.
2. With the Bean Integration you can add some annotation in your business
implementation bean to handle the message.

[1]
https://github.com/apache/camel/blob/master/components/camel-jms/src/main/docs/jms-component.adoc
[2]
https://github.com/apache/camel/blob/master/components/camel-sjms/src/main/docs/sjms-component.adoc
[3]http://camel.apache.org/pojo-consuming.html


Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Apr 11, 2018 at 10:18 AM, Pranay Tonpay <pton...@gmail.com> wrote:

> Hi,
> I was looking for some sample code integrating Apache Camel and IBM MQ that
> uses pure annotation driven approach. Can someone please provide me some
> pointers ?
>
> thx
> pranay
>


Re: mocking future routes

2018-04-24 Thread Willem Jiang
Hi,

As the endpoint uri is string, you can change the prefix with some kind of
profile.
If you want to use it in the test, you can simply set the prefix to be
"stub".
In the production world, you can just set the prefix to be an empty string.


Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Apr 25, 2018 at 4:20 AM, Yacov Schondorf <yacov.schond...@gmail.com>
wrote:

> Hi,
> So sorry for the late response; only now I was able to get back to this
> issue.
> I don't see how the stub component can help me here. This is a real route I
> need to mock in a production code.
> Consider this use case:
> 1. My route (let's call it route 1)  has a Jetty start endpoint, and is a
> configuration service so that an incoming call would cause a configuration
> change to the system. If the incoming call has some "flag" set to "true"
> then a new route needs to be created (route 2). Route 2 has a Kafka
> endpoint which I need to mock because the connection parameters are not
> relevant at test time.
> 2. On my test, I advise route 1, and replace the Jetty endpoint with a
> start endpoint, and send a message that should trigger creation of route 2.
> Creation of route 2 fails because of the wrong Kafka parameters.
>
> If I add "stub:" in route 2 ("Stub:kafka...") then in non-test time the
> route will not work.
>
> Any solution for this?
>
>
> 2018-02-01 18:58 GMT+02:00 Claus Ibsen <claus.ib...@gmail.com>:
>
> > You can try when you create the new route, to add "stub:" as the
> > prefix for your endpoints. Then you can use the stub component to mock
> > them.
> > http://camel.apache.org/stub
> >
> > On Wed, Jan 17, 2018 at 6:10 PM, Yacov Schondorf
> > <yacov.schond...@gmail.com> wrote:
> > > Hi,
> > > I know how to mock/advise existing routes. But what do I do if one of
> my
> > > routes creates new routes? For example, I can send a configuration
> > message
> > > to a configuration route which has an activeMQ From endpoint. The
> > endpoint
> > > is advised and replaced with direct:a, so I send a configuration
> message
> > in
> > > my test. The route continues by creating a new route from
> > > activeMQ:someTopic to kafka:someTopic. This route fails to create
> because
> > > there is no real ssl-enabled kafka and activeMQ in the test
> environment.
> > Is
> > > there anything that can be done?
> >
> >
> >
> > --
> > Claus Ibsen
> > -
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>
>
>
> --
> יעקב שיינדורף
> מנכ"ל ומנהל פיתוח,
> מילות מפתח לאתרים
> 054-5750201
> http://keywords-4-websites.com <http://keywords-4-websites.com/home.jsp>
>
> יעקב שיינדורף
> מנהל מוסיקלי StyleBrass
> 054-5750201
> http://www.stylebrass.co.il
>


Re: XML External Entity (XXE) - validator vulnerability ?

2018-04-14 Thread Willem Jiang
Hi Karel,

Normally we talk about this kind of issue in the private mailing list[1].
As you already provide a fix for it, you can send a PR [2] with the fix as
the contribution document[3] suggested. I'd happy to apply it into
camel-core.

I'm not sure how did you deploy the camel application. Normally you can
create a patch jar which just has the fixed classed and put it as the first
element in the class path to override the old version of Camel class.

[1]https://www.apache.org/security/#reporting-a-vulnerability
[2]https://github.com/apache/camel
[3]https://github.com/apache/camel/blob/master/CONTRIBUTING.md


Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Sat, Apr 14, 2018 at 7:23 PM, Karel Jelínek <karel.jeli...@unicorn.com>
wrote:

> Dear All,
> we are using XSD validation processor by camel-core library
>
> ...
> .to("validator:classpath:xsd/exportenv70.xsd")
> ...
>
> Our penetration tests found that application can be attacked by "XML
> External Entity (XXE)" (https://www.owasp.org/index.p
> hp/XML_External_Entity_(XXE)_Prevention_Cheat_Sheet#Validator)
>
> We think that classes infected by this vulnerability are
>
> org.apache.camel.processor.validation.SchemaReader.java
> org.apache.camel.processor.validation.ValidatingProcessor.java
>
> Method SchemaReader.createSchemaFactory should also set property
> "factory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");"
>
> Method ValidatingProcessor.doProcess should set property to validator class
>
> Validator validator = schema.newValidator();
> //prevent XXE attack
> validator.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
> validator.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
>
> If we try to validate infected XML against XSD we can see that camel is
> trying to access external site (attackers.site) in this example
>
> 
>  http://attackers.site:53/TEST;>
> %remote;
> %run;
> %trick;]>
>
> Disabling mentioned properties should do the trick
>
> https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Pr
> evention_Cheat_Sheet#Validator
>
>
> I would like to ask you if this will be created as a security BUG in camel
> and if it will be fixed in the future version?
>
> Can we use some workaround? Write our custom implementation of
> ValidatingProcessor? Is it possible?
>
> --
>
> Best regards
>
> Karel Jelínek
> Unicorn Systems
> https://unicorn.com/
>


Re: AWS_S3 consumer unable to delect object with another S3 producer

2018-01-02 Thread Willem Jiang
Hi,

I don't see the aws-s3: prefix in you to endpoint. Can you double check it?


Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Jan 3, 2018 at 10:06 AM, Yi Yan <y...@talend.com> wrote:

> Hi,
>
> I want to move(copy+delete) some objects from one AWS S3 bucket to
> another, so I created the configuration like below, but the source object
> was not deleted after running.
>
> from("aws-s3:SOURCE_BUCKET_NAME?amazonS3Client=#s3_
> client=test1.txt =true")
> .setHeader("CamelAwsS3Key", constant("test1_copy.txt"))
> .setHeader("CamelAwsS3ContentLength", constant(5))
> .to("TARGET_BUCKET_NAME?amazonS3Client=#s3_client=false);
>
>
> Thanks,
> Yi Yan
>
>


Re: why need the jars but i don't use the component?

2017-03-24 Thread Willem Jiang
It looks like you don't put some third party jars in your class path which
are used by the camel components.
If you don't need those camel components, you don't need to include the
components jars when you start up the camel context.


Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Mar 24, 2017 at 9:21 AM, vonezzz <34618...@qq.com> wrote:

> 2017-03-24 08:57:10.011 WARN
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader:299
> loadConverterMethods - Ignoring converter type:
> org.apache.camel.component.xmlrpc.converter.XmlRpcConverter as a dependent
> class could not be found: java.lang.NoClassDefFoundError:
> org/apache/xmlrpc/XmlRpcRequest java.lang.NoClassDefFoundError:
> org/apache/xmlrpc/XmlRpcRequest
> at java.lang.Class.getDeclaredMethods0(Native Method)
> ~[?:1.8.0_121]
> at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
> ~[?:1.8.0_121]
> at java.lang.Class.getDeclaredMethods(Class.java:1975)
> ~[?:1.8.0_121]
> at
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.
> loadConverterMethods(AnnotationTypeConverterLoader.java:262)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(
> AnnotationTypeConverterLoader.java:130)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.
> loadTypeConverters(BaseTypeConverterRegistry.java:602)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.converter.DefaultTypeConverter.doStart(
> DefaultTypeConverter.java:53)
> [camel-core-2.18.1.jar:2.18.1]
> at org.apache.camel.support.ServiceSupport.start(
> ServiceSupport.java:61)
> [camel-core-2.18.1.jar:2.18.1]
> at org.apache.camel.util.ServiceHelper.startService(
> ServiceHelper.java:75)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.doAddService(
> DefaultCamelContext.java:1283)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.addService(
> DefaultCamelContext.java:1243)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.getTypeConverter(
> DefaultCamelContext.java:2369)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(
> DefaultCamelContext.java:2392)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(
> DefaultCamelContext.java:3745)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(
> DefaultCamelContext.java:3086)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.access$
> 000(DefaultCamelContext.java:182)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext$2.call(
> DefaultCamelContext.java:2957)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext$2.call(
> DefaultCamelContext.java:2953)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(
> DefaultCamelContext.java:2976)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(
> DefaultCamelContext.java:2953)
> [camel-core-2.18.1.jar:2.18.1]
> at org.apache.camel.support.ServiceSupport.start(
> ServiceSupport.java:61)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.start(
> DefaultCamelContext.java:2920)
> [camel-core-2.18.1.jar:2.18.1]
> at com.rr.mep.test.CamelTest.main(CamelTest.java:77) [classes/:?]
> Caused by: java.lang.ClassNotFoundException: org.apache.xmlrpc.
> XmlRpcRequest
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> ~[?:1.8.0_121]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> ~[?:1.8.0_121]
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> ~[?:1.8.0_121]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ~[?:1.8.0_121]
> ... 23 more
>
> 2017-03-24 08:57:10.012 WARN
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader:299
> loadConverterMethods - Ignoring converter type:
> org.apache.camel.component.netty.NettyConverter as a dependent class could
> not be found: java.lang.NoClassDefFoundError:
> org/jboss/netty/buffer/ChannelBufferInputStream
> java.lan

Re: Netty Http4 (client): Null body whereas content-length > 0

2017-02-05 Thread Willem Jiang
Hi,

I went through the whole thread, but didn't find out how the
camel-netty4-http endpoint is used (from the camel route).
I guess that something is still missing.



Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Mon, Feb 6, 2017 at 3:07 AM, scoutant <scout...@freesbee.fr> wrote:

> Good evening Claus,
>
> Thank you for your swift reply.
>
> In fact, I have omitted to say that I already turned on the stream caching
> (my fault, I work hard 7/7, please forgine me), by doing this:
>
> getContext().setTracing(true);
> getContext().setStreamCaching(true);
> getContext().getStreamCachingStrategy().
> setSpoolDirectory("./");
> getContext().getStreamCachingStrategy().setSpoolThreshold(64
> * 1024);
> getContext().getStreamCachingStrategy().setBufferSize(130
> * 1024);
>
> Following what I read from Netty4-HTTP component documentation.
> Before setting this during my test sessions, I had same result (body null),
> but no response header as well.
>
> And to be honest, I have also omitted that I set netty configuration like
> this:
>
> NettyHttpConfiguration configuration =
> super.getConfiguration();
>
> //configuration.setAllowDefaultCodec(true); Not supported
> by Netty
> configuration.setAllowSerializedHeaders(false);
> configuration.setConnectTimeout(CONNECT_
> TIMEOUT_IN_SECONDS);
> configuration.setAutoAppendDelimiter(false);
> configuration.setBroadcast(false);
> configuration.setClientMode(true);
> configuration.setDisconnectOnNoReply(true);
> configuration.setKeepAlive(false);
> configuration.setLazyChannelCreation(false);
> configuration.setReconnect(false);
> configuration.setSync(true);
> configuration.setTcpNoDelay(true);
> configuration.setSend503whenSuspended(true);
> configuration.setThrowExceptionOnFailure(true);
> configuration.setTransferException(false);
>
>
> And I have created a JNDI Registry in camel context (I don't think it has
> an
> impact, but).
>
> This time, I promise there is no more hidden information!
>
> By the way, I don't know if it can have an incidence, but the ECB server
> returns a xml file (application/xml), but the content-type indicated is
> "text".
>
> Thanks again for your reply.
> Kind regards,
> Stéphane Coutant
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Netty-Http4-client-Null-body-whereas-content-length-0-
> tp5793490p5793494.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel S3 Issue - Loop for ever

2016-12-04 Thread Willem Jiang
Hi,

Which version of Camel are you using?
There are some JIRAs[1][2] may relate to the problem.

[1]https://issues.apache.org/jira/browse/CAMEL-8431
[2]https://issues.apache.org/jira/browse/CAMEL-9784



Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Mon, Dec 5, 2016 at 11:15 AM, 孙 <sunchao...@126.com> wrote:

> Hello,
>
>
> I am using Camel S3 as a consumer to consume files which were stored in
> AWS S3 Server , But When I start the route ,it will always execute even I
> added "deleteAfterRead" option , then it will raise an exception, because
> there is no file left.
>
>
> Source code like this:
>
>
>
> from("aws-s3:csun-bucket-test" + "?amazonS3Client=#cAWSS3_cAWSConnection_1"
> + "=abcd.txt")
>
> .routeId("s3consumer_cAWSS3_1").process(new org.apache.camel.Processor() {
>
> publicvoid process(org.apache.camel.Exchange exchange) throws Exception {
>
>
>
>
> BufferedReader br = new BufferedReader(
>
> new InputStreamReader((InputStream) exchange.getIn().getBody()));
>
> System.out.println("FileName: " + exchange.getIn().getHeader("CamelAwsS3Key")
> + " Content: "
>
> + br.readLine());
>
> br.close();
>
>
>
>
> }
>
>
>
>
> }).id("s3consumer_cProcessor_1").to("log:s3consumer.cLog_1" +
> "?level=WARN")
>
>
>
>
> .id("s3consumer_cLog_1");
>
>
>
>
>
>
>
> Is it normal or it is a bug ?
>
>
>
>
> Thanks.
>
> Billy.
>
>
>


Re: problems when call Kafka api

2016-12-03 Thread Willem Jiang
Hi,

I cannot see any wrong with route.
You may need to check if the message body is right by using a TCP or HTTP
proxy.
It's helpful for us to find out which part is exactly wrong.



Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Sat, Dec 3, 2016 at 10:13 AM, meng <tianmeng...@gmail.com> wrote:

> Hi,
>
> I'm trying to call a Kafka server and publish an event to my topic.
> For the Kafka server has been warped, I assume I just need to call it as
> other rest server.
>
> Here is my code:
> from("direct:toKafka")
> .marshal()
> .string("UTF-8")
>
> .setHeader("Accept", simple("application/json"))
> .setHeader(Exchange.HTTP_METHOD, HttpMethods.POST)
> .setHeader(Exchange.CONTENT_TYPE,
> simple("application/json"))
> .to("http://event.com:8080/v1/topics/test:publish;)
>
> But it returns 400 error.
>
> There is no error at the server side, for when I use the curl to call it,
> it
> works well.
> Here is my curl command:
> curl -X POST --header 'Content-Type: application/json' --header 'Accept:
> application/json' -d '[
>   {
>myjson
>   }
> ]' 'http://event.com:8080/v1/topics/test:publish'
>
> Any idea?
>
> Thanks,
> Meng
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/problems-when-call-Kafka-api-tp5790965.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: jms to kafka to jms

2016-11-15 Thread Willem Jiang
Hi,

I'm not sure if it relates to the deserializerClass option setting of kafka
consumer,  as you didn't set the option on the kafka endpoint of the second.
BTW, You can use the *jmsMessageType* option on the jms endpoint URL to
force a specific message type for all messages.



Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Nov 16, 2016 at 5:07 AM, Berryman, Eric <berry...@frib.msu.edu>
wrote:

> Hello!
>
> I have two routes; one from jms(BytesMessage) to kafka, and one from kafka
> to jms(BytesMessage).
> When I received my jms object at the end, I noticed it is a TextMessage
> instead of BytesMessage.
>
> from("jms:topic:jmsTopic")
> .to("kafka:kafkaserver:9092?topic=jpa-cache" +
> "=-1"
> + "=org.apache.
> kafka.common.serialization.ByteArraySerializer&"
> + "keySerializerClass=org.
> apache.kafka.common.serialization.ByteArraySerializer");
>
> from("kafka:kafkaserver:9092?topic=jpa-cache=cache&
> autoOffsetReset=earliest=1")
> .to("jms:topic:jmsTopic");
>
> Could someone help me preserve the BytesMessage?
>
> Thank you!
> Eric
>
>


Re: Possible to use nested properties with both spring and camel property placeholders?

2016-11-03 Thread Willem Jiang
It looks like you are using the Spring and Camel Properties component together.
Camel support the {{}} syntax out of box , so you just need to find a way to 
let the spring bean too support :)  

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 3, 2016 at 9:20:25 PM, jimi.hulleg...@svensktnaringsliv.se 
(jimi.hulleg...@svensktnaringsliv.se) wrote:
> Hi,
>  
> I have a Camel project that uses Spring XML, with various settings in a 
> separate settings.properties  
> file. And these settings are used both in plain Spring XML (like arguments to 
> java beans)  
> and in Camel specific configuration (like endpoint URI).
>  
> Here is the part of my camel-context.xml that configures this:
>  
>  
> > />
>  
>  
>  
>  
>  
>  
>  
> #{settingsFileLocation}
>  
>  
>  
>  
>  
>  
>  
>  
>  
> #{settingsFileLocation}
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> And my settings.properties looks like something like this:
>  
> mainDirectory=/opt/main
> inputDirectory=/opt/main/input
> tempDirectory=/opt/main/temp
> outputDirectory=/opt/main/output
> otherDirectory=/opt/main/other
> etc...
>  
> Also, there are one main settings.properties file, and then one 
> environment-specific  
> file, that overrides some properties.
>  
> Now, since there are several properties for directories under the main 
> directory, instead  
> of having to specify "/opt/main" for each one, I would like to re-use the 
> property mainDirectory  
> somehow. Not only would it reduce the manual workload if I would decide to 
> move this folder  
> to a different path, it would mean that I would only have to define 
> inputDirectory, tempDirectory  
> etc in the main settings.properties, and only need to define the 
> mainDirectory property  
> in the environment specific settings.properties.
>  
> But... I can't figure out how to achieve this. If I use this syntax:
>  
> mainDirectory=/opt/main
> inputDirectory={{mainDirectory}}/input
>  
>  
> Then the {{mainDirectory}} isn't replaced when inputDirectory is used when 
> setting  
> up a spring bean
>  
> And if I use this syntax:
>  
> mainDirectory=/opt/main
> inputDirectory=#{mainDirectory}/input
>  
> Then I get:
>  
> Caused by: org.springframework.expression.spel.SpelEvaluationException: 
> EL1008E:(pos  
> 0): Property or field 'mainDirectory' cannot be found on object of type 
> 'org.springframework.beans.factory.config.BeanExpressionContext'  
> - maybe not public?
>  
> Does it exist any solution to this problem? I use Camel 2.17.
>  
> Regards
> /Jimi
>  



Re: netty4(-http) producer workerGroup and producerPool

2016-11-03 Thread Willem Jiang
Hi,

I just checked the code of camel-netty4, the workerGroup can be share between 
the consumers and producers if the option is specified otherwise camel creates 
a new workerGroup per consumer or producer.
The wiki doc is updated, I will commit a quick fix to the camel netty component.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 3, 2016 at 12:55:34 PM, Pundir Avnish (avnish.pun...@tekmindz.com) 
wrote:
> Hi Everyone,
> I am trying to use netty4-http (in producer mode) to connect to remote
> services. Apparently in my use case there are number of different remote
> services (more than 30 in total) I have to talk to. To keep the threads
> management under direct control, I was hoping to use same thread pool
> for all these endpoints. At a glance it looked like sharing workerGroup
> will do the trick. However from the documentation it feels like this
> option is for consumer (at least from the examples in
> http://camel.apache.org/netty4.html) whereas for producer we should be
> using producerPool* properties. I need guidance on following from the
> community experts -
> 1. Is the above understanding correct, i.e. workerGroup can be used ONLY
> with consumer? If not what impact will it have if used with producer and
> more importantly how does it impact/influence producerPool.
> 2. Is it possible to use single executor across all my netty4-http
> producers? I don't see usual option of setting executorServiceRef option
> with either netty4 or nett4-http.
>  
>  
> --
> Thanks,
> *Avnish Pundir*
>  
>  
> --
>  
> --
> Disclaimer: The information contained in this communication is
> confidential, private, proprietary, or otherwise privileged and is intended
> only for the use of the addressee.Unauthorized use, disclosure,
> distribution or copying is strictly prohibited and may be unlawful. If you
> have received this communication in error, please delete this message and
> notify the sender immediately - Samin TekMindz India Pvt.Ltd.
> --
>  



Re: http-conf:client not working

2016-10-16 Thread Willem Jiang
Hi helenlok,
 
CXF uses a bus to pick up the configuration from spring, if the camel-cxf 
endpoint doesn’t have the bus  you may have the trouble to set the client 
configuration from spring.

 http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 14, 2016 at 3:40:18 PM, helenlok (helenlok1...@gmail.com) wrote:
> Hi, I'm trying to edit the default timeout for my web service to wait for a
> response where it is set with a Thread.sleep for 5000 ms.
>  
> I set the timeout to be 1000 ms using http-conf:client and it suppose to be
> timeout in 1000 ms seconds instead but nothing occurs.
>  
> Can someone enlighten me as to what I am doing wrong?
>  
> I had to edit out some of the names of my config file, but everything is
> listed below.
>  
> Thanks a lot.
>  
> (Config file below)
>  
>  
>  
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> xmlns:camel="http://camel.apache.org/schema/spring;
> xmlns:cxf="http://camel.apache.org/schema/cxf;
> xmlns:context="http://www.springframework.org/schema/context;
>  
> xmlns:http-conf="http://cxf.apache.org/transports/http/configuration;
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context.xsd
> http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
> http://camel.apache.org/schema/cxf
> http://camel.apache.org/schema/cxf/camel-cxf.xsd
> http://cxf.apache.org/transports/http/configuration
> http://cxf.apache.org/schemas/configuration/http-conf.xsd;>
>  
>  
> > ConnectionTimeout="1000"/>
>  
>  
>  
>  
> > uri="cxf:http://someservice?dataFormat=PAYLOAD=http://someservice?wsdl&;
> >   
> id="endpointa" />
>  
> > uri="cxf:http://someservice1?dataFormat=PAYLOAD=http://someservice1?wsdl&;
> >   
> id="endpointb" />
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/http-conf-client-not-working-tp5788755.html 
>  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: cxf-core 3.1.7 Validation issue with camel

2016-09-23 Thread Willem Jiang
You need to use the [1] instead of the generic camel endpoint 
to setup the schemaLocations for validation.

http://camel.apache.org/cxf.html#CXF-ConfiguretheCXFendpointswithSpring 
--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On September 23, 2016 at 12:16:21 PM, sari.reach (sari.re...@gmail.com) wrote:
> Any update on this Willem?
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/cxf-core-3-1-7-Validation-issue-with-camel-tp5787728p5787946.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: rabbitmq component headers

2016-09-20 Thread Willem Jiang
You should add the exchangeName parameter to the rabbitmq uri if you don’t want 
to specify the message header there.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On September 21, 2016 at 5:14:54 AM, Emre Kartoglu Ismail 
(ismailemrekarto...@gmail.com) wrote:
> Hello Camel users,
>  
> I have a question regarding the camel-rabbitmq component. The following
> code sends the message “test” to exchange “A” with routing key “B” every
> 5 seconds:
>  
>  
> from("timer:test?period=5000").process(new Processor() {
> @Override
> public void process(Exchange exchange) throws Exception {
> exchange.getOut().setBody("test", String.class);
> exchange.getOut().getHeaders().put("rabbitmq.EXCHANGE_NAME", "A”); **
> exchange.getOut().getHeaders().put("rabbitmq.ROUTING_KEY", "B”); **
> }
> })
> .to("rabbitmq://localhost/A?username=guest=guest=B=1=false");
>   
>  
>  
>  
> However when I comment out the lines with **, the message does not get
> sent. Is this an expected behaviour? I found this stack overflow post,
> essentially discussing the same issue:
> http://stackoverflow.com/questions/22449086/apache-camel-rabbitmq-endpoint-not-creating
>   
> .
>  
> There is a paragraph at http://camel.apache.org/rabbitmq.html that says
>  
> "Headers are set by the consumer once the message is received. The
> producer will also set the headers for downstream processors once the
> exchange has taken place. Any headers set prior to production that the
> producer sets will be overridden.”
>  
> The last sentence seems to suggest that the behaviour I described here
> is expected. My question then is would it not make more sense if we did
> not have to specifically set the headers in the out message?
>  
>  
> Kind regards,
> Ismail
>  



Re: rabbitmq component headers

2016-09-20 Thread Willem Jiang
Even you specify the routingKey in the rabbitmq uri, camel cannot find out the 
exchange name without checking it from message header.
So you cannot comment out the exchange name setting part. 

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On September 21, 2016 at 5:14:54 AM, Emre Kartoglu Ismail 
(ismailemrekarto...@gmail.com) wrote:
> Hello Camel users,
>  
> I have a question regarding the camel-rabbitmq component. The following
> code sends the message “test” to exchange “A” with routing key “B” every
> 5 seconds:
>  
>  
> from("timer:test?period=5000").process(new Processor() {
> @Override
> public void process(Exchange exchange) throws Exception {
> exchange.getOut().setBody("test", String.class);
> exchange.getOut().getHeaders().put("rabbitmq.EXCHANGE_NAME", "A”); **
> exchange.getOut().getHeaders().put("rabbitmq.ROUTING_KEY", "B”); **
> }
> })
> .to("rabbitmq://localhost/A?username=guest=guest=B=1=false");
>   
>  
>  
>  
> However when I comment out the lines with **, the message does not get
> sent. Is this an expected behaviour? I found this stack overflow post,
> essentially discussing the same issue:
> http://stackoverflow.com/questions/22449086/apache-camel-rabbitmq-endpoint-not-creating
>   
> .
>  
> There is a paragraph at http://camel.apache.org/rabbitmq.html that says
>  
> "Headers are set by the consumer once the message is received. The
> producer will also set the headers for downstream processors once the
> exchange has taken place. Any headers set prior to production that the
> producer sets will be overridden.”
>  
> The last sentence seems to suggest that the behaviour I described here
> is expected. My question then is would it not make more sense if we did
> not have to specifically set the headers in the out message?
>  
>  
> Kind regards,
> Ismail
>  



Re: cxf-core 3.1.7 Validation issue with camel

2016-09-20 Thread Willem Jiang
I think you you need to specify the schemaLocation from the spring 
configuration file to let the CXF Endpoint knows about.
Please check the example here[1]

[1]http://camel.apache.org/cxf.html#CXF-ConfiguretheCXFendpointswithSpring

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On September 20, 2016 at 2:49:38 PM, sari.reach (sari.re...@gmail.com) wrote:
> Please find the camel route below. Please let me know if you need additional
> information. I am pasting the exception trace as well.
>  
>  
>  
> >  
> uri="cxf:/HotelBookPort?wsdlURL=hotel/hotelbook.wsdl=PAYLOAD=true"
>   
> />
>  
>  
> > loggingLevel="INFO"/>
>  
>  
>  
>  
> Exception Trace:
>  
> org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused
> by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of
> element 'ATT_CheckRS'..
> at
> org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:99)
>   
> at
> org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:54)
>   
> at
> org.apache.camel.component.cxf.HybridSourceDataBinding$1.write(HybridSourceDataBinding.java:100)
>   
> at
> org.apache.camel.component.cxf.HybridSourceDataBinding$1.write(HybridSourceDataBinding.java:81)
>   
> at
> org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:137)
>   
> at
> org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
>   
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>   
> at
> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)
>   
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>   
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>   
> at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
>   
> at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
>   
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
>   
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
>   
> at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
>   
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)
>   
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)
>   
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)
>   
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/cxf-core-3-1-7-Validation-issue-with-camel-tp5787728p5787746.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: cxf-core 3.1.7 Validation issue with camel

2016-09-19 Thread Willem Jiang
Can you show us the camel route?
It looks like you are trying to send a XML message to the CXF server.
We need to find out where the exception is thrown.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On September 20, 2016 at 3:26:38 AM, sari.reach (sari.re...@gmail.com) wrote:
> cxf-core 3.1.7 is not validating the xml with xsd at appropriate location
>  
> Exception says: Could not generate the XML stream caused by:
> org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of
> element 'ATT_CheckRS'..
>  
> Sample code is as below
>  
> import org.apache.camel.Exchange;
> import org.apache.camel.Message;
> import org.apache.camel.Processor;
>  
> public class TestProcess implements Processor {
>  
> public void process(Exchange exchange) throws Exception {
> Message message = exchange.getOut();
>  
> message.setBody( bindMessage());
> exchange.setOut(message);
> //java.lang.System.out.println("MIP of Http Endpoint is " +
> message);
> java.lang.System.out.println("NEW MIP of Http Endpoint is " +
> exchange.getPattern());
>  
> }
>  
>  
> private String bindMessage(){
> return "> TimeStamp=\"2016-03-08T07:01:30.175Z\" Version=\"1.003\"
> TransactionIdentifier=\"\" PrimaryLangID=\"ENG\"
> xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\;
> xmlns=\"http://www.travel.org/ABC/2003/05\;>"
> +""
> +""
> +""
> +""
> +""
> +""
> +"> Status=\"\" Type=\"4\"/>"
> +""
> +"";
>  
>  
>  
> }
> }
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/cxf-core-3-1-7-Validation-issue-with-camel-tp5787728.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Camel Metrics

2016-09-18 Thread Willem Jiang
How about using the below code to look up the MetricsRegistry :)

context.getRegistry().lookupByNameAndType(“metricRegistry”, 
MetricRegistry.class);

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On September 7, 2016 at 5:01:35 AM, SaurabhNayar (nayar.saur...@gmail.com) 
wrote:
> I have incorporated Camel Statistics in my project. And they are awesome. I
> am trying to capture custom statistics for idempotent Consumer component
> like below: .to("metrics:timer:idempotentTimer?action=start")
> .idempotentConsumer(simple("${body.id}"), jdbcMessageIdRepository)
> .to("metrics:timer:idempotentTimer?action=stop")For some reason, I am not
> able to get the metrics idempotentTimer from the following code:
> MetricsRegistryService metricsRegistry =
> context.hasService(MetricsRegistryService.class); if(metricsRegistry
> != null) { return metricsRegistry.dumpStatisticsAsJson();
> }Or from MetricsMessageHistoryService metricsRegistry =
> context.hasService(MetricsMessageHistoryService.class);
> if(metricsRegistry != null) { return
> metricsRegistry.dumpStatisticsAsJson(); }Any ideas.
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Metrics-tp5787256.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to launch

2016-09-18 Thread Willem Jiang
Hi, 

If you just share one connection between the Scheduler Pooling consumers, it 
could be not effective, as the consumers have to be wait for the connection.
I think it could be reasonable to use the a pool to hold the connections for 
the consumers to share with.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On September 15, 2016 at 1:54:17 PM, Corral A. (acorralor...@gmail.com) wrote:
> Hi,
>  
> I investigated and I would like to know how I sould do the next EIP
>  
> I have 20 scheduler task that launch a task, each with different data but
> using the same component. The component is a custom component that connects
> to a remote service to read data. I would like to instantiate only one
> component for this read tasks.
>  
> Example
>  
> schedule1->data1->readcomponent->persist
> schedule2->data2->readcomponent->persist
> schedule3->data3->readcomponent->persist
>  
> The readcomponent supports SchedulerPoooling but I don't want to use one
> instance by schedule because "readcomponent" is too heavy.
>  
> Is it correct if I develop "readcomponent" for using an external service
> (Spring @Service) that manages only one connection and do the heavy work.
>  
> Regards
> --
> Alberto
>  



Re: [CAMEL-JETTY] How to manage filter-mapping?

2016-03-28 Thread Willem Jiang
I’m afraid you have to define the routes twice if you want to setup different 
filters according to the path.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On March 28, 2016 at 3:49:55 PM, Charlee Chitsuk (charlee...@gmail.com) wrote:
> Hi Willem,
>  
> Thank you very much for your reply.
>  
> If I have more than one resources, e.g "/myweb/foo" and "/myweb/bar". I
> should define the route twice, right?
>  
> from("jetty:http://0.0.0.0:8080/myweb/foo; .)
>  
> from("jetty:http://0.0.0.0:8080/myweb/bar; ..)
>  
> Could you please help to advise further?
>  
> --
> Best Regards,
>  
> Charlee Ch.
>  
> 2016-03-28 14:19 GMT+07:00 Willem Jiang :
>  
> > The filter is applied according to the path of the endpoint, if you just
> > want to apply the filter to the “/myweb/foo/*”, you need to setup the jetty
> > endpoint like this
> > from(“jetty:http://0.0.0.0:8080/myweb/foo” + ...)
> >
> > --
> > Willem Jiang
> >
> >
> > Blog: http://willemjiang.blogspot.com (English)
> > http://jnn.iteye.com (Chinese)
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> >
> >
> > On March 28, 2016 at 9:39:55 AM, Charlee Chitsuk (charlee...@gmail.com)
> > wrote:
> > > Hi,
> > >
> > > I'm trying to put the "servlet-filter" to the "camel-jetty" (version
> > > 2.17.0). At the moment I config the route as the following: -
> > >
> > > from("jetty:http://0.0.0.0:8080/myweb;
> > > + "?matchOnUriPrefix=true&"
> > > + "filtersRef=my-filter&"
> > > + "filterInit.key1=value1")
> > >
> > > Everything work great, the filter applies for "/myweb/*". Anyhow I would
> > > like to apply the filter only for some path, e.g. "/myweb/foo/*".
> > >
> > > Regarding to the "web.xml", we are able to set the 'filter-mapping' by
> > > providing the 'url-pattern', e.g.
> > >
> > >
> > > my-filter
> > > /foo/*
> > >
> > >
> > >
> > > I'm not sure if there is any configuration via the 'camel-jetty' or not.
> > > Could you please help to advise further?
> > >
> > > --
> > > Best Regards,
> > >
> > > Charlee Ch.
> > >
> >
> >
>  



Re: [CAMEL-JETTY] How to manage filter-mapping?

2016-03-28 Thread Willem Jiang
The filter is applied according to the path of the endpoint, if you just want 
to apply the filter to the “/myweb/foo/*”, you need to setup the jetty endpoint 
like this 
from(“jetty:http://0.0.0.0:8080/myweb/foo” + ...)

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On March 28, 2016 at 9:39:55 AM, Charlee Chitsuk (charlee...@gmail.com) wrote:
> Hi,
>  
> I'm trying to put the "servlet-filter" to the "camel-jetty" (version
> 2.17.0). At the moment I config the route as the following: -
>  
> from("jetty:http://0.0.0.0:8080/myweb;
> + "?matchOnUriPrefix=true&"
> + "filtersRef=my-filter&"
> + "filterInit.key1=value1")
>  
> Everything work great, the filter applies for "/myweb/*". Anyhow I would
> like to apply the filter only for some path, e.g. "/myweb/foo/*".
>  
> Regarding to the "web.xml", we are able to set the 'filter-mapping' by
> providing the 'url-pattern', e.g.
>  
>  
> my-filter
> /foo/*
>  
>  
>  
> I'm not sure if there is any configuration via the 'camel-jetty' or not.
> Could you please help to advise further?
>  
> --
> Best Regards,
>  
> Charlee Ch.
>  



Re: Camel kafka route - performance slowing down

2016-03-13 Thread Willem Jiang
Hi,

It’s hard to tell what’s wrong from your information.
Can you set up the trace log[1] to fine out which part is slow?

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

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On March 11, 2016 at 1:53:47 AM, madkak (madhums...@gmail.com) wrote:
> Hi,
>  
> I have written camel Spring DSL route which consumes from JMS queue and
> publishes it to a topic. This route is working fine in general but when
> there is a consistent load for longer time, the route performance is slowing
> down from ~6k msgs/min to ~600 msgs/min.
>  
> Below is my JMS configurations. Can you please help to keep the performance
> consistent always.
>  
>  
> > class="com.ibm.mq.jms.MQQueueConnectionFactory">
>  
>  
>  
>  
>  
> > class="org.springframework.jms.connection.CachingConnectionFactory"
> destroy-method="destroy">
>  
>  
>  
>  
>  
>  
>  
> > class="org.springframework.jms.connection.JmsTransactionManager">
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-kafka-route-performance-slowing-down-tp5778885.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Http Connection Pooling in Camel

2016-03-13 Thread Willem Jiang
If you don’t setup the ConnectionManager on the Http4Component, Camel just 
create a new Connection which is based on the setting of maxTotalConnections 
and connectionsPerRoute.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On March 13, 2016 at 1:02:36 AM, Quinn Stevenson (qu...@pronoia-solutions.com) 
wrote:
> I haven’t used this component very much, but the documentation 
> (http://camel.apache.org/http4.html  
> ) seems to hint at some sort of persistent connections  
> (i.e. maxTotalConnections, connectionsPerRoute, etc).
>  
> > On Mar 11, 2016, at 12:10 AM, Debraj Manna wrote:
> >
> > Hi,
> >
> > I am using Camel as an Orchestration Engine.
> >
> > clients sends HTTP request <-> CAMEL code < HTTP Req- > external
> > server(s)
> >
> > I am using HTTP4 Component (with default settings) for making HTTP Requests
> > to external server. I have quite a few http backends.
> >
> > Right now the way we are making http calls to our backend is as follow:-
> >
> > // The producer is created during app initialisation. This is actually done
> > via blueprint.xml
> > ProducerTemplate producer = camelContext.createProducerTemplate();
> >
> > // Whenever I need to make a http call I am executing the below code with
> > URL set as something like:- "http4://order-api:8099/orders/v1/ordersearch/" 
> >  
> >
> > Exchange exchange = producer.request(URL, new Processor() {
> > @Override
> > public void process(Exchange exchange) throws Exception {
> > log.info("Executing the HTTP request : URL - " + URL + " Headers -
> > " + headers + " Body : " + body);
> > exchange.getIn().setHeaders(headers);
> > exchange.getIn().setBody(body);
> > }
> > });
> >
> > The query I am having is:-
> >
> >
> > 1. Does HTTP4 in the default setting camel uses some http connection
> > pooling while making a call to the external servers?
> > 2. If yes Is there a way I can configure the connection pooling from
> > blueprint.xml?
> >
> > I am using Camel 2.16.1 and the application is deployed in Karaf 3.0.5.
>  
>  



Re: HL7/netty4/BodyType: io.netty.buffer.UnpooledUnsafeDirectByteBuf

2016-01-21 Thread Willem Jiang

It looks like netty handler just releases the UnpooledUnsafeDirectByteBuf 
automatically.
Can you show us a simple test case of it?

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 20, 2016 at 7:23:30 PM, Walzer, Thomas 
(thomas.wal...@integratix.net) wrote:
> I tried . If I try that:
> ...invalidpayloadexception: no body available of type: java.lang.String but 
> has  
> value: UnpooledUnsafeDirectByteBuf(freed) of type: 
> io.netty.buffer.UnpooledUnsafeDirectByteBuf  
> on...
>  
> I am sorry, logging does and did not really work. I had many headers that 
> looked like the  
> body. The body is of type UnpooledUnsafeDirectByteBuf. It does not show with 
> the log-component.  
> And it does not show using the log eip.
>  
> Cheers, Thomas.
>  
>  
> > Am 20.01.2016 um 11:27 schrieb Willem Jiang :
> >
> > Can you just turn the message into String before logging it?
> > It looks like the UnpooledUnsafeDirectByteBuf is consumed.
> >
> > --
> > Willem Jiang
> >
> >
> > Blog: http://willemjiang.blogspot.com (English)
> > http://jnn.iteye.com (Chinese)
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> >
> >
> > On January 19, 2016 at 11:54:39 PM, Walzer, Thomas 
> > (thomas.wal...@integratix.net)  
> wrote:
> >> Hi,
> >>
> >> camel-2.15.2
> >>
> >> I can successfully send to a HL7-Server, however I have troubles accessing 
> >> the resulting  
> >> ACK.
> >> Unfortunately it is of type UnpooledUnsafeDirectByteBuf and type 
> >> conversion to  
> string
> >> fails:
> >>
> >> On delivery attempt: 2 caught: 
> >> org.apache.camel.TypeConversionException:  
> >> Error during type conversion from type: java.lang.String to the required 
> >> type: java.lang.String  
> >> with value UnpooledUnsafeDirectByteBuf(freed) due 
> >> io.netty.util.IllegalReferenceCountException:  
> >> refCnt: 0
> >>
> >> Any ideas how to work with the ACK (besides logging which works)?
> >>
> >> Cheers, Thomas.
> >>
> >
>  
>  



Re: Automatically reading Cache-Control and other Header from the HTTP Component .

2016-01-21 Thread Willem Jiang
Camel http endpoint doesn't apply the Cache-Control header when routing the 
message out according to [this][1].
If you want to keep the message header of "Cache-Control", you need to apply a 
customer [HttpHeaderFilterStrategy][2].


  [1]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.5
  [2]: 
https://github.com/apache/camel/blob/cc9924f41965885af25027fc053adaf21f15b5b4/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHeaderFilterStrategy.java

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 21, 2016 at 8:28:50 PM, Erukala Uttam (2311ut...@gmail.com) wrote:
> Look into this :
> http://stackoverflow.com/questions/34923767/allowing-cache-header-to-passthrough-the-http-component-in-camel
>   
>  
> Please,Can some one suggest a way of doing it.
>  



Re: HL7/netty4/BodyType: io.netty.buffer.UnpooledUnsafeDirectByteBuf

2016-01-20 Thread Willem Jiang
Can you just turn the message into String before logging it?
It looks like the UnpooledUnsafeDirectByteBuf is consumed.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 19, 2016 at 11:54:39 PM, Walzer, Thomas 
(thomas.wal...@integratix.net) wrote:
> Hi,
>  
> camel-2.15.2
>  
> I can successfully send to a HL7-Server, however I have troubles accessing 
> the resulting  
> ACK.
> Unfortunately it is of type UnpooledUnsafeDirectByteBuf and type conversion 
> to string  
> fails:
>  
> On delivery attempt: 2 caught: org.apache.camel.TypeConversionException:  
> Error during type conversion from type: java.lang.String to the required 
> type: java.lang.String  
> with value UnpooledUnsafeDirectByteBuf(freed) due 
> io.netty.util.IllegalReferenceCountException:  
> refCnt: 0
>  
> Any ideas how to work with the ACK (besides logging which works)?
>  
> Cheers, Thomas.
>  



Re: Error Reading Files from four different Routes

2016-01-18 Thread Willem Jiang
Hi,

It looks like the JVM have some trouble to detect the content type of the file.


Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.nio.fs.GnomeFileTypeDetector.probeUsingGio(J)[B+0
j  
sun.nio.fs.GnomeFileTypeDetector.implProbeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+53
j  
sun.nio.fs.UnixFileSystemProvider$2.implProbeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+26
j  
sun.nio.fs.AbstractFileTypeDetector.probeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+16
j  
java.nio.file.Files.probeContentType(Ljava/nio/file/Path;)Ljava/lang/String;+47
j  
org.apache.camel.component.file.GenericFile.populateHeaders(Lorg/apache/camel/component/file/GenericFileMessage;)V+84

To Fix this issue, you may need to write your own FileTypeDetector[1].


[1]http://stackoverflow.com/questions/22679201/java-probecontenttype

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 18, 2016 at 7:48:20 PM, Hubertus.Willuhn 
(hubertus.will...@dinsoftware.de) wrote:
> Hi Community,
>  
> i got an error reading 4 directory (with 1 file per directory) in 4 routes
> with file: endpoint.
> I use Camel 2.16.1 and Spring 4.1.8 as well as Spring Boot 1.2.7.
>  
> After Compiling my code the app starts normal via Spring Boot but after
> initializing my routes the
> app crashes with error:
>  
> # A fatal error has been detected by the Java Runtime Environment:
> (process:15444): GLib-GObject-CRITICAL **: g_object_new: assertion
> `G_TYPE_IS_OBJECT (object_type)' failed
> #
> # SIGSEGV (0xb) at pc=0x7fd4f12ed5e9, pid=15444, tid=140552575444736
> [thread 140552572286720 also had an error]
> #
> # JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build
> 1.8.0_45-b14)
> # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode
> linux-amd64 compressed oops)
> # Problematic frame:
> # C [libglib-2.0.so.0+0x595e9] g_slice_alloc+0x139
> #
> # Failed to write core dump. Core dumps have been disabled. To enable core
> dumping, try "ulimit -c unlimited" before starting Java again
> #
> # An error report file with more information is saved as:
>  
> The saved error log can you see as an attachment: error.log
>  
>  
> My routes are 4 classes (one for every directory) which got there routes
> from a abstract base class.
> Configuration is correct. So all parameters are set.
>  
> The main base route looks like:
>  
> from(producer())
> // split document on each record
> .split().xtokenize(splitPath(), extractionMode(),
> namespaces()).streaming()
> //.tokenizeXML(this.splitPath(), this.root()).streaming()
> // threading
> .parallelProcessing().executorServiceRef(CamelConfig.THREAD_POOL_NAME)
> // TODO filter by parameter
> //.filter(simple("${exchangeProperty.CamelSplitIndex} > 46000"))
> //.setHeader(RECID, this.id())
> .process(processor())
> .to(consumer())
> //.end() // filter
> .end() // split
> .stop();
>  
> The next class implementing some of the parameter functions looks like
>  
> protected String baseDir;
>  
> @Override
> protected Processor processor()
> {
> return (exchange -> {
> String body = exchange.getIn().getBody(String.class);
>  
> // remove whitespaces
> body = body.trim();
>  
> RegEx regex = new RegEx(">\\s+<").exec(body);
>  
> body = regex.replaceAll("><");
>  
> // extract record id
> regex = new RegEx(idExpression()).exec(body);
>  
> if(!regex.hits()) {
> throw new IllegalArgumentException("Invalid XML-content detected: no
> record id found.");
> }
>  
> exchange.getIn().setBody(body, String.class);
> exchange.getIn().setHeader(RECID, regex.group(1));
> });
> }
>  
> protected String idExpression()
> {
> return "> }
>  
> and the last level did the endpoint declaration for the directory:
>  
> @Override
> public Endpoint producer()
> {
> return endpoint("file:" + this.baseDir + "/srv" + "?noop=true");
> }
>  
> @Override
> public Endpoint consumer()
> {
> return endpoint(WI_Aggregator.ENDPOINT);
> }
>  
> @Override
> protected String splitPath()
> {
> return "/CENSRV/WI";
> }
>  
> Did somebody got an idea what to do?
>  
> Best regards
>  
> Hubertus
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Error-Reading-Files-from-four-different-Routes-tp5776391.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Exchange has SOAPMessage want to Send to JMS Topic

2016-01-17 Thread Willem Jiang
If you can treat the SOAPMessage as a stream, you can just redirect this stream 
to the JMS topic without doing anything more.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 15, 2016 at 2:54:02 PM, sanjay.gautam (sanjay.gau...@gmail.com) 
wrote:
> I am new to the Camel world and what I am trying to do is as follows.
>  
> 1. There is a route which is Servlet Component which is called by external
> System.
> 2. MyServlet CamelComponent Reads the incoming exchange and creates the
> SOAPMessage.
> 3. In Next Step I want to send the SOAP message to JMS Topic.
>  
> > class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">  
>  
>  
>  
>  
>  
> > class="org.apache.camel.component.jms.JmsConfiguration">
>  
>  
>  
>  
> > class="org.apache.activemq.camel.component.ActiveMQComponent">
>  
>  
>  
> JMS ROUTE
> At this point I Have a Exchange with SOAPMessage into it and as per the SOAP
> documentation I should be able to send SOAP message via JMS , but as per
> document JMS can take only few types ?
> I was expecting that CAMEL might have some internal Converter like
> MessageTransformer.SOAPMessageIntoJMSMessage(soapMessage, session);
> which help in converting the message . I tried Spring Converter but it
> doesnt not convert actually.
>  
>  
>  
>  
>  
> > uri="activemq:topic:exampleTopic?messageConverter=#jmsMsgConverter"
> pattern="InOnly" />
>  
>  
> OK
>  
>  
>  
>  
>  
> java.lang.Exception
>  
>  
>  
>  
>  
>  
> Please suggest me any option , I can surely unmarshel and get the details
> form the SOAP message but i dont want to do that as that is not our
> requirement. we dont need to looking into the message
>  
> thanks
> Sanjay G
>  
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Exchange-has-SOAPMessage-want-to-Send-to-JMS-Topic-tp5776268.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Issue with maximumPoolSize & Netty4-http component

2016-01-14 Thread Willem Jiang
Hi Charles,

I just created a JIRA[1] for it and will back port the patch CAMEL-8031 to 
camel-netty4 shortly.

[1]https://issues.apache.org/jira/browse/CAMEL-9514 

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 14, 2016 at 3:43:27 PM, Charles Moulliard (ch0...@gmail.com) wrote:
> The workaround only work for the netty4-http but not when we use it with
> the Rest DSL
>  
> This syntax
>  
> @Override
> public void configure() throws Exception {
> // configure to use netty4-http on localhost with the given
> port
> restConfiguration()
> .component("netty4-http")
> .host("localhost").port(getPort())
> .endpointProperty("nettyHttpBinding", "#mybinding")
> .componentProperty("maximumPoolSize","2");
>  
> // use the rest DSL to define the rest services
> rest("/users/")
> .get("{id}/basic")
> .route()
> .log(">> Thread name : ${threadName}")
>  
> will continue to use 16 Threads when we send concurrently 20 messages
>  
> On Thu, Jan 14, 2016 at 8:26 AM, Charles Moulliard wrote:
>  
> > Hi Willem,
> >
> > Thx for your input. I have fixed my problem by setting the parameter on
> > the component itself
> >
> > public void configure() throws Exception {
> >
> > NettyHttpConfiguration nettyConfig = new
> > NettyHttpConfiguration();
> > nettyConfig.setMaximumPoolSize(2);
> > NettyHttpComponent nettyHttp = new NettyHttpComponent();
> > nettyHttp.setConfiguration(nettyConfig);
> >
> > getContext().addComponent("netty4-http", nettyHttp);
> > nettyHttp.start();
> >
> > // expose a echo service
> > from("netty4-http:http://localhost:{{port}}/echo;)
> > .log(">> Thread name : ${threadName}")
> >
> > .transform(body().append(body())).to("mock:result");
> > }
> >
> > Only 2 threads are created now
> >
> > Regards,
> >
> > Charles
> >
> > On Thu, Jan 14, 2016 at 2:33 AM, Willem Jiang  
> > wrote:
> >
> >> Hi Charles,
> >>
> >> You should be able to setup the maximumPoolSize on the Netty4-http
> >> component level due to CAMEL-8031[1].
> >> And the maximumPoolSize only works for consumer side.
> >>
> >> [1]https://issues.apache.org/jira/browse/CAMEL-8031
> >>
> >> --
> >> Willem Jiang
> >>
> >>
> >> Blog: http://willemjiang.blogspot.com (English)
> >> http://jnn.iteye.com (Chinese)
> >> Twitter: willemjiang
> >> Weibo: 姜宁willem
> >>
> >>
> >>
> >> On January 14, 2016 at 1:09:04 AM, Charles Moulliard (ch0...@gmail.com)
> >> wrote:
> >> > Hi,
> >> >
> >> > When I debug this unit test
> >> > https://gist.github.com/cmoulliard/123261f7ac2a9d5c719c, the Camel
> >> Netty4
> >> > HTTP Endpoint is well created with the param "maximumPoolSize=2"
> >> >
> >> > main TRACE [org.apache.camel.impl.DefaultComponent] - Creating endpoint
> >> > uri=[netty4-http://http://localhost:26025/echo?maximumPoolSize=2],
> >> path=[
> >> > http://localhost:26025/echo], parameters=[{maximumPoolSize=2}]
> >> >
> >> > but the number of threads reported by Netty is still bigger than 2
> >> >
> >> > Camel (camel-1) thread #4 - NettyEventExecutorGroup INFO [route1] - >>
> >> > Thread name : Camel (camel-1) thread #4 - NettyEventExecutorGroup
> >> > Camel (camel-1) thread #3 - NettyEventExecutorGroup INFO [route1] - >>
> >> > Thread name : Camel (camel-1) thread #3 - NettyEventExecutorGroup
> >> > Camel (camel-1) thread #2 - NettyEventExecutorGroup INFO [route1] - >>
> >> > Thread name : Camel (camel-1) thread #2 - NettyEventExecutorGroup
> >> > Camel (camel-1) thread #1 - NettyEventExecutorGroup INFO [route1] - >>
> >> > Thread name : Camel (camel-1) thread #1 - NettyEventExecutorGroup
> >> > Camel (camel-1) thread #0 - NettyEventExecutorGroup INFO [route1] - >>
> >> > Thread name : Camel (camel-1) thread #0 - NettyEventExecutorGroup
> >> > Camel (camel-1) thread #4 - NettyEventExecutorGroup INFO [route1] - >>
> >> > Thread name : Camel (camel-1) thread #4 - NettyEventExecutorGroup
> >> > Camel (camel-1) thread #3 - NettyEventExecutorGroup INFO [route1] - >>
> >> > Thread name : Camel (camel-1) 

Re: How to set SOAP Headers in SOAP Message - Camel blueprint

2016-01-13 Thread Willem Jiang
You need to setup the security provider just like this[1], but you need to use 
the namespace of the camelcxf instead.

[1]http://cxf.apache.org/docs/ws-securitypolicy.html

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 14, 2016 at 12:14:47 AM, Satyam Maloo (maloosat...@gmail.com) wrote:
> Hi Team,
>  
> I am using Camel blueprint 2.10, CXF 2.6, JBoss Fuse 6.0.
> I am facing an issue trying to connect to Microsoft IIS 8.5 SOAP services
> with securityPolicy enabled. Provider is expecting to generate a sample SOAP
> request like below. but my SOAP request is generated without the
> tag, Do I need to manually code in Java for this or can I set
> it in the camel-route.xml - what am I missing, can you please throw some
> light.
>  
>  
>  
>  
> >  
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd;
>   
>  
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd;
>   
> soap:mustUnderstand="1">
> > xmlns:xenc="http://www.w3.org/2001/04/xmlenc#;
> Id="EK-12747936E7F83C159813176421345694">
> > Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5; />
>  
>  
>  
>  
> CN=localhost
>  
> 1317633571
>  
>  
>  
>  
>  
>  
>  
> ZmdQmouQD3MmR8gTHaMDncmNXZ8S4pkl+qdDK7nqy2iBHpy/HTWdCMgRnolmAwlzT6hy9e4+BRCTbwZLHSvad39MtOk+O/HQFTLqGBrLl7ne0aUQG98WXV3n2iSTnp7L1MsherqDHK5FSgx7VpM70U2C+25ny+IU23mp5NRWat4=
>   
>  
>  
>  
>  
>  
>  
>  
> > xmlns:xenc="http://www.w3.org/2001/04/xmlenc#;
> Id="ED-4" Type="http://www.w3.org/2001/04/xmlenc#Element;>
> >  
> Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc; />
>  
> >  
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd;
>   
>  
> xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd;
>   
>  
> wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey;>
>   
> > URI="#EK-12747936E7F83C159813176421345694" />
>  
>  
>  
>  
> yYYbMK88LqUrx0FtoelxODzyom2qX4n5HD8d+ZvNMQmUhSOoVOULpKoU2nb5kiLKBwDeyJZSl1XroHZ94KBqqxHMddGUc79l3lf9GCMRyNZWpY9atd3YxBrw6pKmGwHIcaKZIBWNMoq9R6iyDqK0JBo835KgSFmu2WvLmhrXTVtvsS64gw2tukYdf+KSJW7Mr3f+Ujp9usH6Jeh4O7njtsDNm101c0B+M39xbo+WNJfKDMkpn2y/am23656KPF/5ZAxBQ+VNc1NoC1VvPd2Hk2l+7fQWse+1a7fA3Sim6ODZMTVOwBbgxU5Z3FQPZc/BldqX9G/TC1b/UHI9rVfcUMBJPQ6ptARwrelLvb79hyu9xSJ/sfby9R7QlT2hDPxz1Qw/H7wAWfvdjO3ztcsI2SwThrRLmf+D1hpwY04hns9ltcIv4YgeoXQZKzFZB07Km8FeQwD0yPXx2fY4+2oCpnx8DlL9PjHiA81Pukj6TBjSb+pQXthF9bw///kcC/jMxSPUfzrQYu6xyLwr7gTZ8mtFDt3PSaWPxgQBz503+/lcSVCwk63tg2RiWxbDCxYbbJHTES7Gnet29McMN4VGPdfZxA7UFFuUk+q/AGpyZ9zMFw1e/kcnROrgjnvKshVLFJ1T7s+7QSmtm17AmwBvwJVvrHbnoAmIc5lgfMzs5tP+Z+FTnktjzBmeDjRNtDXCs7knckWkiXg5bw0sl3U6+VPr+m3XOglpuFSlIijZoXCvOGnWNqj6DvavhM4JJq5dP6X7mLlZExz06ldWXfa3zOK9FUW3a5v2FeY8y9CJhG038QBObwRNBFyTn9vEhkTp3gALEbAopNuw/n5igsXQgVgWiFJVZ7yNzXUVtOa1ujcy9Rrnr/MXVms9XIoswBKftTTBvpFeieA8ol5NRUYWECVE289SLocC/DWKf2yLsB6GeUen4SNt9qv052BfKOCYMGFiWtnYrfPcmZmDAxdkiDYqDzRWtt0eBbkbB2qWiUDrdq38IPv9z4CasaTmH90FpOojCshdaDOKjEYfNfQboeJ6Z7n7P/g7qzBL0PSiTX/XRc/p+5hXNZj9+K/GDjuS26VC2L2ZYfgVxbR8H3Pnkqfcjh/QOG1YHgvTUw16bFRjK2stHjWcovAdhMO7KMlJM9ZcQO3tQEn7TCJMCsEV8ij0XUv7B7NR1JUZxbhPWzNh4EeQcBKFzdB2nRr4N0DP3yCMf+02u+kMBVjCzkeaa100c+B7PjAmS2Lp3HRNaDQp/71FdQocr+wySaj8VpD4XIrdA1OhSvW0g1Xi0zzgOUNpO4S/UtorI3bxmE2221AeqOJ79t7k0zOEvpRvdHdJKeg5zHmQ5LgPsWVmcOnzd2RuYCXOumpB5GtOJ8lptwaaUD9OfdD9YSt3R1BmXimRvNfyVvjbkgbGhDNwwE4I2rhY2/YBJV76Hidrip5fNEhu/1yX/QvLpxVirWn7YWKjlYqlfBo2tCGeH3JUHec++fJJwVJr7nB+eaLbQ0+QCl+1PTkz/7Q1ETNosnXc63BLn5SoAwRAuCOEhjfIvB2Lye3xLMFO1E/mGMie33EvfGRRQZ+n4GWpRJAf4W+deG9SA1+YmRW5p4C48ETL1bliMZy6EApuuIYACRiYW/XItXKLdxgC83Nukvz4rrEz4EwrqX1Z1Vn+m/xpH3RMzWOtC7jeywM0Isa7skzjXuZrlAdv1dnfjBj8h3sRPoBwnZXJ7ref8/Kx7PPSQEUOT1buSTc9Qdlt9hMVjgm+INcvc6YkWQ7YAJgcwciCo1AN6M0NMKAzbp7eitd5p7uaZbui+B3VwtH1798q7pVVBh9JZVGEQMQOX3YZvFo1ls/vTIdS8hiOKtg661y98P/1YECOPElyzPIL1lTC19nRBW1yKMN6UffAxj8nWxzoCv2SOxMH8HfAzE8N8ZdGx+neRCl3hRS5ODfqkWWsep/RF5tJEjVgHnpDqZZYtbppkpydHqCS70UxPK5KgpEV59t12+QrwGvv0pyR7EUvLDdvLbaoA2lSpTIBM6WQENA26Vnq46A6sVQ56h0RpFul0X0ckPNEqDCkGKsMK9Co0lJ+t2/XTESA6B2wjXtiNdXfnDhM0lDHrLqkIYIIN/BboCo4KXWTdwqBhFNSGoOJAthsUccK/pyByIcfPhxkFQMr4jTY83GhFq0vjMkzvM0Hv98yKSYM4kncNdM5kK5zTRQfUu7gUUVYdpkOpUDVhn7xBB9PuQr2gPFC0atbG+0teanmarEd88NlysVNOWoEeiUYwzTqwYV7kVuvN6+SIb1nIqpUYVVKQm2oo14EwbIn/2IjnyuMinkbsaEl2D+C1LLw69LHvVGhtMPVNiBMCVcINgr+9dA2ARariJgpl7WrkfRS9KBBAXgbkk10CJnUT8enoeaUbiB17MoATxUc3O3hzLiYGFwG4PNcW5OKC7JRiUiLAK75GIW9lH/dNsLZpHs6X9525BXALK23d+9+gMb1sePvvNSixeByU7FXK4bGD+l5X1Mfz4/EgNZrXOE9lEx+h8diNGi4DLUignh2xza7SPTO5fO

Re: Issue with maximumPoolSize & Netty4-http component

2016-01-13 Thread Willem Jiang
Hi Charles,

You should be able to setup the maximumPoolSize on the Netty4-http component 
level due to CAMEL-8031[1].
And the maximumPoolSize only works for consumer side.

[1]https://issues.apache.org/jira/browse/CAMEL-8031

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 14, 2016 at 1:09:04 AM, Charles Moulliard (ch0...@gmail.com) wrote:
> Hi,
>  
> When I debug this unit test
> https://gist.github.com/cmoulliard/123261f7ac2a9d5c719c, the Camel Netty4
> HTTP Endpoint is well created with the param "maximumPoolSize=2"
>  
> main TRACE [org.apache.camel.impl.DefaultComponent] - Creating endpoint
> uri=[netty4-http://http://localhost:26025/echo?maximumPoolSize=2], path=[  
> http://localhost:26025/echo], parameters=[{maximumPoolSize=2}]
>  
> but the number of threads reported by Netty is still bigger than 2
>  
> Camel (camel-1) thread #4 - NettyEventExecutorGroup INFO [route1] - >>
> Thread name : Camel (camel-1) thread #4 - NettyEventExecutorGroup
> Camel (camel-1) thread #3 - NettyEventExecutorGroup INFO [route1] - >>
> Thread name : Camel (camel-1) thread #3 - NettyEventExecutorGroup
> Camel (camel-1) thread #2 - NettyEventExecutorGroup INFO [route1] - >>
> Thread name : Camel (camel-1) thread #2 - NettyEventExecutorGroup
> Camel (camel-1) thread #1 - NettyEventExecutorGroup INFO [route1] - >>
> Thread name : Camel (camel-1) thread #1 - NettyEventExecutorGroup
> Camel (camel-1) thread #0 - NettyEventExecutorGroup INFO [route1] - >>
> Thread name : Camel (camel-1) thread #0 - NettyEventExecutorGroup
> Camel (camel-1) thread #4 - NettyEventExecutorGroup INFO [route1] - >>
> Thread name : Camel (camel-1) thread #4 - NettyEventExecutorGroup
> Camel (camel-1) thread #3 - NettyEventExecutorGroup INFO [route1] - >>
> Thread name : Camel (camel-1) thread #3 - NettyEventExecutorGroup
> Camel (camel-1) thread #4 - NettyEventExecutorGroup INFO [route1] - >>
> Thread name : Camel (camel-1) thread #4 - NettyEventExecutorGroup
> Camel (camel-1) thread #0 - NettyEventExecutorGroup INFO [route1] - >>
> Thread name : Camel (camel-1) thread #0 - NettyEventExecutorGroup
> Camel (camel-1) thread #2 - NettyEventExecutorGroup INFO [route1] - >>
> Thread name : Camel (camel-1) thread #2 - NettyEventExecutorGroup
>  
> Do I have to use another param to set the ThreadPool used by Netty4-http ?
>  
>  
> Regards,
>  
> --
> Charles Moulliard
> Apache Committer & PMC / Architect @RedHat
> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>  



Re: camel-http-common 2.16.1 includes Servlet API 3.0

2016-01-13 Thread Willem Jiang
As we are don’t suppose to change the third part dependencies unless there is a 
security issue. You have to do the excludes setting yourself.

But I think we can update the servlet API dependency to 3.1[1] in the camel 
master branch.

[1]https://issues.apache.org/jira/browse/CAMEL-9513

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 14, 2016 at 12:09:28 AM, nascha (nadia.schach...@avature.net) wrote:
> This is very similar to issue CAMEL-8803
> which was about
> camel-jetty9: "two conflicting and different versions of several classes
> [are included]. Both the Servlet API 3.0 version and Servlet API 3.1 version
> are included as (transitive) dependencies."
>  
> This same issue is caused in 2.16.1 by camel-http-common which depends on
> geronimo-servlet_3.0_spec
> So a project with both camel-jetty (now using 3.1) and camel-http4 (which
> includes camel-http-common, now using 3.1) will have the two conflicting
> specs.
>  
> Could this be changed?
> Thanks.
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-http-common-2-16-1-includes-Servlet-API-3-0-tp5776203.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Is there an Apache Camel FTP server component available ?

2016-01-11 Thread Willem Jiang
No, we don’t have the Camel FTP server component.
If you want to consume the file from the FTP server, you can just use camel ftp 
component directly.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 12, 2016 at 10:09:15 AM, Jack Ding (hding...@yahoo.com.invalid) 
wrote:
> Hi,
> Could anybody advise if there is an Apache Camel FTP server component 
> available?
> Thanks!
>  



Re: Camel jetty filtersRef how to set init parameters for filter

2016-01-11 Thread Willem Jiang
I can reproduce the issue, so I just fill a JIRA[1] to add a new option of 
initParameters to the jetty endpoint uri. You can setup those parameters for 
your filter.


[1]https://issues.apache.org/jira/browse/CAMEL-9501 

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 10, 2016 at 10:10:39 PM, J- (jmand...@hotmail.com) wrote:
> The problem is, when jetty starts up the filter it calls the filters init 
> method again  
> essentially erasing whatever i set in the init manually.
>  
> -J
>  
> ____
> From: Willem Jiang  
> Sent: Sunday, January 10, 2016 4:47 AM
> To: users@camel.apache.org; J-
> Subject: Re: Camel jetty filtersRef how to set init parameters for filter
>  
> As camel-jetty doesn’t leverage the web.xml to setup the filters, I don’t 
> think there  
> is a blocker when calling the filter init method yourself.
> When you setup the filters instance to the Camel registry, you can call the 
> filter init  
> method to pass the parameters yourself.
>  
>  
> --
> Willem Jiang
>  
>  
> Blog: http://willemjiang.blogspot.com (English)
> http://jnn.iteye.com (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>  
>  
>  
> On January 10, 2016 at 2:27:44 AM, J- (jmand...@hotmail.com) wrote:
> > Hi i see how you can set a servlet filter on the Jetty component with the 
> > filtersRef option,  
> > but i need to set a couple init parameters on the filter object when it's 
> > init gets called.  
> >
> >
> > Is this possible to do?
> >
> >
> > Thanks.
> >
>  
>  



Re: Camel Netty4 component tcp client reconnect limit

2016-01-10 Thread Willem Jiang
I just checked the code, camel just calls the openChannel method recursively 
until the connection is established when starting the NettyConsumer in client 
mode.
It could be good idea to fail fast by throwing the exception out after a couple 
of retries.


--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 8, 2016 at 5:01:12 PM, Jojo Paderes (jojo.pade...@gmail.com) wrote:
> On Fri, Jan 8, 2016 at 4:50 PM, Claus Ibsen wrote:
>  
> >
> > I do not think so. But if there was such an option what should happen
> > after the exception? Should it just never try again? Or is the idea to
> > have an error being logged every 20th failed attempt or something?
> >
> >
> What I have in mind is that the tcp client will reconnect for a certain
> number of attempts (can be set as an option in the endpoint url), and if
> the connection still fails after x attempts an exception is thrown (which
> is then handled in Camel error handling).
>  



Re: deadLetterHandleNewException(false) seems to not work as expected

2016-01-10 Thread Willem Jiang
Can you share your camel route with us?


--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 8, 2016 at 11:54:55 PM, lchdev (lch...@outlook.be) wrote:
> - Bump -
>  
> Still having to work around the issue. Anyone having an idea ?
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/deadLetterHandleNewException-false-seems-to-not-work-as-expected-tp5775138p5776020.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Camel jetty filtersRef how to set init parameters for filter

2016-01-10 Thread Willem Jiang
As camel-jetty doesn’t leverage the web.xml to setup the filters, I don’t think 
there is a blocker when calling the filter init method yourself. 
When you setup the filters instance to the Camel registry, you can call the 
filter init method to pass the parameters yourself.


--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 10, 2016 at 2:27:44 AM, J- (jmand...@hotmail.com) wrote:
> Hi i see how you can set a servlet filter on the Jetty component with the 
> filtersRef option,  
> but i need to set a couple init parameters on the filter object when it's 
> init gets called.  
>  
>  
> Is this possible to do?
>  
>  
> Thanks.
>  



Re: camel-netty: How to set the netty closeChannelTimeMillis option?

2015-10-11 Thread Willem Jiang
It looks like you need to setup the sync option to be true when wiretapping the 
message. 

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 8, 2015 at 12:52:20 PM, SteveR (srichard...@vonage.com) wrote:
> Hi Willem:
>  
> Thanks for taking the time to reply. Actually, we have not been specifying
> the camel-netty *udpConnectionlessSending=true *option, and I see that the
> default is *false* if not explicitly specified.
>  
> We were actually contemplating to set *udpConnectionlessSending=true*,
> thinking that it might help.
>  
> The Camel route in question is shown below. The issue we are having in
> production, is that we see a flooding of the below ERROR messages in our
> Camel *rootLog.txt* which indicates a problem with *ClosedChannelException
> *when trying to mirror the received UDP packets to a remote host via the
> Camel wireTap() shown in the route below. Note also, that the remote host
> attempts to ACKknowledge each received UDP packet that this Camel route
> mirrors to it. So I hope those ACKs do not cause any strange side effects
> to the Camel route. We're stuck on exactly how to go about debugging this
> issue. So the wireTap portion of the route seems to mostly be failing.
> However, some UDP packets do get through to the remote host.
>  
> Any thoughts are greatly appreciated.
>  
> Thanks, SteveR
>  
>  
> > xmlns="http://camel.apache.org/schema/spring;>
> > uri="netty:udp://talend-es-edge-01.kewr0.s.missionnetworks.net:1?serverPipelineFactory=#CQMS_SERVER_PIPELINE_FACTORY_ROUTE_ID_RAW_CQMS_EVENTS=true=true=false=8388608=8388608=false=false=8192"/>
> >   
>  
> iso-8859-1
>  
> > threadName="threads_ROUTE_ID_RAW_CQMS_EVENTS" callerRunsWhenRejected="true" 
> >  
> id="threads1">
> > uri="netty:udp://abinitio-edge-01.kewr0.s.missionnetworks.net:1?clientPipelineFactory=#CQMS_CLIENT_PIPELINE_FACTORY_ROUTE_ID_RAW_CQMS_EVENTS=false=8388608=false=false"
> >   
> customId="true" id="ROUTE_ID_RAW_CQMS_EVENTS_MIRROR"/>
>  
> > uri="seda:SEDA_TOP_102?size=10=10=Never=true=1"
> >   
> id="to1"/>
> > uri="seda:SEDA_ACK_103?size=10=10=IfReplyExpected=true=1"
> >   
> customId="true" id="ROUTE_ID_RAW_CQMS_EVENTS_TO_FIRST_URIS"/>
>  
> iso-8859-1
>  
>  
>  
>  
>  
> [2015-10-07 17:47:26,958] ERROR [Camel (MPLR_CQMS) thread #55 - WireTap]
> Failed delivery for (MessageId:
> ID-talend-es-edge-01-kewr0-s-missionnetworks-net-45813-1444160612354-0-21342281
>   
> on ExchangeId:
> ID-talend-es-edge-01-kewr0-s-missionnetworks-net-45813-1444160612354-0-21342282).
>   
> Exhausted after delivery attempt: 1 caught:
> java.nio.channels.ClosedChannelException
>  
> Message History
>  
> ---
>   
> RouteId ProcessorId Processor
> Elapsed (ms)
> [ROUTE_ID_RAW_CQMS_] [ROUTE_ID_RAW_CQMS_]
> [udp://talend-es-edge-01.kewr0.s.missionnetworks.net:1
> ] [ 1]
> [ROUTE_ID_RAW_CQMS_] [setProperty1 ] [setProperty[CamelCharsetName]
> ] [ 0]
> [ROUTE_ID_RAW_CQMS_] [threads1 ] [threads
> ] [ 1]
> [ROUTE_ID_RAW_CQMS_] [ROUTE_ID_RAW_CQMS_]
> [wireTap[netty:udp://abinitio-edge-01.kewr0.s.missionnetworks.net:1?clientPi]
>   
> [ 0]
>  
> Exchange
>  
> ---
>   
> Exchange[
> Id
> ID-talend-es-edge-01-kewr0-s-missionnetworks-net-45813-1444160612354-0-21342282
>   
> ExchangePattern InOnly
> Headers
> {breadcrumbId=ID-talend-es-edge-01-kewr0-s-missionnetworks-net-45813-1444160612354-0-21342277,
>   
> CamelNettyChannelHandlerContext=org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext@5efa3b3c,
>   
> CamelNettyLocalAddress=/69.59.252.44:1, CamelNettyMessageEvent=[id:
> 0x5612eec3, /69.59.252.44:1] RECEIVED: { "protocol":"MQDP-2",
> "CQM_STREAM_INFO": "P_RTCP_XRVM_COUNT":10} ] } } from
> /69.59.248.171:, CamelNettyRemoteAddress=/69.59.248.171:,
> CamelRedelivered=false, CamelRedeliveryCounter=0}
> BodyType String
> Body { "protocol":"MQDP-2", "CQM_STREAM_INFO":
> "P_RTCP_XRVM_COUNT":10} ] }}
> ]
>  
> Stacktrace
>  
> ---

Re: Consume all files in aws S3 where deleteAfterRead = false

2015-10-07 Thread Willem Jiang
Hi,

I just went through the Java Doc of the ListObjectsRequest, there are some 
misunderstanding of the setMarker and getMarker method. I will commit a quick 
fix for it shortly.
At the mean time I just reopen the JIRA[1]

[1]https://issues.apache.org/jira/browse/CAMEL-8431  

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 8, 2015 at 2:19:32 AM, Akram (akram.s...@gmail.com) wrote:
> Is there a way to consume all the files in a S3 bucket without removing the
> files from S3. If we set deleteAfterRead=false then it is polling the same
> messages again and again. I noticed the Jira ticket for the same has been
> resolved, but still i am facing the same issue. I am using camel 2.15
> version
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Consume-all-files-in-aws-S3-where-deleteAfterRead-false-tp5772387.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: camel-netty: How to set the netty closeChannelTimeMillis option?

2015-10-07 Thread Willem Jiang
Hi,

We use an object pool (from apache common pool) to cache the open channel to 
save the connection time. As we don’t have the ChannelPool like the linked 
norbert, so we don’t have the closeChannelTimeMillis option.
For you case it looks the cached the channel was closed when it is still send 
message.
As the camel-netty always checks the channel object before borrowing it from 
the object pool, it could cause some trouble if you are using the 
UdpConnectionlessSending[1].

Can you check if you are using the UdpConnectionlessSending in your case.

[1]https://github.com/apache/camel/blob/master/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyProducer.java#L571
--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 6, 2015 at 11:44:34 PM, SteveR (srichard...@vonage.com) wrote:
> On further investigation, I see that the *closeChannelTimeMillis* option is
> not a *netty *option, but rather an option for
> com.linkedin.norbert.javacompat.network.NetworkClientConfig
>  
> .
>  
> The Norbert ChannelPool closing channels prematurely
> JIRA issue is still in the
> unresolved state.
>  
> We are are facing a similar issue in production (with very similar stack
> traces for Norbert scenarios 2 and 3, as shown in the JIRA issue) and were
> hoping for a resolution to this similar issue.
>  
> Any thoughts on this are appreciated.
>  
> Thanks, SteveR
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-netty-How-to-set-the-netty-closeChannelTimeMillis-option-tp5772342p5772347.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: rabbitMQ message forwarding from one queue to another

2015-09-21 Thread Willem Jiang
Which version of Camel are you using?

If you want to route the message between two rabbitMQ endpoint you need to 
setup the option of bridgeEndpoint just like this.

                
                        <camel:from 
                                
uri="rabbitmq://localhost:5672/inbox?username=guestpassword=guest" />
                        
                

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On September 18, 2015 at 7:20:54 PM, prajath (prajig...@gmail.com) wrote:
> Hi All,
> could you please help me to resolve the problem I am facing when forwarding
> message from one queue to another , please see the spring xml.
> thanks in advance
> prajath
>  
>  
> > uri="rabbitmq://localhost:5672/outBox?sername=guest=guest"  
> />
>  
>  
>  
> > uri="rabbitmq://localhost:5672/inbox?username=guest=guest"  
> />
> >  
> uri="rabbitmq://localhost:5672/outBox?username=guest=guest"  
> />
>  
>  
>  
>  
>  
> ${body}Message at ${date:now:-MM-dd HH:mm:ss}
>  
>  
> > uri="rabbitmq://localhost:5672/inbox?username=guest=guest"  
> />
>  
>  
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/rabbitMQ-message-forwarding-from-one-queue-to-another-tp5771632.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: camel:netty udpConnectionlessSending option and "Too many open files"

2015-09-14 Thread Willem Jiang
How did you use the camel:netty component?
Camel always try to reuse the cached channel object if it is possible, can you 
share some detail of your camel route.

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On August 17, 2015 at 9:51:02 PM, SteveR (srichard...@vonage.com) wrote:
> I'm using Camel 2.15.2 and the *camel-netty* component and I have a Camel
> route that mirrors UDP datagrams to a remote server via *netty:udp*.
>  
> I saw that *camel-netty *supports the *udpConnectionlessSending *option, and
> I thought it would be a good idea as it will not result in failures when the
> remote server is not listening.
>  
> However, when I set *udpConnectionlessSendin=true* and then send lots of UDP
> packets into the route, my Linux box quickly exhausts file descriptors and I
> get the below java exception.
>  
> Any thoughts appreciated,
> Thanks, Steve
>  
>  
> *org.jboss.netty.channel.ChannelException: Failed to open a
> DatagramChannel.*
> at
> org.jboss.netty.channel.socket.nio.NioDatagramChannel.openNonBlockingChannel(NioDatagramChannel.java:94)
>   
> ~[netty-3.9.6.Final.jar:?]
> at
> org.jboss.netty.channel.socket.nio.NioDatagramChannel.(NioDatagramChannel.java:58)
>   
> ~[netty-3.9.6.Final.jar:?]
> at
> org.jboss.netty.channel.socket.nio.NioDatagramChannelFactory.newChannel(NioDatagramChannelFactory.java:207)
>   
> ~[netty-3.9.6.Final.jar:?]
> at
> org.jboss.netty.channel.socket.nio.NioDatagramChannelFactory.newChannel(NioDatagramChannelFactory.java:79)
>   
> ~[netty-3.9.6.Final.jar:?]
> at
> org.jboss.netty.bootstrap.ConnectionlessBootstrap.bind(ConnectionlessBootstrap.java:184)
>   
> ~[netty-3.9.6.Final.jar:?]
> at
> org.apache.camel.component.netty.NettyProducer.openConnection(NettyProducer.java:433)
>   
> ~[camel-netty-2.15.2.jar:2.15.2]
> at
> org.apache.camel.component.netty.NettyProducer$NettyProducerPoolableObjectFactory.makeObject(NettyProducer.java:543)
>   
> ~[camel-netty-2.15.2.jar:2.15.2]
> at
> org.apache.camel.component.netty.NettyProducer$NettyProducerPoolableObjectFactory.makeObject(NettyProducer.java:539)
>   
> ~[camel-netty-2.15.2.jar:2.15.2]
> at
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188)
>   
> ~[commons-pool-1.6.jar:1.6]
> at
> org.apache.camel.component.netty.NettyProducer.process(NettyProducer.java:232)
>   
> ~[camel-netty-2.15.2.jar:2.15.2]
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
>   
> [camel-core-2.15.2.jar:2.15.2]
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
>   
> [camel-core-2.15.2.jar:2.15.2]
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
>   
> [camel-core-2.15.2.jar:2.15.2]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
>   
> [camel-core-2.15.2.jar:2.15.2]
> at
> org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:119) 
>  
> [camel-core-2.15.2.jar:2.15.2]
> at
> org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:113) 
>  
> [camel-core-2.15.2.jar:2.15.2]
> at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_75]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>   
> [?:1.7.0_75]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>   
> [?:1.7.0_75]
> at java.lang.Thread.run(Thread.java:745) [?:1.7.0_75]
> *Caused by: java.net.SocketException: Too many open files*
> at sun.nio.ch.Net.socket0(Native Method) ~[?:1.7.0_75]
> at sun.nio.ch.Net.socket(Net.java:423) ~[?:1.7.0_75]
> at sun.nio.ch.DatagramChannelImpl.(DatagramChannelImpl.java:115)
> ~[?:1.7.0_75]
> at
> sun.nio.ch.SelectorProviderImpl.openDatagramChannel(SelectorProviderImpl.java:42)
>   
> ~[?:1.7.0_75]
> at java.nio.channels.DatagramChannel.open(DatagramChannel.java:146)
> ~[?:1.7.0_75]
> at
> org.jboss.netty.channel.socket.nio.NioDatagramChannel.openNonBlockingChannel(NioDatagramChannel.java:70)
>   
> ~[netty-3.9.6.Final.jar:?]
> ... 19 more
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-netty-udpConnectionlessSending-option-and-Too-many-open-files-tp5770768.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Programmatic CXF Endpoint

2015-08-03 Thread Willem Jiang
Yeah, there is a gap between the Camel SSL setting and CXF SSL setting, that is 
why we introduced the CxfEndpointConfigurer to fill this gap. Current Camel SSL 
Support is per the camel context , we may need to introduce a option into 
CXFEndpoint to let it know how to create the SSLContext from Camel SSL setting.

I just fill a JIRA[1] for it.

[1]https://issues.apache.org/jira/browse/CAMEL-9046

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On August 2, 2015 at 4:46:43 PM, sloanecourt (anthony.d...@fundtech-fm.com) 
wrote:
 Thanks very much for implementing this change, very simple to use.
  
 The only problem I have at the moment is configuring the SSL support in the
 Client. Coding is not the main issue, as this is discussed on several
 threads, what I'm looking for is a way of utilising the mechanism Camel uses
 internally, when not using CxfEndPointConfigurer to establish the SSL
 configuration.
  
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Programmatic-CXF-Endpoint-tp5756368p5770215.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: Camel 2.14/Netty: How to add ByteArrayDecoder to ServerChannelPipeline?

2015-07-09 Thread Willem Jiang
There are quit different change between the Netty3.x and Netty4.x.
That is why we create a new camel component camel-netty4[1] for it.

So I think you can just need to change the camel-netty to camel-netty4 and use 
the scheme netty4 in your camel route.

--  
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 July 1, 2015 at 9:54:43 PM, SteveR (srichard...@vonage.com) wrote:
 Hi Willem:
  
 Actually, I'm currently using Camel 2.14 and Netty 3.x (org.jboss.netty).
 I'm wondering if there is a sensible way to migrate from netty3 to netty4
 (i.e. other than just brute-force trying it) and what it would do with
 respect to my existing pipeline factory code, etc?
  
 Here's what I currently have in my pom.xml file:
  
  
 org.apache.camel
 camel-netty
 2.14.0
  
  
  
 io.netty
 netty-all
 4.0.2.Final
 compile
  
  
  
 Thanks, Steve
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-2-14-Netty-How-to-add-ByteArrayDecoder-to-ServerChannelPipeline-tp5768638p5768749.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: Auto-commit and camel-kafka

2015-07-05 Thread Willem Jiang
Hi Michael,

I think we don’t take the consideration of committing the offset during the 
shutdown processing.
Please feel free to create a JIRA[1] and send out a patch of it.

[1]https://issues.apache.org/jira/browse/CAMEL

--  
Willem Jiang


Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On July 5, 2015 at 6:42:31 AM, Michael J. Kitchin (mcoyote...@gmail.com) wrote:
 Hi there,
  
 These are questions re: the official camel-kafka integration. Since the
 issues touch on both camel and kafka I'm sending to both users lists in
 search of answers.
  
 - - - - -
  
 I have a simple, inonly, point-to-point, synchronous camel route (a)
 consuming from kafka topic (consumer), (b) running the resulting exchanges
 (messages) through a processor chain and (c) forwarding the outcome on to
 somewhere else.
  
 If the runtime dies while exchanges are in this pipeline, I want things to
 pick up where they left off when restarted. I'm not picky about seeing the
 same data more than once (as long as it's recent), I just can't lose
 anything.
  
 In brief, everything's working great except this failure/recovery part --
 in-flight exchanges are getting lost and there is no, apparent re-delivery
 on restart.
  
 I think this has to do with consumer auto-commit, which is the default
 behavior. My reading of the kafka and camel-kafka docs suggests disabling
 auto-commit will give me what I want, but when I try it I'm not seeing
 re-delivery kick off when I restart.
  
 After disabling auto-commit, II walked through this in the debugger, FWIW.
 If interested, you can see the code, here:
 -
 https://github.com/apache/camel/blob/master/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConsumer.java
   
  
 ...Specifically:
 - Processing is underway line 148: processor.process(exchange);
 - Camel triggers a shutdown and this returns, as normal without any
 exchange exception check
 - The barrier await hits at line
 165: berrier.await(endpoint.getBarrierAwaitTimeoutMs(),
 TimeUnit.MILLISECONDS);
 - This aligns with the rest of the streams and triggers the barrier action,
 which in turn performs the commit at line 193: consumer.commitOffsets();
  
 Since any exception from line 148 is suppressed and there's no subsequent
 interrupted() or exchange exception check it looks like there's no way to
 to signal not to commit and in-flight exchanges are a guaranteed loss.
  
 Does this sound correct?
  
 If so, barring a change from the maintainers I figure I might fork this
 code and optionally bypass the consumer.commitOffsets(); during shutdown
 or when an exchange carries an exception after the
 processor.process(exchange) call.
  
 Thoughts?
  
 Please let me know if I may provide any additional information. Thanks.
  
 -Regards,
 MjK
  
 - - - - -
  
 Michael J. Kitchin
 Senior Software Engineer
 Operational Systems, Inc.
 4450 Arapahoe Avenue, Suite 100
 Boulder, CO 80303
  
 Phone: 719-271-6476
 Email: michael.kitc...@opsysinc.com
 Web: www.opsysinc.com
  



Re: Getting Cannot determine current route from Exchange with id message

2015-06-16 Thread Willem Jiang
Can you show us the camel route that you have?
What kind of error that target endpoint get?


--  
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 June 15, 2015 at 4:17:03 PM, amitr (amitro...@gmail.com) wrote:
 Hi,
 I'm currently working with camel 2.14.3 release and using camel-netty4-http
 and getting some strange behaviour:
 After using routing-slip and getting an error from the target endpoint, I'm
 getting the message: Cannot determine current route from Exchange with id:
  - 2 minutes after the error.
  
 The accompaniment netty exception (after the 2 minutes) is below.
 Any ideas?
 Thx,
 Amit.
  
 java.io.IOException: Connection reset by peer
 at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.8.0_11]
 at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[na:1.8.0_11]  
 at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_11]  
 at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[na:1.8.0_11]
 at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:375)
 ~[na:1.8.0_11]
 at
 io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:447)
   
 ~[netty-buffer-4.0.28.Final.jar:4.0.28.Final]
 at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:881)
 ~[netty-buffer-4.0.28.Final.jar:4.0.28.Final]
 at
 io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:242)
   
 ~[netty-transport-4.0.28.Final.jar:4.0.28.Final]
 at
 io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119)
   
 ~[netty-transport-4.0.28.Final.jar:4.0.28.Final]
 at
 io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)  
 [netty-transport-4.0.28.Final.jar:4.0.28.Final]
 at
 io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
   
 [netty-transport-4.0.28.Final.jar:4.0.28.Final]
 at
 io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)  
 [netty-transport-4.0.28.Final.jar:4.0.28.Final]
 at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
 [netty-transport-4.0.28.Final.jar:4.0.28.Final]
 at
 io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
   
 [netty-common-4.0.28.Final.jar:4.0.28.Final]
 at java.lang.Thread.run(Thread.java:745) [na:1.8.0_11]
  
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Getting-Cannot-determine-current-route-from-Exchange-with-id-message-tp5768242.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: Remove breadcrumbId from Rest Service Response Headers

2015-06-15 Thread Willem Jiang
Current camel-http component just copy the in message header to the out message 
header, so it can explain that why you get the Exchange.BREADCRUMB_ID from the 
out message.

--  
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 June 15, 2015 at 8:52:31 PM, Alex Soto (alex.s...@envieta.com) wrote:
 Hello:
  
 I guess it must be the way I am writing my integration test.
  
 When manually testing the service with curl, the header is not preset, as 
 expected.
 When I try to verify it in an integration test, the header is present:
  
  
 ProducerTemplate testProducer = camelContext.createProducerTemplate();
 testProducer.start();
  
 Exchange response =
 testProducer.request(
 https://localhost:8890/test?throwExceptionOnFailure=false;,
 new Processor() {
 @Override
 public void process(Exchange exchange) throws Exception {
 exchange.getIn().setHeader(Exchange.HTTP_METHOD, POST);
 }
 }
 );
  
 assertNotNull(response);
 assertTrue(response.hasOut());
  
 final Message out = response.getOut();
 assertNotNull(out);
  
 assertEquals(, out.getBody(String.class));
  
 int code = out.getHeader(Exchange.HTTP_RESPONSE_CODE, Integer.class);
 assertEquals(500, code);
  
 final Map headers = out.getHeaders();
 assertNotNull(headers);
  
 assertFalse(headers.containsKey(Exchange.BREADCRUMB_ID));
  
  
  
 Last assertion is not passing!!!
  
 Best regards,
 Alex soto
  
  
  
  On Jun 14, 2015, at 11:44 AM, Claus Ibsen wrote:
 
  Hi
 
  You should be able to remove the header. Can you try adding a step
  after the removeHeader, eg
 
   
   
 
  And see if that works.
 
 
  On Wed, Jun 10, 2015 at 5:16 PM, Alex Soto wrote:
  Hi there,
 
  Is there a way to remove the “breadcrumbId header from the Rest Service 
  response?  
 
  I am using Camel 2.15.1
  Here is my Route :
 
   
  java.lang.Exception
   
   
  true
   
   
  500
   
   
   
   
   
   
 
   
   
   
   
   
 
   
   
asyncDelayed=false
  callerRunsWhenRejected=false
  rejectExecution=true
  timePeriodMillis=1000
  1
 
 
   
   
   
   
 
 
  Adding the removeHeaders does not seem to cause any effect; I am still 
  getting the breadcrumbId  
 header in the HTTP response headers.
 
 
  Best regards,
  Alex soto
 
 
 
 
 
 
  --
  Claus Ibsen
  -
  Red Hat, Inc.
  Email: cib...@redhat.com
  Twitter: davsclaus
  Blog: http://davsclaus.com
  Author of Camel in Action: http://www.manning.com/ibsen
  hawtio: http://hawt.io/
  fabric8: http://fabric8.io/
  
  



Re: Camel quartz memory leak

2015-06-15 Thread Willem Jiang
When you stop the route, the schedule won’t be shutdown.
But if you stop the camel context, the schedule will be shutdown if there is no 
CamelJob there.

Are there more than one camel-quartz endpoints in your camel route?

--  
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 June 15, 2015 at 10:36:57 PM, Akram (akram.s...@gmail.com) wrote:
 I am using camel 2.15.1. Stopping the route using JMX, againg restarting it
 using JMX. Also the same getting same error if I restart entire camel
 context.
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-quartz-memory-leak-tp5768063p5768275.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: s3 query

2015-06-15 Thread Willem Jiang
I’m not quit sure about the meaning of dynamic consumer.
You can setup the CamelAwsS3Key header to the S3Producer, but you cannot setup 
the header in the S3Consumer side.

--  
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 June 15, 2015 at 8:38:21 PM, ram kumar (ramkumarro...@gmail.com) wrote:
 Hi,
  
 my use case is a dynamic consumer where ,
  
 .setHeader(S3Constants.KEY, simple(query + System.nanoTime())) - this
 should change according to time
 .to(aws-s3://camel-qq?accessKey=secretKey=);
  
 can anyone help me
 Thanks
  



Re: HttpProducer to ignore response body avoiding stream caching

2015-06-15 Thread Willem Jiang
I just create a JIRA[1] for it.

[1]https://issues.apache.org/jira/browse/CAMEL-8876


--  
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 June 16, 2015 at 12:04:07 AM, Claus Ibsen (claus.ib...@gmail.com) wrote:
 Hi
  
 Yeah sure a JIRA is welcome. Though we should take care to not always
 add new functionality from a single request in the community to avoid
 bloat the components with a zillion options.
  
  
  
 On Mon, Jun 15, 2015 at 4:08 PM, Marco Crivellaro wrote:
  Should I take care of opening a JIRA issue to request the feature? Thanks
 
 
 
  --
  View this message in context: 
  http://camel.465427.n5.nabble.com/HttpProducer-to-ignore-response-body-avoiding-stream-caching-tp5767260p5768274.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: CXF Proxy : Body empty when client side of the proxy do not respond after 30s

2015-06-10 Thread Willem Jiang
How did you apply the setting of http-conduit?


--  
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 June 10, 2015 at 3:00:16 PM, JOSSE Bertrand 
(bertrand.josse@spw.wallonie.be) wrote:
 Hi,
  
 Our project is composed by :
 * One CXF endpoint expose a Webservice called WS-1 ; payload mode.
 * One CXF endpoint invoke a Webservice called WS-2; payload mode.
 * A route between that endpoints to dispatch messages.
 * An http-conduit that set the Receivetimeout to 30ms (300s).
 If CXF endpoint that consume message from WS-2 don't receive a response after 
 30s, the  
 WS-1 endpoint produce a soap message with an empty body.
 There is no way to improve the performance of the WS-2 so WS-1 has to wait 
 more than 30s ...  
 Version used :
 - Camel : 2.15.1
 - CXF : 3.0.4
  
 Any idea ?
  
 Thanks,
 B.
  



Re: https4 2.15.2 not recognizing my httpClientConfigurer endpoint option

2015-06-09 Thread Willem Jiang
I just checked the code of your HttpClientconfigurer, you didn’t set the 
httpClientBuilder with the SSLConnectionSocketFactory instance that you just 
created.

--  
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 June 6, 2015 at 5:48:31 AM, jspyeatt (john.pye...@singlewire.com) wrote:
 Like several similar posts I've seen I need to allow self-signed certs for
 https4 (2.15.2). Mine isn't working.
  
 I've created an implementation of HttpClientConfigurer that allows any
 host/cert. Below is the implementation of configureHttpClient().
  
 @Override
 public void configureHttpClient(HttpClientBuilder httpClientBuilder) {
 log.debug(configureHttpClient());
 try {
 SSLContextBuilder builder = new SSLContextBuilder();
 builder.loadTrustMaterial(null, new TrustSelfSignedStrategy() {
 @Override
 * public boolean isTrusted(X509Certificate[] a, String b)
 throws CertificateException {
 log.debug(isTrusted() returns true);
 return true;
 }*
 });
  
 SSLContext sslContext = builder.build();
  
 SSLConnectionSocketFactory sslsf = new
 SSLConnectionSocketFactory(sslContext, new
 TrustEverythingHostnameVerifier());
 } catch (Exception e) {
 log.error(e,e);
 throw new IllegalStateException(Unable to configure
 TrustingHttpClientConfigurer, e);
 }
 }
  
  
 Then in an implementation of CameltestSupport I've overridden
 createRegistry().
 @Override
 protected JndiRegistry createRegistry() throws Exception {
 JndiRegistry jndi = super.createRegistry();
 log.info(createRegistry());
  
 *jndi.bind(MyConfigurer, new TrustingHttpClientConfigurer());*
 Object o =
 jndi.lookup(TrustingHttpClientConfigurer.HTTP_CLIENT_CONFIGURER);
 log.debug(object type:  + o.getClass().getCanonicalName());
 return jndi;
 }
  
 Then in my createRouteBuilder() it contains...
  
 return new RouteBuilder() {
 public void configure() {
  
 log.debug(CONFIGURE);
 *
 HttpComponent httpComponent = context.getComponent(https4,
 HttpComponent.class);
 httpComponent.setHttpClientConfigurer(new
 TrustingHttpClientConfigurer());
  
 log.info(CCC  +
 context.getRegistry().lookupByName(MyConfigurer));
  
 from(direct:start).transform(simple(FRED)).to(https4://172.30.253.94:8444/services?httpClientConfigurer=#MyConfigurer;*
   
 }
 };
  
 public void testSimple() throws Exception {
 HttpComponent comp =
 template.getCamelContext().getComponent(https4, HttpComponent.class);
 * log.info(DDD  +
 comp.getHttpClientConfigurer().getClass().getCanonicalName());*
 template.sendBody(direct:start, FRED);
  
 }
  
 When the test runs I do get
 *DDD com.singlewire.monte.eh.config.TrustingHttpClientConfigurer* which is  
 what I would expect.
  
 However test is failing with the obligatory
 javax.net.ssl.SSLHandshakeException. This is what I would expect given that
 the component isn't calling my version of isTrusted(X509Certificate[] a,
 String b) created during TrustingHttpClientConfigurer.configureHttpClient().  
 I know this because I never see the debug message indicating that it was
 called.
  
  
 So it's as if during execution of my route the configurator is being
 ignored.
  
 I've tried ?httpClientConfigurer=#MyConfigurer
 I've tried ?httpClientConfigurer=MyConfigurer
  
 I've tried forcing things like this.
 HttpComponent httpComponent = context.getComponent(https4,
 HttpComponent.class);
 httpComponent.setHttpClientConfigurer(new TrustingHttpClientConfigurer());  
  
 Nothing seems to work. Any guidance would be greatly appreciated.
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/https4-2-15-2-not-recognizing-my-httpClientConfigurer-endpoint-option-tp5767922.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: Failed to load type converters because of: Cannot find any type converter classes org.apache.camel.component.jetty.JettyConverter

2015-06-02 Thread Willem Jiang
You need to put the camel-jetty-common jar in your war as well.


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 Wed, Jun 3, 2015 at 11:27 AM, cloud cl...@domolo.com wrote:

 hi all,

 I want to know , which jar or project include the class:
 org.apache.camel.component.jetty.JettyConverter .

 cause Exception show that I need this class ( the wired is that not the
 ClassNotFind Error  ).

 Failed to load type converters because of: Cannot find any type converter
 classes from the following packages:
 [org.apache.camel.component.jetty.JettyConverter]


 my maven pom file :

 camel.version2.15.2/camel.version

 dependency
 groupIdorg.apache.camel/groupId
 artifactIdcamel-jetty8/artifactId

 version${camel.version}/version
 /dependency




 /opt/usr/apache-tomcat-7.0.59/bin/catalina.sh run
 Jun 03, 2015 11:14:29 AM org.springframework.web.context.ContextLoader
 initWebApplicationContext
 SEVERE: Context initialization failed
 org.apache.camel.RuntimeCamelException:
 org.apache.camel.TypeConverterLoaderException: Failed to load type
 converters because of: Cannot find any type converter classes from the
 following packages: [org.apache.camel.component.jetty.JettyConverter]
 at

 org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)
 at

 org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:1979)
 at

 org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(DefaultCamelContext.java:2000)
 at

 org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(DefaultCamelContext.java:3220)
 at

 org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2579)

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

 Caused by: org.apache.camel.TypeConverterLoaderException: Failed to load
 type converters because of: Cannot find any type converter classes from the
 following packages: [org.apache.camel.component.jetty.JettyConverter]
 at

 org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:119)
 at

 org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:544)
 at

 org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:53)





 thanks in advance .





 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Failed-to-load-type-converters-because-of-Cannot-find-any-type-converter-classes-org-apache-camel-cor-tp5767819.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: No component found with scheme: jetty in Intellij IDEA

2015-06-02 Thread Willem Jiang
It’s a common issue of Camel, you need to make sure the camel-jetty or 
camel-jetty{8|9}(if you uses Camel 2.15.x)  is in your class path from IDEA.

Reimport the project from the pom module could help you with that. 

--  
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 June 3, 2015 at 9:35:18 AM, chunfeng tian (tianyunqu...@gmail.com) wrote:
 hi all,
  
 We recently made a decision that use Camel in our project .
  
 We should integrate the camel with springframework , and use servlet to
 redirect http rest querst to background inner-firewall server.
  
 I use camel-jetty as servlet server , the problem what I meet is that :
  
 when use console command : mvn camel:run , all works well ; but when I
 debug under IDE, there is a error message that : No component found with
 scheme: jetty .
  
 Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
 resolve endpoint: jetty://
 http://0.0.0.0:8199/test?chunked=falsematchOnUriPrefix=true due to: No
 component found with scheme: jetty
 at
 org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:584)
   
 at
 org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79)
   
 at
 org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:200)
   
 at
 org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
   
 at
 org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
   
 at
 org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:70) 
  
 at
 org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:89)
   
 at
 org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1008)  
 at
 org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:185)  
 ... 64 more
  
  
  
 my camel version is : 2.15.2 .
  
 I can not find any solution about this issue , so , I request for help on
 mail list .
  
 thanks.
  
 tian
  



Apache Camel 2.14.3 Released

2015-06-01 Thread Willem Jiang
The Camel community announces the immediate availability of the new patch 
release Camel 2.14.3. This release contains a total of 80 fixes applied in the 
past few weeks by the community on the Camel 2.14.x maintenance branch. 
The artifacts are published and ready for you to download[1] either from the 
Apache mirrors or from the Central Maven repository. For more details please 
take a look at the release notes[2]. 
Many thanks to all who made this release possible. 

[1]http://camel.apache.org/download.html 
[2]https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12329561styleName=projectId=12311211

On behalf of the Camel Team, 

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





Re: Rest DSL with jetty and SSL

2015-05-30 Thread Willem Jiang
In Camel 2.15.x we has two JettyComponents to support Jetty9 and Jetty8 at the 
same time.
If you want to instantiate one of the Jetty component, you cannot use the 
JettyHttpComponent any more, as it is abstract class now.

If you want to use Jetty9, you need to use the class”JettyHttpComponent9, 
otherwise you need to chose “JettyHttpComponent8”.


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On May 28, 2015 at 4:48:31 AM, btt423 (bta...@diversecomputing.com) wrote:
 I was originally testing out the Rest DSL and using Jetty as the server.
 This works great and I'm a big fan. My next step was to try and get SSL
 working with my test application. Based on the reading that I did, it looks
 like I needed to add a jetty bean definition in blueprint.xml, and specify
 the keystore, keystore password and key password. When I add the bean
 definition for jetty, I'm getting the exception listed below. I have tried
 a number of different troubleshooting attempts, but always get this
 exception whenever I attempt to define the bean in blueprint xml (even
 taking SSL completely out the equation). The exception, details of my
 environment and the applicable snippets of code/config are below - I would
 appreciate any help that could be provided!!
  
 *** Environment Info: ***
  
 Camel 2.15.2
 camel-blueprint 2.15.2
 camel-jetty 2.15.2
  
 *** Exception: ***
  
 org.osgi.service.blueprint.container.ComponentDefinitionException: Error  
 when instantiating bean jetty of class class
 org.apache.camel.component.jetty.JettyHttpComponent
 at
 org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:333)
   
 at
 org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)
   
 at
 org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)
   
 at
 org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)  
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at
 org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)  
 at
 org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)
   
 at
 org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)
   
 at
 org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:668)
   
 at
 org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:370)
   
 at
 org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
   
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)  
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at
 org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
   
 at
 org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
   
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)  
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
   
 at
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
   
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   
 at java.lang.Thread.run(Thread.java:745)
 Caused by: java.lang.InstantiationException
 at
 sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
   
 at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
 at
 org.apache.aries.blueprint.utils.ReflectionUtils.newInstance(ReflectionUtils.java:329)
   
 at
 org.apache.aries.blueprint.container.BeanRecipe.newInstance(BeanRecipe.java:962)
   
 at
 org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:331)
   
 ... 21 more
  
 *** blueprint.xml: ***
  
  
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=
 http://www.osgi.org/xmlns/blueprint/v1.0.0
 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
 http://camel.apache.org/schema/blueprint
 http://camel.apache.org/schema/blueprint/camel-blueprint.xsd;
  
  class=org.apache.camel.component.jetty.JettyHttpComponent
  
  
  
  
  
  
  
  
  
  
  
  
  
 *** RouteBuilder: ***
  
 public class RestRouter extends RouteBuilder {
  
 @Override
 public void configure() throws Exception {
  
 restConfiguration()
 .component(jetty)
 .host(localhost)
 .port(8082)
 //.scheme(https)
 .contextPath(rest)
 .bindingMode(RestBindingMode.auto)
 .dataFormatProperty

Re: Discard Obsolete Messages After Redelivery

2015-05-26 Thread Willem Jiang
Hi,

I think you can consider to write a filter which just tracks the last timestamp 
(you may need a lock when changing the timestamp).

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On May 25, 2015 at 3:49:17 AM, noone100 (zaugg+ca...@puzzle.ch) wrote:
 I'm dealing with messages, that contain updated values for a certain ID. If
 such a message can't be processed, it gets redelivered by the activemq
 broker. In the mean time an other message with newer values for the same id
 might be enqueued. Since the redelivery delay is quite long it might happen
 that the newer message gets processed before the older and the whole process
 isn't in the correct order anymore. In that case, the older message should
 get discarded to avoid outdated values to override newer values. I thought
 about an idempotent consumer, but it does not seem to solve the problem
 because it only tracks IDs but not timestamps. Any help would be
 appreciated.
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Discard-Obsolete-Messages-After-Redelivery-tp5767439.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: Content Based Router : Java DSL is not working

2015-05-26 Thread Willem Jiang
It looks like your Predicate is a static now, which cannot take the message 
header as parameter. Please take a look at the Bean Language[1], it shows you 
how to write a right one.

[1]http://camel.apache.org/bean-language.html

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On May 25, 2015 at 3:33:38 PM, Kondalarv (kondala.sou...@gmail.com) wrote:
 I have choice with many options, and using java operation for conditions.
 The route is going to otherwise() option always and checckFilePattern()
 method is not executing.
  
  
 from(FILE_WATCHER_DSL)
 .log(LoggingLevel.INFO, FileWatchDSLUtil.getFileLogPattern())
 .choice()
  
 .when(checckFilePattern(header(CamelFileAbsolutePath).toString())).process(new
   
 FileConsumerProcesser()).endChoice()
 .otherwise().log(File Patten is not Matched. ${file:absolute.path})
 .to(file:/app/work01/FileWatcherAgent/quarantine).process(new
 FileConsumerErrorProcesser()).stop().endChoice()
 .end()
 .log(End Processing Route);
 ;
  
  
 private static Predicate checckFilePattern(String fileName){
 logger.info(checckFilePattern== File Name : {}, fileName);
 boolean flag = false;
 if(fileName.endsWith(txt)) flag= true;
 Predicate predicate = PredicateBuilder.constant(flag);
 logger.info(checckFilePattern== predicate: {}, predicate);
 return predicate;
 }
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Content-Based-Router-Java-DSL-is-not-working-tp5767440.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: ERROR: Cannot find any registered HttpDestinationFactory from the Bus.

2015-05-26 Thread Willem Jiang
CXF http transport looks up the HttpDestinationFactory for (Jetty or Netty) if 
the address is start with “http://; or https://“.  
If you don’t put those jar into the class patch, you will get the error.  

--  
Willem Jiang  

Red Hat, Inc.  
Web: http://www.redhat.com  
Blog: http://willemjiang.blogspot.com (English)  
http://jnn.iteye.com (Chinese)  
Twitter: willemjiang  
Weibo: 姜宁willem  



On May 20, 2015 at 1:55:47 AM, Aki Yoshida (elak...@gmail.com) wrote:  
 If you do not want to use the embedded jetty server but your servlet  
 container, you have to use a relative path in the address field.  
 so something like  
  address=/canonicalcxfserviceproxy/webservices/canonical  
  
 and this endpoint will be available under the context path configured  
 at your CXFServlet.  
  
  
 2015-05-15 8:28 GMT+02:00 jainmcs03 :  
   
  Team,  
   
  For camel-CXF web service proxy i created a maven JAVA project to configure 
   
  the jetty embedded container as described in the example and run it in  
  eclipse and its works fine.  
   
  But while delpoying as .war in tomact its giving subject Error.  
  ERROR HTTPTransportFactory - Cannot find any registered  
  HttpDestinationFactory from the Bus.  
   
  I have removed cxf-rt-transports-http-jetty, i keep only  
  cxf-rt-transports-http. How to resolve this.  
   
  Below is the endpoint trying to publish, no other config included in my  
  spring config file(camel-config.xml).  
   
 
  address=http://localhost:8080/canonicalcxfserviceproxy/webservices/canonical;

  endpointName=xsd:CanonicalSoap  
  serviceName=xsd:Canonical  
  wsdlURL=etc/canonical.wsdl  
   
  xmlns:xsd=http://localhost:8080/canonicalcxfserviceproxy/canonical/  
   
  Regards  
  Jayendran  
   
   
   
  --  
  View this message in context: 
  http://camel.465427.n5.nabble.com/ERROR-Cannot-find-any-registered-HttpDestinationFactory-from-the-Bus-tp5767130.html

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



Re: Discard Obsolete Messages After Redelivery

2015-05-26 Thread Willem Jiang
I’m afraid you have to implement your version of IdempotentRepository, as the 
requirement is quite different.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On May 26, 2015 at 3:33:03 PM, noone100 (zaugg+ca...@puzzle.ch) wrote:
 Hi Willem
  
 Thanks for your answer!
  
 This filter should be able to skip out-of-order messages having the same
 correlation id but an older timestamp in a persistent manner, that's why I
 thought about a FileIdempotentRepository but this repo cannot track an id
 and a timestamp in conjunction. Is there another approach to store an id and
 a timestamp or is messaging the wrong technique for that problem and I
 should consider switching to a JPA based approach?
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Discard-Obsolete-Messages-After-Redelivery-tp5767439p5767458.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: Web Srevice exposed over https not working

2015-05-26 Thread Willem Jiang
You may need to check your firewall setting and enable the SSL debug could help 
you to trace the reason of lost the connection.


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On May 26, 2015 at 1:55:09 PM, gargankur007 (gargankur...@gmail.com) wrote:
 Hi William
  
 What more information will you need?
 What are the reasons that client may close connection?
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Web-Srevice-exposed-over-https-not-working-tp5767156p5767441.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: Using shared Netty configuration with Rest DSL

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

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

BTW, you need to create the securityConfiguration yourself.



--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



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



  1   2   3   4   5   6   7   8   9   10   >