Spring rest endpoint reference work on v2.17.0 but not in v2.18.0

2017-06-06 Thread tim
Hi,

I have some applications using camel rest component. To make it better
manageable and reference by other part of my application for other usage, I
extract rest path to a java class and use spring to reference on it.

It do work on my first application, so I decide to copy the structure to my
second application for same purpose. However, the second application always
return http code 404 for related rest endpoints which differs from my first
application.

Comparing difference between two applications, the major difference is 1st
application is using Camel version v2.17.0 while the 2nd one is using
v2.18.0. After I lower the 2nd application's camel version to v2.17.0
without other changes, the problem gone and return http code 200 for related
rest endpoints.

The same problem also happens on v2.18.4 and v2.19.0. I doubt whether there
is a change in rest endpoint path reference via Spring. Please advice how to
correct the setup. Thanks.

Reference code

*Spring setup for rest service*














*Java setup*
public String getHTTPJsonManagementRestPath() {
return "/worker/json";
}

public String getHTTPAppJsonBuildRemainPath() {
return "/app/build";
}

public String getHTTPSysJsonBuildRemainPath() {
return "/sys/build";
}

*Test Result*
[under camel version v2.17.0]
Jun 07, 2017 11:10:16 AM org.restlet.engine.log.LogFilter afterHandle
INFO: 2017-06-0711:10:160:0:0:0:0:0:0:1 -   -   9395
PUT
/worker/json/app/build  -   200 40  124 35  
http://localhost:9395   -   -


[under camel version v2.18.0]
Jun 07, 2017 11:11:33 AM org.restlet.routing.Template getRegexPattern
WARNING: Empty pattern variables are not allowed : null
Jun 07, 2017 11:11:33 AM org.restlet.routing.Template getRegexPattern
WARNING: Empty pattern variables are not allowed : null
Jun 07, 2017 11:11:33 AM org.restlet.routing.Template getRegexPattern
WARNING: Empty pattern variables are not allowed : null
Jun 07, 2017 11:11:33 AM org.restlet.routing.Template getRegexPattern
WARNING: Empty pattern variables are not allowed : null
Jun 07, 2017 11:11:33 AM org.restlet.engine.log.LogFilter afterHandle
INFO: 2017-06-0711:11:330:0:0:0:0:0:0:1 -   -   9395
PUT
/worker/json/app/build  -   404 439 124 12  
http://localhost:9395   -   -

Regards,
Tim



--
View this message in context: 
http://camel.465427.n5.nabble.com/Spring-rest-endpoint-reference-work-on-v2-17-0-but-not-in-v2-18-0-tp5802175.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Possible bug in camel-ignite Component

2017-06-06 Thread Gary Hodgson
Thanks Claus,

PR: https://github.com/apache/camel/pull/1742
JIRA: https://issues.apache.org/jira/browse/CAMEL-11382

Regards,
Gary

On 6 June 2017 at 08:23, Claus Ibsen  wrote:

> Hi Gary
>
> Yeah a fix on github PR is much appreciated.
>
>
> On Mon, Jun 5, 2017 at 11:55 PM, Gary Hodgson 
> wrote:
> > Hi
> >
> > I was playing with the camel-ignite component and ran into what appears
> to
> > be a bug.
> >
> > Creating an IgniteComponent from configuration works fine, but when I try
> > and create one from an existing Ignite instance it throws an exception
> when
> > starting the component.  Looking at the code here
> > https://github.com/apache/camel/blob/master/components/
> camel-ignite/src/main/java/org/apache/camel/component/ignite/
> AbstractIgniteComponent.java#L77
> > it appears the lifecycleMode is ignored as it is only set to
> > COMPONENT_MANAGED and cannot be altered outside of the class.
> >
> > The following patch sets the lifecycleMode USER_MANAGED when an ignite
> > instance is set, which appears to resolve the problem.
> >
> >   diff --git
> > a/components/camel-ignite/src/main/java/org/apache/camel/
> component/ignite/AbstractIgniteComponent.java
> > b/components/camel-ignite/src/main/java/org/apache/camel/
> component/ignite/AbstractIgniteComponent.java
> >   index eaf6583..e9efc79 100644
> >   ---
> > a/components/camel-ignite/src/main/java/org/apache/camel/
> component/ignite/AbstractIgniteComponent.java
> >   +++
> > b/components/camel-ignite/src/main/java/org/apache/camel/
> component/ignite/AbstractIgniteComponent.java
> >   @@ -121,6 +108,7 @@
> > */
> >public void setIgnite(Ignite ignite) {
> >this.ignite = ignite;
> >   +lifecycleMode = IgniteLifecycleMode.USER_MANAGED;
> >}
> >
> >/**
> >
> > I can happily create a pull request via github if you like.
> >
> > Regards,
> > Gary
> >
> > ps. for reference, the following test reproduces the problem:
> >
> > diff --git
> > a/components/camel-ignite/src/test/java/org/apache/camel/
> component/ignite/IgniteCreationTest.java
> > b/components/camel-ignite/src/test/java/org/apache/camel/
> component/ignite/IgniteCreationTest.java
> > new file mode 100644
> > index 000..e0c41b0
> > --- /dev/null
> > +++
> > b/components/camel-ignite/src/test/java/org/apache/camel/
> component/ignite/IgniteCreationTest.java
> > @@ -0,0 +1,52 @@
> > +/**
> > + * Licensed to the Apache Software Foundation (ASF) under one or more
> > + * contributor license agreements.  See the NOTICE file distributed with
> > + * this work for additional information regarding copyright ownership.
> > + * The ASF licenses this file to You under the Apache License, Version
> 2.0
> > + * (the "License"); you may not use this file except in compliance with
> > + * the License.  You may obtain a copy of the License at
> > + *
> > + *  http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + * Unless required by applicable law or agreed to in writing, software
> > + * distributed under the License is distributed on an "AS IS" BASIS,
> > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> > + * See the License for the specific language governing permissions and
> > + * limitations under the License.
> > + */
> > +package org.apache.camel.component.ignite;
> > +
> > +import static com.google.common.truth.Truth.assert_;
> > +import org.apache.camel.component.ignite.cache.IgniteCacheComponent;
> > +import org.apache.ignite.Ignite;
> > +import org.apache.ignite.Ignition;
> > +import org.apache.ignite.cache.CachePeekMode;
> > +import org.junit.Test;
> > +
> > +public class IgniteCreationTest extends AbstractIgniteTest {
> > +
> > +@Override
> > +protected String getScheme() {
> > +return "ignite-cache";
> > +}
> > +
> > +@Override
> > +protected AbstractIgniteComponent createComponent() {
> > +Ignite ignite = Ignition.start(createConfiguration());
> > +return IgniteCacheComponent.fromIgnite(ignite);
> > +}
> > +
> > +@Test
> > +public void testAddEntry() {
> > +
> >  template.requestBodyAndHeader("ignite-cache:testcache1?operation=PUT",
> > "1234", IgniteConstants.IGNITE_CACHE_KEY, "abcd");
> > +
> > +
> >  assert_().that(ignite().cache("testcache1").size(
> CachePeekMode.ALL)).isEqualTo(1);
> > +
> >  assert_().that(ignite().cache("testcache1").get("abcd")).
> isEqualTo("1234");
> > +}
> > +
> > +@Override
> > +public boolean isCreateCamelContextPerClass() {
> > +return true;
> > +}
> > +
> > +}
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


RE: NettyConnector explicitly initializes SSLContext instead of using default

2017-06-06 Thread mevans7
Very creative solution, Hans!  I would have to ensure I add/remove the system
property where I create my queue connections.  There would be a window of
vulnerability, but greatly reduced.

Posting to ActiveMQ forum per recommendation by Claus.



--
View this message in context: 
http://camel.465427.n5.nabble.com/NettyConnector-explicitly-initializes-SSLContext-instead-of-using-default-tp5801857p5802169.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to read a file in chain(or middle) of routes.

2017-06-06 Thread sap
Perfect! thanks!



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-read-a-file-in-chain-or-middle-of-routes-tp5801982p5802012.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-test-blueprint includes camel-test, breaks java.nio.file.Files.probeContentType(source);

2017-06-06 Thread Claus Ibsen
Hi

I found a little time and have committed a fix for this on the branches.

On Tue, Jun 6, 2017 at 12:25 PM, Claus Ibsen  wrote:
> Hi
>
> Ah that test-jar should only be used as part of testing
> camel-test-blueprint itself. It should have scope=test like it does in
> camel-spring etc.
>
> You are welcome to contribute a fix via a github PR
>
> On Tue, Jun 6, 2017 at 11:52 AM, Leber, Thomas
>  wrote:
>> Hi all,
>>
>> We are using blueprint and therefore we include camel-test-blueprint. This 
>> also includes Camel-core dependencies with type "test-jar":
>>
>> https://github.com/apache/camel/blob/master/components/camel-test-blueprint/pom.xml
>>
>> 
>> org.apache.camel
>> camel-core
>> test-jar>  
>>
>> Problem is now that this contains a java service for " 
>> java.nio.file.spi.FileTypeDetector": 
>> https://github.com/apache/camel/blob/camel-2.17.x/camel-core/src/test/resources/META-INF/services/java.nio.file.spi.FileTypeDetector
>>
>> This one is specifying the class " 
>> org.apache.camel.component.file.MyFileTypeDetector": 
>> https://github.com/apache/camel/blob/master/camel-core/src/test/java/org/apache/camel/component/file/MyFileTypeDetector.java
>>
>> We are using in our code NIO to probe file contents. In our jUnit test cases 
>> Java is detecting the service and is therefore only loading " 
>> MyFileTypeDetector".
>> This always returns "txt" for a file type.
>>
>> We could fix this with adding an exclusion to our pom:
>>
>> 
>> org.apache.camel
>> camel-test-blueprint
>> 
>> 
>> org.apache.camel
>> camel-core
>> test-jar
>> 
>> 
>> 
>>
>> This is maybe something that should be fixed or at least mentioned in the 
>> camel documentation for blueprint camel test.
>>
>> Thomas Leber
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Servlet Component issue - doesn't allow a custom httpBinding

2017-06-06 Thread oceansize
I'm trying to override ServletRestHttpBinding to use custom logic for the
*public void doWriteExceptionResponse* method.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Servlet-Component-issue-doesn-t-allow-a-custom-httpBinding-tp5801985.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to read a file in chain(or middle) of routes.

2017-06-06 Thread Claus Ibsen
See the content enricher eip
http://camel.apache.org/content-enricher.html

there is a pollEnrich you can use to read a file.

On Tue, Jun 6, 2017 at 7:41 PM, sap  wrote:
> Hi.
>
> I need to read a file in middle of route.
> for example.
>
> from("sql:blabla")
> .to("file:locationbla?filename=bla&noop=true") < this is where I need to
> read from file.
> .process(new BlaProcessor())
> .to("file:locationbla?filename=bla"); <--same location that I read before.
>
> above code tries to write to file and complains that file not found.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-read-a-file-in-chain-or-middle-of-routes-tp5801982.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


How to read a file in chain(or middle) of routes.

2017-06-06 Thread sap
Hi. 

I need to read a file in middle of route. 
for example.

from("sql:blabla")
.to("file:locationbla?filename=bla&noop=true") < this is where I need to
read from file.
.process(new BlaProcessor())
.to("file:locationbla?filename=bla"); <--same location that I read before.

above code tries to write to file and complains that file not found.



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-read-a-file-in-chain-or-middle-of-routes-tp5801982.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: trouble with camel spring web example

2017-06-06 Thread Ralph Cook
I know I had a too-old version in the original question, and I'm sorry I didn't 
check version histories carefully enough. But as I indicated, this still fails 
with 2.17.7 -- is that also too old to get help on?

rc

-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com]
Sent: Tuesday, June 6, 2017 10:53 AM
To: users@camel.apache.org
Subject: Re: trouble with camel spring web example

Check that you see Camel logs, or use jconsole to connect to the jvm if you can 
see Camel JMX mbeans there.

We cannot easily help users on EOL versions of Camel as we here are only active 
supporting the latest versions.



On Tue, Jun 6, 2017 at 1:33 PM, Ralph Cook  
wrote:
> We cannot use the latest Camel, nor 2.18.4; the latest states it requires 
> Java 8, and running with 2.18.4 gives the "major/minor version" error one 
> gets when attempting to run class files from different major Java versions. 
> We aren't using Java 8 yet in our shop.
>
> I attempted to follow instructions for the examples; when I do the first 
> command "mvn package" on them, they fail with the "major/minor version" 
> error. So I was attempting to use the source for the one example that looked 
> most interesting for our application.
>
> When I build and run with 2.17.7, it gives the same result I've been getting 
> with 2.16.0. It doesn't seem to have the Java 8 compatibility problem, but 
> still doesn't work as I expect. Is there a way to find out what's wrong with 
> it?
>
> rc
>
> -Original Message-
> From: Claus Ibsen [mailto:claus.ib...@gmail.com]
> Sent: Tuesday, June 6, 2017 6:52 AM
> To: users@camel.apache.org
> Subject: Re: trouble with camel spring web example
>
> Must you use so old version of Camel, 2.16.0 is EOL. Or at least upgrade to 
> latest 2.16.x.
>
> And you can try out the examples that is shipped, it should work.
>
>
> On Tue, Jun 6, 2017 at 12:45 PM, Ralph Cook  
> wrote:
>> Well, the web.xml as shown below has
>>  
>>  
>>  
>> org.springframework.web.context.ContextLoaderListener
>>  
>>
>> so it does have a spring context listener. I removed the comment line and 
>> tried again, just in case the comment was causing some kind of problem, but 
>> the result is the same.
>>
>> I created a CamelHttpTransportServlet2 and pointed to it as CamelServlet, 
>> and pulled in source from CamelHttpTransportServlet to see if I could see 
>> what was happening that way (I'm not sure it is the correct version of the 
>> source). When the application starts, it hits breakpoints at destroy() and 
>> init() and seems to behave as I would suspect; it also hits a breakpoint at 
>> service() when I click on the link of the first page of the example; in that 
>> method, it calls a deprecated method resolve(HttpRequest request), which 
>> returns null for a variable called consumer, and calls the response method 
>> sendError from there.
>>
>> So it looks like somehow I don't have a consumer for the request that is 
>> supposed to invoke the Camel route, perhaps? But I don't know why that would 
>> be. The init() method shows that the 'contextConfigLocation' is being 
>> retrieved from the web.xml as 'classpath:camel-config.xml' (though I had to 
>> put that param in a different place than the example code shows it for some 
>> reason). What else is it that I need to do?
>>
>> -Original Message-
>> From: Claus Ibsen [mailto:claus.ib...@gmail.com]
>> Sent: Tuesday, June 6, 2017 5:33 AM
>> To: users@camel.apache.org
>> Subject: Re: trouble with camel spring web example
>>
>> Its spring that is starting up Camel as you define Camel in the 
>> camel-context.xml file which is a Spring  file.
>>
>> So you need the spring context listener in the web.xml file so spring 
>> startup, and then can start Camel.
>> You should see in the log from tomcat, when Camel startup as it logs that. 
>> If you dont see that, then Camel is not starting.
>>
>>
>>
>> On Mon, Jun 5, 2017 at 4:06 PM, Ralph Cook  
>> wrote:
>>> I am trying to work through an example from the camel website, namely 
>>> camel-example-servlet-tomcat. I want to get a web application working that 
>>> takes input from a web service request and uses it as the data with which 
>>> to start a camel route. I am running Tomcat 7.0.63, Netbeans 8.02, Windows 
>>> 10 Pro. Java 1.7, Maven 3.0.4.
>>>
>>> I can build the application; when I run it the initial page appears, with 
>>> the link that's supposed to invoke the camel-based route; on clicking that 
>>> link, or on entering any variation of its URL, I get 404, resource not 
>>> available.
>>>
>>> I tried copying the source for CamelHttpTransportServlet to another class 
>>> and configuring that one as CamelServlet, so that I could set breakpoints 
>>> and see what is happening. I can hit breakpoints there but still don't know 
>>> why it isn't working.
>>>
>>> I do not understand what part of this invokes .start() on Camel, and wonder 
>>> if I'm missi

Re: How to Extract json key, value from MQTT payload

2017-06-06 Thread Zoran Regvart
Hi,
so typically you would use message headers and named parameters in
your SQL, something like

.setBody("INSERT INTO MY_TABLE (ID, NAME) VALUES (:?id, :?name)")
.to("jdbc:myDataSource")

and your processor would need to set those `id` and `name` headers on
the incoming message.

You could also use JSONPath support to set those headers, of the top
of my head, something like:

.setHeader('id', new JsonPathExpression("$.id"))
.setHeader('name', new JsonPathExpression("$.name"))
.setBody("INSERT INTO MY_TABLE (ID, NAME) VALUES (:?id, :?name)")
.to("jdbc:myDataSource")

zoran

On Tue, Jun 6, 2017 at 2:20 PM, solomon  wrote:
> Hi,
>
> I have created a camel route of mqtt -> jdbc which pushes the data in json
> format into MQTT topic, now I want to extract the json key and value so that
> I can insert it into jdbc database.
>
> sample json payload : { "id": 1, "name": "Test" }
>
> My Camel route looks like this :
>
> from("mqtt:bar?subscribeTopicName=test&host=tcp://localhost:1883")
> .process(new MyProcessor()) // Extract json data here
> .to("jdbc:myDataSource?resetAutoCommit=false");
>
> Can any one help me on how to get the values.
>
> Thanks
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-Extract-json-key-value-from-MQTT-payload-tp5801958.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Zoran Regvart


Re: trouble with camel spring web example

2017-06-06 Thread Claus Ibsen
Check that you see Camel logs, or use jconsole to connect to the jvm
if you can see Camel JMX mbeans there.

We cannot easily help users on EOL versions of Camel as we here are
only active supporting the latest versions.



On Tue, Jun 6, 2017 at 1:33 PM, Ralph Cook
 wrote:
> We cannot use the latest Camel, nor 2.18.4; the latest states it requires 
> Java 8, and running with 2.18.4 gives the "major/minor version" error one 
> gets when attempting to run class files from different major Java versions. 
> We aren't using Java 8 yet in our shop.
>
> I attempted to follow instructions for the examples; when I do the first 
> command "mvn package" on them, they fail with the "major/minor version" 
> error. So I was attempting to use the source for the one example that looked 
> most interesting for our application.
>
> When I build and run with 2.17.7, it gives the same result I've been getting 
> with 2.16.0. It doesn't seem to have the Java 8 compatibility problem, but 
> still doesn't work as I expect. Is there a way to find out what's wrong with 
> it?
>
> rc
>
> -Original Message-
> From: Claus Ibsen [mailto:claus.ib...@gmail.com]
> Sent: Tuesday, June 6, 2017 6:52 AM
> To: users@camel.apache.org
> Subject: Re: trouble with camel spring web example
>
> Must you use so old version of Camel, 2.16.0 is EOL. Or at least upgrade to 
> latest 2.16.x.
>
> And you can try out the examples that is shipped, it should work.
>
>
> On Tue, Jun 6, 2017 at 12:45 PM, Ralph Cook  
> wrote:
>> Well, the web.xml as shown below has
>>  
>>  
>>  
>> org.springframework.web.context.ContextLoaderListener
>>  
>>
>> so it does have a spring context listener. I removed the comment line and 
>> tried again, just in case the comment was causing some kind of problem, but 
>> the result is the same.
>>
>> I created a CamelHttpTransportServlet2 and pointed to it as CamelServlet, 
>> and pulled in source from CamelHttpTransportServlet to see if I could see 
>> what was happening that way (I'm not sure it is the correct version of the 
>> source). When the application starts, it hits breakpoints at destroy() and 
>> init() and seems to behave as I would suspect; it also hits a breakpoint at 
>> service() when I click on the link of the first page of the example; in that 
>> method, it calls a deprecated method resolve(HttpRequest request), which 
>> returns null for a variable called consumer, and calls the response method 
>> sendError from there.
>>
>> So it looks like somehow I don't have a consumer for the request that is 
>> supposed to invoke the Camel route, perhaps? But I don't know why that would 
>> be. The init() method shows that the 'contextConfigLocation' is being 
>> retrieved from the web.xml as 'classpath:camel-config.xml' (though I had to 
>> put that param in a different place than the example code shows it for some 
>> reason). What else is it that I need to do?
>>
>> -Original Message-
>> From: Claus Ibsen [mailto:claus.ib...@gmail.com]
>> Sent: Tuesday, June 6, 2017 5:33 AM
>> To: users@camel.apache.org
>> Subject: Re: trouble with camel spring web example
>>
>> Its spring that is starting up Camel as you define Camel in the 
>> camel-context.xml file which is a Spring  file.
>>
>> So you need the spring context listener in the web.xml file so spring 
>> startup, and then can start Camel.
>> You should see in the log from tomcat, when Camel startup as it logs that. 
>> If you dont see that, then Camel is not starting.
>>
>>
>>
>> On Mon, Jun 5, 2017 at 4:06 PM, Ralph Cook  
>> wrote:
>>> I am trying to work through an example from the camel website, namely 
>>> camel-example-servlet-tomcat. I want to get a web application working that 
>>> takes input from a web service request and uses it as the data with which 
>>> to start a camel route. I am running Tomcat 7.0.63, Netbeans 8.02, Windows 
>>> 10 Pro. Java 1.7, Maven 3.0.4.
>>>
>>> I can build the application; when I run it the initial page appears, with 
>>> the link that's supposed to invoke the camel-based route; on clicking that 
>>> link, or on entering any variation of its URL, I get 404, resource not 
>>> available.
>>>
>>> I tried copying the source for CamelHttpTransportServlet to another class 
>>> and configuring that one as CamelServlet, so that I could set breakpoints 
>>> and see what is happening. I can hit breakpoints there but still don't know 
>>> why it isn't working.
>>>
>>> I do not understand what part of this invokes .start() on Camel, and wonder 
>>> if I'm missing some step that does that. One difficulty I have with the 
>>> documentation is that it seems to treat all the examples as a block, 
>>> invoking parent poms and giving instructions on compiling all of them 
>>> together; I didn't want to do this but finally attempted it; it requires 
>>> not only a more recent version of Maven than we use in my shop but a more 
>>> recent version of Java, so that route is r

Re: How to Extract json key, value from MQTT payload

2017-06-06 Thread Owain McGuire
Try unmarshal from json to pojo using http://camel.apache.org/json.html 




> On 6 Jun 2017, at 13:20, solomon  wrote:
> 
> Hi,
> 
> I have created a camel route of mqtt -> jdbc which pushes the data in json
> format into MQTT topic, now I want to extract the json key and value so that
> I can insert it into jdbc database.
> 
> sample json payload : { "id": 1, "name": "Test" }
> 
> My Camel route looks like this :
> 
>from("mqtt:bar?subscribeTopicName=test&host=tcp://localhost:1883")
>.process(new MyProcessor()) // Extract json data here
>.to("jdbc:myDataSource?resetAutoCommit=false"); 
> 
> Can any one help me on how to get the values.
> 
> Thanks
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-Extract-json-key-value-from-MQTT-payload-tp5801958.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



RE: How to Extract json key, value from MQTT payload

2017-06-06 Thread Steve Huston
That depends totally on what MyProcessor does with the data and where it puts 
it.

> -Original Message-
> From: solomon [mailto:austin.solomon...@gmail.com]
> Sent: Tuesday, June 06, 2017 8:21 AM
> To: users@camel.apache.org
> Subject: How to Extract json key, value from MQTT payload
> 
> Hi,
> 
> I have created a camel route of mqtt -> jdbc which pushes the data in json
> format into MQTT topic, now I want to extract the json key and value so that
> I can insert it into jdbc database.
> 
> sample json payload : { "id": 1, "name": "Test" }
> 
> My Camel route looks like this :
> 
> from("mqtt:bar?subscribeTopicName=test&host=tcp://localhost:1883")
> .process(new MyProcessor()) // Extract json data here
> .to("jdbc:myDataSource?resetAutoCommit=false");
> 
> Can any one help me on how to get the values.
> 
> Thanks
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-
> Extract-json-key-value-from-MQTT-payload-tp5801958.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Smb Protocol is not supporting SMBv2 & SMBv3..

2017-06-06 Thread Zoran Regvart
Hi,
are you using a fairly recent camel-jcifs that depends on JCIFS 1.3.0
or newer? NTLMv2 support in JCIFS library was introduced in version
1.3.0.
There is one property you can try setting: the
`jcifs.smb.lmCompatibility`[1] to `3`, but that should be default in
1.3.x,

zoran

[1] https://jcifs.samba.org/src/docs/api/overview-summary.html#scp

On Wed, May 31, 2017 at 11:13 PM, sai  wrote:
> Hello,
>
>I have a camel route with smb:// consumer that picks the files via
> remote server. This worked really great so far. But recently my organization
> turned off SMBv1 and upgraded to SMBv2 or v3. Now i'm not able to access the
> share with smb:// and i'm getting following exception::
>
> Caused by: jcifs.smb.SmbException: Failed to connect: abc.server.com/1.2.3.4
> jcifs.util.transport.TransportException: Connection in error
> jcifs.util.transport.TransportException
> java.io.IOException: transport closed in negotiate
>
> Is there any solution to configure the SMBv2 or SMBv3 for camel
> jcifs/smb?
>
> Thank you & Really appreciate for the help
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Smb-Protocol-is-not-supporting-SMBv2-SMBv3-tp5801518.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Zoran Regvart


How to Extract json key, value from MQTT payload

2017-06-06 Thread solomon
Hi,

I have created a camel route of mqtt -> jdbc which pushes the data in json
format into MQTT topic, now I want to extract the json key and value so that
I can insert it into jdbc database.

sample json payload : { "id": 1, "name": "Test" }

My Camel route looks like this :

from("mqtt:bar?subscribeTopicName=test&host=tcp://localhost:1883")
.process(new MyProcessor()) // Extract json data here
.to("jdbc:myDataSource?resetAutoCommit=false"); 

Can any one help me on how to get the values.

Thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-Extract-json-key-value-from-MQTT-payload-tp5801958.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: trouble with camel spring web example

2017-06-06 Thread Ralph Cook
We cannot use the latest Camel, nor 2.18.4; the latest states it requires Java 
8, and running with 2.18.4 gives the "major/minor version" error one gets when 
attempting to run class files from different major Java versions. We aren't 
using Java 8 yet in our shop.

I attempted to follow instructions for the examples; when I do the first 
command "mvn package" on them, they fail with the "major/minor version" error. 
So I was attempting to use the source for the one example that looked most 
interesting for our application.

When I build and run with 2.17.7, it gives the same result I've been getting 
with 2.16.0. It doesn't seem to have the Java 8 compatibility problem, but 
still doesn't work as I expect. Is there a way to find out what's wrong with it?

rc

-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com]
Sent: Tuesday, June 6, 2017 6:52 AM
To: users@camel.apache.org
Subject: Re: trouble with camel spring web example

Must you use so old version of Camel, 2.16.0 is EOL. Or at least upgrade to 
latest 2.16.x.

And you can try out the examples that is shipped, it should work.


On Tue, Jun 6, 2017 at 12:45 PM, Ralph Cook  
wrote:
> Well, the web.xml as shown below has
>  
>  
>  
> org.springframework.web.context.ContextLoaderListener
>  
>
> so it does have a spring context listener. I removed the comment line and 
> tried again, just in case the comment was causing some kind of problem, but 
> the result is the same.
>
> I created a CamelHttpTransportServlet2 and pointed to it as CamelServlet, and 
> pulled in source from CamelHttpTransportServlet to see if I could see what 
> was happening that way (I'm not sure it is the correct version of the 
> source). When the application starts, it hits breakpoints at destroy() and 
> init() and seems to behave as I would suspect; it also hits a breakpoint at 
> service() when I click on the link of the first page of the example; in that 
> method, it calls a deprecated method resolve(HttpRequest request), which 
> returns null for a variable called consumer, and calls the response method 
> sendError from there.
>
> So it looks like somehow I don't have a consumer for the request that is 
> supposed to invoke the Camel route, perhaps? But I don't know why that would 
> be. The init() method shows that the 'contextConfigLocation' is being 
> retrieved from the web.xml as 'classpath:camel-config.xml' (though I had to 
> put that param in a different place than the example code shows it for some 
> reason). What else is it that I need to do?
>
> -Original Message-
> From: Claus Ibsen [mailto:claus.ib...@gmail.com]
> Sent: Tuesday, June 6, 2017 5:33 AM
> To: users@camel.apache.org
> Subject: Re: trouble with camel spring web example
>
> Its spring that is starting up Camel as you define Camel in the 
> camel-context.xml file which is a Spring  file.
>
> So you need the spring context listener in the web.xml file so spring 
> startup, and then can start Camel.
> You should see in the log from tomcat, when Camel startup as it logs that. If 
> you dont see that, then Camel is not starting.
>
>
>
> On Mon, Jun 5, 2017 at 4:06 PM, Ralph Cook  
> wrote:
>> I am trying to work through an example from the camel website, namely 
>> camel-example-servlet-tomcat. I want to get a web application working that 
>> takes input from a web service request and uses it as the data with which to 
>> start a camel route. I am running Tomcat 7.0.63, Netbeans 8.02, Windows 10 
>> Pro. Java 1.7, Maven 3.0.4.
>>
>> I can build the application; when I run it the initial page appears, with 
>> the link that's supposed to invoke the camel-based route; on clicking that 
>> link, or on entering any variation of its URL, I get 404, resource not 
>> available.
>>
>> I tried copying the source for CamelHttpTransportServlet to another class 
>> and configuring that one as CamelServlet, so that I could set breakpoints 
>> and see what is happening. I can hit breakpoints there but still don't know 
>> why it isn't working.
>>
>> I do not understand what part of this invokes .start() on Camel, and wonder 
>> if I'm missing some step that does that. One difficulty I have with the 
>> documentation is that it seems to treat all the examples as a block, 
>> invoking parent poms and giving instructions on compiling all of them 
>> together; I didn't want to do this but finally attempted it; it requires not 
>> only a more recent version of Maven than we use in my shop but a more recent 
>> version of Java, so that route is really frought. This example is so simple, 
>> surely someone can tell me what I'm doing wrong.
>>
>> I have the following web.xml:
>>
>> ---
>>
>> >  xmlns="http://www.springframework.org/schema/beans";
>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>  xmlns:camel="http://camel.apache.org/schema/spring";
>>  
>> 

Re: trouble with camel spring web example

2017-06-06 Thread Claus Ibsen
Must you use so old version of Camel, 2.16.0 is EOL. Or at least
upgrade to latest 2.16.x.

And you can try out the examples that is shipped, it should work.


On Tue, Jun 6, 2017 at 12:45 PM, Ralph Cook
 wrote:
> Well, the web.xml as shown below has
>  
>  
>  
> org.springframework.web.context.ContextLoaderListener
>  
>
> so it does have a spring context listener. I removed the comment line and 
> tried again, just in case the comment was causing some kind of problem, but 
> the result is the same.
>
> I created a CamelHttpTransportServlet2 and pointed to it as CamelServlet, and 
> pulled in source from CamelHttpTransportServlet to see if I could see what 
> was happening that way (I'm not sure it is the correct version of the 
> source). When the application starts, it hits breakpoints at destroy() and 
> init() and seems to behave as I would suspect; it also hits a breakpoint at 
> service() when I click on the link of the first page of the example; in that 
> method, it calls a deprecated method resolve(HttpRequest request), which 
> returns null for a variable called consumer, and calls the response method 
> sendError from there.
>
> So it looks like somehow I don't have a consumer for the request that is 
> supposed to invoke the Camel route, perhaps? But I don't know why that would 
> be. The init() method shows that the 'contextConfigLocation' is being 
> retrieved from the web.xml as 'classpath:camel-config.xml' (though I had to 
> put that param in a different place than the example code shows it for some 
> reason). What else is it that I need to do?
>
> -Original Message-
> From: Claus Ibsen [mailto:claus.ib...@gmail.com]
> Sent: Tuesday, June 6, 2017 5:33 AM
> To: users@camel.apache.org
> Subject: Re: trouble with camel spring web example
>
> Its spring that is starting up Camel as you define Camel in the 
> camel-context.xml file which is a Spring  file.
>
> So you need the spring context listener in the web.xml file so spring 
> startup, and then can start Camel.
> You should see in the log from tomcat, when Camel startup as it logs that. If 
> you dont see that, then Camel is not starting.
>
>
>
> On Mon, Jun 5, 2017 at 4:06 PM, Ralph Cook  
> wrote:
>> I am trying to work through an example from the camel website, namely 
>> camel-example-servlet-tomcat. I want to get a web application working that 
>> takes input from a web service request and uses it as the data with which to 
>> start a camel route. I am running Tomcat 7.0.63, Netbeans 8.02, Windows 10 
>> Pro. Java 1.7, Maven 3.0.4.
>>
>> I can build the application; when I run it the initial page appears, with 
>> the link that's supposed to invoke the camel-based route; on clicking that 
>> link, or on entering any variation of its URL, I get 404, resource not 
>> available.
>>
>> I tried copying the source for CamelHttpTransportServlet to another class 
>> and configuring that one as CamelServlet, so that I could set breakpoints 
>> and see what is happening. I can hit breakpoints there but still don't know 
>> why it isn't working.
>>
>> I do not understand what part of this invokes .start() on Camel, and wonder 
>> if I'm missing some step that does that. One difficulty I have with the 
>> documentation is that it seems to treat all the examples as a block, 
>> invoking parent poms and giving instructions on compiling all of them 
>> together; I didn't want to do this but finally attempted it; it requires not 
>> only a more recent version of Maven than we use in my shop but a more recent 
>> version of Java, so that route is really frought. This example is so simple, 
>> surely someone can tell me what I'm doing wrong.
>>
>> I have the following web.xml:
>>
>> ---
>>
>> >  xmlns="http://www.springframework.org/schema/beans";
>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>  xmlns:camel="http://camel.apache.org/schema/spring";
>>  
>> xsi:schemaLocation="http://www.springframework.org/schema/beans 
>> http://www.springframework.org/schema/beans/spring-beans.xsd
>>  http://camel.apache.org/schema/spring   
>> http://camel.apache.org/schema/spring/camel-spring.xsd";>
>>
>> 
>> contextConfigLocation
>> classpath:camel-config.xml
>> 
>>
>> 
>> 
>> 
>> org.springframework.web.context.ContextLoaderListener
>> 
>>
>> 
>> CamelServlet
>> 
>> org.apache.camel.component.servlet.CamelHttpTransportServlet
>> 
>>
>> 1
>> 
>>
>> 
>> 
>> CamelServlet
>> /camel/*
>> 
>>
>> 
>>
>> ---
>>
>> and the following camel-config.xml
>>
>> > xmlns="http://www.springframework.or

RE: trouble with camel spring web example

2017-06-06 Thread Ralph Cook
Well, the web.xml as shown below has
 
 
 
org.springframework.web.context.ContextLoaderListener
 

so it does have a spring context listener. I removed the comment line and tried 
again, just in case the comment was causing some kind of problem, but the 
result is the same.

I created a CamelHttpTransportServlet2 and pointed to it as CamelServlet, and 
pulled in source from CamelHttpTransportServlet to see if I could see what was 
happening that way (I'm not sure it is the correct version of the source). When 
the application starts, it hits breakpoints at destroy() and init() and seems 
to behave as I would suspect; it also hits a breakpoint at service() when I 
click on the link of the first page of the example; in that method, it calls a 
deprecated method resolve(HttpRequest request), which returns null for a 
variable called consumer, and calls the response method sendError from there.

So it looks like somehow I don't have a consumer for the request that is 
supposed to invoke the Camel route, perhaps? But I don't know why that would 
be. The init() method shows that the 'contextConfigLocation' is being retrieved 
from the web.xml as 'classpath:camel-config.xml' (though I had to put that 
param in a different place than the example code shows it for some reason). 
What else is it that I need to do?

-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com]
Sent: Tuesday, June 6, 2017 5:33 AM
To: users@camel.apache.org
Subject: Re: trouble with camel spring web example

Its spring that is starting up Camel as you define Camel in the 
camel-context.xml file which is a Spring  file.

So you need the spring context listener in the web.xml file so spring startup, 
and then can start Camel.
You should see in the log from tomcat, when Camel startup as it logs that. If 
you dont see that, then Camel is not starting.



On Mon, Jun 5, 2017 at 4:06 PM, Ralph Cook  
wrote:
> I am trying to work through an example from the camel website, namely 
> camel-example-servlet-tomcat. I want to get a web application working that 
> takes input from a web service request and uses it as the data with which to 
> start a camel route. I am running Tomcat 7.0.63, Netbeans 8.02, Windows 10 
> Pro. Java 1.7, Maven 3.0.4.
>
> I can build the application; when I run it the initial page appears, with the 
> link that's supposed to invoke the camel-based route; on clicking that link, 
> or on entering any variation of its URL, I get 404, resource not available.
>
> I tried copying the source for CamelHttpTransportServlet to another class and 
> configuring that one as CamelServlet, so that I could set breakpoints and see 
> what is happening. I can hit breakpoints there but still don't know why it 
> isn't working.
>
> I do not understand what part of this invokes .start() on Camel, and wonder 
> if I'm missing some step that does that. One difficulty I have with the 
> documentation is that it seems to treat all the examples as a block, invoking 
> parent poms and giving instructions on compiling all of them together; I 
> didn't want to do this but finally attempted it; it requires not only a more 
> recent version of Maven than we use in my shop but a more recent version of 
> Java, so that route is really frought. This example is so simple, surely 
> someone can tell me what I'm doing wrong.
>
> I have the following web.xml:
>
> ---
>
>   xmlns="http://www.springframework.org/schema/beans";
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>  xmlns:camel="http://camel.apache.org/schema/spring";
>  
> xsi:schemaLocation="http://www.springframework.org/schema/beans 
> http://www.springframework.org/schema/beans/spring-beans.xsd
>  http://camel.apache.org/schema/spring
>http://camel.apache.org/schema/spring/camel-spring.xsd";>
>
> 
> contextConfigLocation
> classpath:camel-config.xml
> 
>
> 
> 
> 
> org.springframework.web.context.ContextLoaderListener
> 
>
> 
> CamelServlet
> 
> org.apache.camel.component.servlet.CamelHttpTransportServlet
> 
>
> 1
> 
>
> 
> 
> CamelServlet
> /camel/*
> 
>
> 
>
> ---
>
> and the following camel-config.xml
>
>  xmlns="http://www.springframework.org/schema/beans";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:camel="http://camel.apache.org/schema/spring";
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans 
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://camel.apache.org/schema/s

Re: camel-quickfix - Using the InOut MEP with multiple MsgTypes

2017-06-06 Thread Claus Ibsen
Hi

Sorry I am not sure so many can help here, as this component was
contributed from one of the quickfix committers. Maybe you can try to
ask on their forum.

Looking into the source code is your best best and maybe try to find
out details about quickfix and how its intended to work in your
use-case .. and whether that is possible.

You are also of course welcome to dive into the code, and see if you
can make some changes to make it work for you in a "good" way and then
contribute that to Camel
http://camel.apache.org/contributing

On Tue, May 30, 2017 at 9:53 AM, MartinPhilippi
 wrote:
> I'm trying to build a REST interface using camel-quickfix to interact with a
> FIX service. Ideally I want to send synchronous responses to the REST calls.
>
> Following the documentation about "Using the InOut Message Exchange Pattern"
> at http://camel.apache.org/quickfix.html and inspecting the
> RequestReplyExample, I was able to do that, but only for one specific
> MsgType.
>
> Am I right in assuming that using the CorrelationCriteria I'm only able to
> 'look out' for one specific MsgType in a FIX reply message? For example, if
> I send a Quote Request (MsgType R) to the FIX server, it would reply with a
> Quote (MsgType S), but if anything goes wrong it could also be a Quote
> Request Reject (MsgType AG). How would I be able to correlate this to the
> original request message? I can't see any possibility to use some sort of
> "OrPredicate" or similar. Or am I missing something here?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-quickfix-Using-the-InOut-MEP-with-multiple-MsgTypes-tp5801331.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: camel-test-blueprint includes camel-test, breaks java.nio.file.Files.probeContentType(source);

2017-06-06 Thread Claus Ibsen
Hi

Ah that test-jar should only be used as part of testing
camel-test-blueprint itself. It should have scope=test like it does in
camel-spring etc.

You are welcome to contribute a fix via a github PR

On Tue, Jun 6, 2017 at 11:52 AM, Leber, Thomas
 wrote:
> Hi all,
>
> We are using blueprint and therefore we include camel-test-blueprint. This 
> also includes Camel-core dependencies with type "test-jar":
>
> https://github.com/apache/camel/blob/master/components/camel-test-blueprint/pom.xml
>
> 
> org.apache.camel
> camel-core
> test-jar  
>
> Problem is now that this contains a java service for " 
> java.nio.file.spi.FileTypeDetector": 
> https://github.com/apache/camel/blob/camel-2.17.x/camel-core/src/test/resources/META-INF/services/java.nio.file.spi.FileTypeDetector
>
> This one is specifying the class " 
> org.apache.camel.component.file.MyFileTypeDetector": 
> https://github.com/apache/camel/blob/master/camel-core/src/test/java/org/apache/camel/component/file/MyFileTypeDetector.java
>
> We are using in our code NIO to probe file contents. In our jUnit test cases 
> Java is detecting the service and is therefore only loading " 
> MyFileTypeDetector".
> This always returns "txt" for a file type.
>
> We could fix this with adding an exclusion to our pom:
>
> 
> org.apache.camel
> camel-test-blueprint
> 
> 
> org.apache.camel
> camel-core
> test-jar
> 
> 
> 
>
> This is maybe something that should be fixed or at least mentioned in the 
> camel documentation for blueprint camel test.
>
> Thomas Leber



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


camel-test-blueprint includes camel-test, breaks java.nio.file.Files.probeContentType(source);

2017-06-06 Thread Leber, Thomas
Hi all,

We are using blueprint and therefore we include camel-test-blueprint. This also 
includes Camel-core dependencies with type "test-jar":

https://github.com/apache/camel/blob/master/components/camel-test-blueprint/pom.xml


org.apache.camel
camel-core
test-jar

Problem is now that this contains a java service for " 
java.nio.file.spi.FileTypeDetector": 
https://github.com/apache/camel/blob/camel-2.17.x/camel-core/src/test/resources/META-INF/services/java.nio.file.spi.FileTypeDetector

This one is specifying the class " 
org.apache.camel.component.file.MyFileTypeDetector": 
https://github.com/apache/camel/blob/master/camel-core/src/test/java/org/apache/camel/component/file/MyFileTypeDetector.java

We are using in our code NIO to probe file contents. In our jUnit test cases 
Java is detecting the service and is therefore only loading " 
MyFileTypeDetector". 
This always returns "txt" for a file type.

We could fix this with adding an exclusion to our pom:


org.apache.camel
camel-test-blueprint


org.apache.camel
camel-core
test-jar




This is maybe something that should be fixed or at least mentioned in the camel 
documentation for blueprint camel test.

Thomas Leber


Re: trouble with camel spring web example

2017-06-06 Thread Claus Ibsen
Its spring that is starting up Camel as you define Camel in the
camel-context.xml file which is a Spring  file.

So you need the spring context listener in the web.xml file so spring
startup, and then can start Camel.
You should see in the log from tomcat, when Camel startup as it logs
that. If you dont see that, then Camel is not starting.



On Mon, Jun 5, 2017 at 4:06 PM, Ralph Cook
 wrote:
> I am trying to work through an example from the camel website, namely 
> camel-example-servlet-tomcat. I want to get a web application working that 
> takes input from a web service request and uses it as the data with which to 
> start a camel route. I am running Tomcat 7.0.63, Netbeans 8.02, Windows 10 
> Pro. Java 1.7, Maven 3.0.4.
>
> I can build the application; when I run it the initial page appears, with the 
> link that's supposed to invoke the camel-based route; on clicking that link, 
> or on entering any variation of its URL, I get 404, resource not available.
>
> I tried copying the source for CamelHttpTransportServlet to another class and 
> configuring that one as CamelServlet, so that I could set breakpoints and see 
> what is happening. I can hit breakpoints there but still don't know why it 
> isn't working.
>
> I do not understand what part of this invokes .start() on Camel, and wonder 
> if I'm missing some step that does that. One difficulty I have with the 
> documentation is that it seems to treat all the examples as a block, invoking 
> parent poms and giving instructions on compiling all of them together; I 
> didn't want to do this but finally attempted it; it requires not only a more 
> recent version of Maven than we use in my shop but a more recent version of 
> Java, so that route is really frought. This example is so simple, surely 
> someone can tell me what I'm doing wrong.
>
> I have the following web.xml:
>
> ---
>
>   xmlns="http://www.springframework.org/schema/beans";
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>  xmlns:camel="http://camel.apache.org/schema/spring";
>  
> xsi:schemaLocation="http://www.springframework.org/schema/beans 
> http://www.springframework.org/schema/beans/spring-beans.xsd
>  http://camel.apache.org/schema/spring
>http://camel.apache.org/schema/spring/camel-spring.xsd";>
>
> 
> contextConfigLocation
> classpath:camel-config.xml
> 
>
> 
> 
> 
> org.springframework.web.context.ContextLoaderListener
> 
>
> 
> CamelServlet
> 
> org.apache.camel.component.servlet.CamelHttpTransportServlet
> 
>
> 1
> 
>
> 
> 
> CamelServlet
> /camel/*
> 
>
> 
>
> ---
>
> and the following camel-config.xml
>
>  xmlns="http://www.springframework.org/schema/beans";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:camel="http://camel.apache.org/schema/spring";
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans 
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://camel.apache.org/schema/spring   
> http://camel.apache.org/schema/spring/camel-spring.xsd";
> >
>
>   http://camel.apache.org/schema/spring";>
>
> 
>   
>   
>   
> 
>   
>   name
>   
>   
> Hi I am ${sysenv.HOSTNAME}. Hello ${header.name} 
> how are you today?
>   
> 
> 
>   
>   
> Add a name parameter to uri, eg 
> ?name=foo
>   
> 
>   
> 
>
>   
>
> 
>
> ---
>
> Here's the pom.xml as well; I don't think it's related but of course don't 
> know.
>
> http://maven.apache.org/POM/4.0.0"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
> 4.0.0
>
> com.api
> CamelOne
> 1.0-SNAPSHOT
> war
>
> CamelOne
>
> 
> ${project.build.directory}/endorsed
> UTF-8
> 2.6.1
> 2.16.0
> 4.1.6.RELEASE
> 
> 
>
> 
> 
> org.apache.camel 
> camel-core 
> ${camel-version}
> org.apache.camel 
> camel-spring   
> ${camel-version}
> org.apache.camel 
> camel-servlet  
> ${camel-version}
>

RE: NettyConnector explicitly initializes SSLContext instead of using default

2017-06-06 Thread Orbaan, Hans

Hi,

Did you try removing the properties after the context has been created?




-
This E-mail is for the sole use of the intended recipient and may contain 
confidential and/or privileged material. Any reading, review, reliance, 
distribution, printing or storage of this E-mail by others than the intended 
recipient is strictly prohibited without the express permission of the sender. 
If you are not the intended recipient, please contact the sender immediately 
and delete all copies from your mailbox and other archives.
-

-Oorspronkelijk bericht-
Van: mevans7 [mailto:mark.ev...@morpho.com]
Verzonden: Tuesday 6 June 2017 0:36
Aan: users@camel.apache.org
Onderwerp: NettyConnector explicitly initializes SSLContext instead of using 
default

BOTTOM LINE:
I need a secure way to initialize the SSLContext in 
org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector.  (No 
keystore password in system properties.)

USE CASE:
I'm trying to configure a client to read JMS messages from Wildfly using SSL.  
This works ONLY if I specify these either with -D or
System.setProperty():

-Djavax.net.ssl.keyStore=
-Djavax.net.ssl.keyStorePassword=
-Djavax.net.ssl.trustStore=
-Djavax.net.ssl.trustStorePassword=

My problem is this: for security purposes, I cannot put the password in the 
System properties.  (These are too easy to dump out using various tools.)

So, I programatically initialize the default SSLContext.  BUT, NettyConnector 
does not use the default SSLContext.  It explicitly reads the above properties 
and creates its own SSLContext.

QUESTION:
- How can I securely pass the truststore and keystore passwords to 
NettyConnector?
- Why doesn't NettyConnector just use the default SSLContext, which can be 
configured with the same system parameters as above?






--
View this message in context: 
http://camel.465427.n5.nabble.com/NettyConnector-explicitly-initializes-SSLContext-instead-of-using-default-tp5801857.html
Sent from the Camel - Users mailing list archive at Nabble.com.