Re: swagger.json generation without host set to 0.0.0.0

2018-07-18 Thread Pontus Ullgren
Hi,

I think the most common way to get the host and port in servlet based
frameworks is to use the servlet HTTP request object.

This also allows for the container to handle the situation when it runs
behind a loadbalancer that sets the X-Forward headers.

As such I think it would be good to set these values for each request and
not just on startup since two different clients might use different
hostnames or even ports to call the same service.

Just my €0.02

Best regards
Pontus Ullgren

On Tue, 17 Jul 2018, 21:47 Claus Ibsen,  wrote:

> Hi
>
> We can possible look at allowing to plugin a custom host name
> resolver, so you can use your own implementation, or we can provide a
> "none" that dont set one, and then possible swagger wont output it.
>
> For getting port number from servlet then AFAIR its not easy. Not sure
> if you can get some details from ENV or JMX to find out which servlet
> engine is running and get details to get port number. Or use some kind
> of initial http request that calls the servlet and then you can maybe
> get the port via some servlet request information. Its been a while
> since I was working with the servlet api, so cant remember on top of
> my head.
>
> But for making camel-swagger not output hostname then we can maybe add
> a "none" implementation. You are welcome to log a JIRA and attempt to
> implement this and provide a PR. We love contributions
> http://camel.apache.org/contributing
>
> On Tue, Jul 17, 2018 at 9:08 PM, Martin Lichtin
>  wrote:
> > Thanks Rafael and Daniel
> >
> > Both of your  examples don't quite solve the 0.0.0.0
> > issue, setting an empty "host" unfortunately does not help.
> >
> > However, I learned about "hostNameResolver", so at least I can provide an
> > actual IP address.
> >
> >  > contextPath="/rest" apiContextPath="doc" enableCORS="true"
> > hostNameResolver="localIp"
> >   port="{{port}}">
> >
> > Still the problem is with the port number. Ideally the RestConfiguration
> > would get the port from the servlet, but not sure how that could work.
> >
> > - Martin
> >
> >
> >
> > On 12.07.2018 22:10, Rafael Soares wrote:
> >>
> >> Hi!
> >> Try the following conf:
> >>
> >>
> >> *   component="servlet"
> >>  enableCORS="true" host=""> >> key="api.title" value="myAPI"/> >> key="api.version" value="1.0.0"/> key="cors"
> >> value="true"/>
> >> *
> >>
> >> Regards.
> >> 
> >> Rafael Torres Coelho Soares
> >>
> >>
> >> On Thu, Jul 12, 2018 at 4:55 PM Martin Lichtin
> 
> >> wrote:
> >>>
> >>> Anyone know how I can configure  so the generated
> >>> swagger.json does not set host: "0.0.0.0"?
> >>>
> >>> With this 0.0.0.0 I cannot, for example, import the Swagger directly
> into
> >>> Postman and make calls to the API.
> >>> https://swagger.io/docs/specification/2-0/api-host-and-base-path/ says
> >>> the "host" can be omitted for a more dynamic association.
> >>>
> >>>
> >
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Re: How to stop polling at unreachable (smb) file endpoint

2018-01-03 Thread Pontus Ullgren
Hi,

Clause is absolutely correct that Camel Extra[1] is a separate project and
you are very welcome to post on that projects mailinglist.

However this is a functionality that the defined in camel core so I will
answer here anyway.

As with any other endpoint you can set bridgeErrorHandler=true on the
endpoint.

   from("smb:DOESNOTEXIST/inputshare?bridgeErrorHandler=true")

You can then handle the exceptions that arises in the consumer in a error
handler just as with other errors that occur during processing.

[1] https://camel-extra.github.io/

Best regards
Pontus Ullgren




On Wed, 3 Jan 2018 at 14:58 Claus Ibsen  wrote:

> Hi
>
> You need to report this to camel-extra as the smb component is from
> them, not from the official Apache Camel project.
>
>
> On Fri, Dec 29, 2017 at 4:04 PM, Ivana Cace  wrote:
> > We have a camel route that picks up files at an smb endpoint when the
> application starts, moves them, sends an email and then the application
> closes down.
> > If there are no files to pick up, an email is send, and the application
> closes down. To enable this we set sendEmptyMessageWhenIdle=true on the
> source-location.
> >
> > Problems arise if the smb location is unreachable for some reason, for
> example if the configuration has set an unauthorised user or an invalid
> password.
> > In this case the ScheduledPollConsumer keeps on polling.
> >
> > The reason is Thread keeps calling ScheduledPollConsumer.run, that is,
> GenericFileConsumer.poll exits, only to be called again and again.
> > The exception doesnt (cannot) propagate back to the caller for this
> reason there is no point in extending PollingConsumerPollStrategy and
> implementing rollback.
> >
> > How can i solve this? Maybe the pollingconsumer should also send an
> empty message on error? Or stop the route in some other way?
> >
> > Happy 2018!
> >
> > * De informatie verzonden in
> deze e-mail (inclusief bijlagen) kan vertrouwelijk van aard zijn en is
> uitsluitend bestemd voor de geadresseerde(n). Indien deze e-mail niet voor
> u bestemd is, verzoeken wij u vriendelijk het bericht te retourneren en
> vervolgens te vernietigen. Yarden doet er alles aan om ervoor te zorgen dat
> verzonden e-mailberichten vrij zijn van virussen, maar kan dit niet
> garanderen. Yarden Holding B.V., statutair gevestigd te Almere,
> Handelsregisternummer 34155452 Yarden Uitvaartfaciliteiten B.V., statutair
> gevestigd te Almere, Handelsregisternummer 30104432 Yarden Uitvaartzorg
> B.V., statutair gevestigd te Almere, Handelsregisternummer 04050164
> <040-501%2064> Yarden Uitvaartverzekeringen N.V., statutair gevestigd te
> Almere, Handelsregisternummer 33244450
> *
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Re: XPath with namespaces, Spring DSL and Spring Boot

2017-08-11 Thread Pontus Ullgren
Hi,

Thanks for a quick response.

It turns out this works great in 2.18.4 (and 2.19.2) but not in 2.18.1
which was the version I was running.
Upgrading solves the problem.

Thanks again
Pontus


On Thu, 10 Aug 2017 at 23:57 Claus Ibsen  wrote:

> Hi
>
> Ah can you try set the namespaces on the outer  element.
>
> On Thu, Aug 10, 2017 at 10:01 AM, Pontus Ullgren 
> wrote:
> > Hi,
> >
> > I have a problem I've been unable to solve with the combination specified
> > in the subject.
> >
> > The problem is that when using the Spring DSL the namespaces should be
> > defined in the camelContext element of the XML file. However when using
> the
> > Camel Spring Boot support there is no camelContext element. Instead route
> > fragment files are imported.
> >
> > Is there any way to get the namespace definitions into the camleContext
> by
> > defining a @Bean ?
> >
> > Thanks
> > Pontus Ullgren
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


XPath with namespaces, Spring DSL and Spring Boot

2017-08-10 Thread Pontus Ullgren
Hi,

I have a problem I've been unable to solve with the combination specified
in the subject.

The problem is that when using the Spring DSL the namespaces should be
defined in the camelContext element of the XML file. However when using the
Camel Spring Boot support there is no camelContext element. Instead route
fragment files are imported.

Is there any way to get the namespace definitions into the camleContext by
defining a @Bean ?

Thanks
Pontus Ullgren


Re: jCIFS timeout settings

2017-05-08 Thread Pontus Ullgren
Hi,

You can do this either by setting the system property
jcifs.smb.client.soTimeout on the JVM level when starting the process that
runs your Camel route.
Another option is to use a properties file and the set the system
property jcifs.properties to point to that file.

For more information see the JCIFS documentation.
https://jcifs.samba.org/src/docs/api/overview-summary.html#scp

Best regards
Pontus Ullgren



On Mon, 8 May 2017 at 17:19 Peter J Nelson 
wrote:

> I have a camel route that needs to delete a file over CIFS.  For the most
> part it works, but occasionally, I get a timeout from the CIFS server.
> jcifs.smb.SmbException: Transport1 timedout waiting for response to
>
> SmbComDelete[command=SMB_COM_DELETE,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=1,pid=20925,uid=100,mid=327,wordCount=1,byteCount=77,searchAttributes=0x0006,fileName=\out\LAW_20170503133623_INC01-205.xml]
> Searching online, I found one suggestion for CIFS in general is to increase
> the socket timeout.  Is this possible to do from within Camel?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/jCIFS-timeout-settings-tp5799114.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Help with getting camel-extra karaf itest to pass

2017-03-28 Thread Pontus Ullgren
Thanks for a quick response,

Will have a look at this and see if I make it resolve that dependency.

However as I wrote the same tests work and completes successfully locally
and there the same ERROR message is logged.
So it seems that it's not vital for the tests to complete. Well at least
not when running them on my local machine.
But as you say it should still be fixed.

Cheers
// Pontus



On Tue, 28 Mar 2017 at 13:09 souciance 
wrote:

> Not sure but from the log:
>
> ERROR: Bundle org.apache.camel.karaf.camel-karaf-commands [61] Error
> starting mvn:org.apache.camel.karaf/camel-karaf-commands/2.18.0
> (org.osgi.framework.BundleException: Unresolved constraint in bundle
> org.apache.camel.karaf.camel-karaf-commands [61]: Unable to resolve
> 61.0: missing requirement [61.0] osgi.wiring.package;
>
> (&(osgi.wiring.package=org.apache.felix.gogo.commands)(version>=0.16.0)(!(version>=1.0.0org.osgi.framework.BundleException:
> Unresolved constraint in bundle
> org.apache.camel.karaf.camel-karaf-commands [61]: Unable to resolve
> 61.0: missing requirement [61.0] osgi.wiring.package;
>
> (&(osgi.wiring.package=org.apache.felix.gogo.commands)(version>=0.16.0)(!(version>=1.0.0)))
> at
> org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4002)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:2045)
> at
> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)
>   at
>
> org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)
> at java.lang.Thread.run(Thread.java:745)
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> SLF4J: Defaulting to no-operation (NOP) logger implementation
>
> It seems to be missing the bundle felix.gogo.commands to work properly.
>
> https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.gogo.command
>
>
> On Tue, Mar 28, 2017 at 12:43 PM, pontus.ullgren [via Camel] <
> ml-node+s465427n5796597...@n5.nabble.com> wrote:
>
> > Hello,
> >
> > Trying to blow some life into the camel-extra project and get a 2.18.x
> > release out.
> > However the karaf integration tests keep failing on Jenkins[1] without
> any
> > clear indication on whats wrong. When I run locally the same maven build
> > passes with success.
> >
> > A PR [2] or any other help would be much appreciated.
> >
> > Thanks
> > Pontus Ullgren
> >
> > [1]: https://camel-extra.ci.cloudbees.com/job/Camel%20Extra%20master/
> > [2]: https://github.com/camel-extra/camel-extra
> >
> >
> > --
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://camel.465427.n5.nabble.com/Help-with-getting-camel-
> > extra-karaf-itest-to-pass-tp5796597.html
> > To start a new topic under Camel - Users, email
> > ml-node+s465427n465428...@n5.nabble.com
> > To unsubscribe from Camel - Users, click here
> > <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=
> >
> > .
> > NAML
> > <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Help-with-getting-camel-extra-karaf-itest-to-pass-tp5796597p5796598.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Help with getting camel-extra karaf itest to pass

2017-03-28 Thread Pontus Ullgren
Hello,

Trying to blow some life into the camel-extra project and get a 2.18.x
release out.
However the karaf integration tests keep failing on Jenkins[1] without any
clear indication on whats wrong. When I run locally the same maven build
passes with success.

A PR [2] or any other help would be much appreciated.

Thanks
Pontus Ullgren

[1]: https://camel-extra.ci.cloudbees.com/job/Camel%20Extra%20master/
[2]: https://github.com/camel-extra/camel-extra


Re: Camel JCIFS issues detected

2017-02-20 Thread Pontus Ullgren
Thanks for reportin this.

However the camel-jcifs is part of camel-extra project[1] which has it's
own mailing list[2] and jira[3].


[1]: https://camel-extra.github.io/
[2]: http://camel-extra.1091541.n5.nabble.com/
[3]: https://camel-extra.atlassian.net/projects/CAMEX/summary

On Mon, 20 Feb 2017 at 17:42 Rene Suter  wrote:

> Hi all
>
> I use currently Camel version 2.18.2 and Camel JCIFS version 2.15.0 for
> accessing Samba shares.
>
> The current implementation failes due a missing implementation in class
> org.apacheextras.camel.component.jcifs.SmbConsumer:
>
> @Override
> protected void updateFileHeaders(final GenericFile file, final
> Message message) {
> final long length = file.getFileLength();
> final long modified = file.getLastModified();
> file.setFileLength(length);
> file.setLastModified(modified);
> if (length >= 0)
> message.setHeader(Exchange.FILE_LENGTH, length);
> if (modified >= 0)
> message.setHeader(Exchange.FILE_LAST_MODIFIED, modified);
> }
>
>
> Additionally the rename function does not work when the file already exists
> in the target folder. Could you implement property 'renameUsingCopy' in the
> same way as it is available on file2.
>
> Is there a new version planned which solves this issue?
>
> regards
> René
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-JCIFS-issues-detected-tp5794146.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: BridgePropertyPlaceholderConfigurer - Load propertyfile from database

2017-02-10 Thread Pontus Ullgren
As Clause say this is more a Spring question.

And Spring does support this by adding a custom placeholder configurer.
Here[1] is an example of a placeholder configurer that reads the properties
from a database using JDBC API.

[1]: https://github.com/Redpill-Linpro/spring-config-jdbc

Best regards
// Pontus

On Fri, 10 Feb 2017 at 11:37 Claus Ibsen  wrote:

> Hi
>
> The bridge is only to integrate with Spring. So if you want to load
> properties from databases you would need to find a way for spring to
> do that / support that.
>
> I am actually not sure if spring has support for loading properties
> from databases.
>
>
>
> On Fri, Feb 10, 2017 at 2:49 AM, Naveen  wrote:
> > Hi,
> > I'm new to apache camel, sorry if my question is very basic.
> >
> > I'm using Apache camel with spring in my application. I'm using
> > BridgePropertyPlaceholderConfigurer like below. Am accessing these
> > properties using placeholders {{ }} in camel context and ${} in spring
> > beans. I would like to add one more property file from database(mongodb)
> and
> > it should be loaded during application startup.
> >
> > Is BridePropertyPlaceholderConfigurer supports property file from
> database ?
> > or do i need to use any other property component addition to this ? I
> want
> > to access the property in both camel context and spring using same
> > placeholders {{}} in camel context and ${} in spring beans for additional
> > property file from db. Please suggest
> >
> >  >
>  class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
> > 
> > 
> >classpath:application.properties
> >classpath*:mongo.properties
> > 
> > 
> > 
> > 
> >
> > Thanks in advance
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/BridgePropertyPlaceholderConfigurer-Load-propertyfile-from-database-tp5793740.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: Using Box component

2017-01-26 Thread Pontus Ullgren
Good catch.

If you have not done so already can you please create a jira issue for this.

We love contributions

Thanks
Pontus

On Thu, 26 Jan 2017 at 19:12 Tim Dudgeon  wrote:

> What I've found out so far is that the box library used by Camel is an old
> project.
>
> The one currently recommended by box.com is this this GitHub project
> https://github.com/box/box-java-sdk which has maven coordinates of
> com.box:box-java-sdk:2.1.1
> (https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22box-java-sdk%22) and
> plenty of examples which I got running fine.
>
> The one used in Camel have Maven coords of  net.box:boxjavalibv2:3.2.1 (
> https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22boxjavalibv2%22) and
> has
> not been updated since 2014. I can't find source code or much info for this
> so have not yet been able to test whether it still works against the
> current
> box.com site.
>
> I suspect this is cause of the problem, and, if so, wonder if any of the
> Camel box component functions work correctly today.
>
> Tim
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Using-Box-component-tp5792922p5793091.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Health Check - Camel Spring Boot

2017-01-26 Thread Pontus Ullgren
The current implementation of CamelHealthIndicator[1] only verifies that
the CamelContext is started not the state of the routes.

I guess a improvement could be to allow for a property that lists a number
of routes by routeId and add logic to also check the state of the routes to
decide the status.

Something like

camel.health.validate.routes=route1,route2

Validating all routes in the context by default is not an option since
there might be routes that are intentionally stopped and as far as I can
remember there is no way to
see the reason that the route was stopped.

However since it is very easy to create your own HealthIndicator an option
would be to just do that and add the validation of the routes you know has
to be started.

Best regards
Pontus Ullgren

[1]:
https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/health/CamelHealthIndicator.java
[2]:
http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html#production-ready-health

On Fri, 27 Jan 2017 at 01:40 Launcelot  wrote:

> Wondering what the UP status on the /health end point in a camel spring
> boot
> application indicates,
> Ran the example in camel\examples\camel-example-spring-boot , looked at the
> health check end point and it showed
>
> {"status":"UP","camel":{"status":"UP","version":"2.18.1","contextStatus":"Started"},"diskSpace":{"status":"UP","total":179729068032,"free":7542001664,"threshold":10485760}}
> connected using jconsole and stopped route1, the health check showed
> everything was OK.
> stopped route 2 as well and this tiime saw 2017-01-26 16:31:34.631  INFO
> 7580 --- [ - ShutdownTask] o.a.camel.impl.DefaultShutdownStrategy   :
> Route:
> route2 shutdown complete, was consuming from: timer://status which would
> indicate that camel did obey the stop method invocation and still the
> health
> check shows ok . Granted that I am artificially stopping a route but would
> the health check indicate OK in real life if a route stopped for some
> reason? Am I thinking of this the wrong way?
> Thanks
> drajagop
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Health-Check-Camel-Spring-Boot-tp5793094.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel azure service bus queue

2017-01-11 Thread Pontus Ullgren
Hi,

Try chaning your remoteUri for the JmsConnectionFactory to be amqps instead.
Also add amqp.idleTimeout=12



If this does not work please provide more info on what your properties
especially service_bus.uri is set to.

Fredrik Jönsson has writen a good blog on the topic of connecting to Azure
Service Bus using camel
https://www.kth.se/blogs/1337/2016/11/using-apache-camel-with-azure-service-bus/

Best regards
Pontus Ullgren





On Wed, 11 Jan 2017 at 09:45 satishbhuria  wrote:

> Hi Team,
>
> I am working on a project where i have to access azure service bus queue
> and
> read write message to queue.
>
> I have written camel route for the same but is giving me error below.
>
> org.springframework.jms.UncategorizedJmsException: Uncategorized exception
> occured during JMS processing; nested exception is javax.jms.JMSException:
> Failed to create connection to: amqp://dummy-queue; nested exception is
> io.netty.channel.ConnectTimeoutException: connection timed out
>
> Let me know where i am wrong.
>
> Below is the code i have put in my project for configuration of jms
> connection factory
>
>class="org.apache.qpid.jms.JmsConnectionFactory">
> 
> 
> 
> 
> 
>
>  class="org.apache.camel.component.jms.JmsConfiguration" >
> 
> 
> 
> 
> 
> 
>
> and virtual host is get appended to service bus uri. please suggest
>
> Thanks
>
> satish
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-azure-service-bus-queue-tp5792380.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Spring boot + MockEndpointsAndSkip + DirtiesContext

2017-01-10 Thread Pontus Ullgren
Thanks for quick reply.

Turned out I was using the wrong runner class in the @RunWith annotation.
Following Claus instructions in the ticket solved the issue.

Thanks
Pontus

On Tue, 10 Jan 2017 at 23:24 Minh Tran  wrote:

> Hi Pontus,
>
> Yep I ended up raising this
> https://issues.apache.org/jira/browse/CAMEL-9332 <
> https://issues.apache.org/jira/browse/CAMEL-9332>
>
> It was fixed when I last checked this in 2.17.1. Not sure about 2.18.0
> though.
>
> > On 11 Jan 2017, at 9:13 am, Pontus Ullgren  wrote:
> >
> > Hi,
> >
> > Did anyone ever raise a Jira for this issue ?
> >
> > It seems that @MockEndpointAndSkip still (2.18.0) does not work.
> >
> > Best regards
> > Pontus Ullgren
> >
> > On Tue, 9 Aug 2016 at 02:59 Minh Tran  wrote:
> >
> >> Hi, should I raise a jira for this?
> >>
> >>> On 5 Aug 2016, at 10:03 AM, Minh Tran 
> wrote:
> >>>
> >>> Hi
> >>>
> >>> I am using Camel 2.17.2, Spring Boot 1.3.6 and seeing strange behaviour
> >> in my unit tests. I’ve simplified it to the following example
> >>>
> >>> @RunWith(CamelSpringBootJUnit4ClassRunner.class)
> >>> @SpringApplicationConfiguration
> >>> @MockEndpointsAndSkip("direct:b")
> >>> @DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
> >>> public class MockTest {
> >>>
> >>>  @Produce(uri = "direct:a")
> >>>  private ProducerTemplate producer;
> >>>
> >>>  @EndpointInject(uri = "mock:end")
> >>>  private MockEndpoint end;
> >>>
> >>>  @EndpointInject(uri = "mock:direct:b")
> >>>  private MockEndpoint directB;
> >>>
> >>>  @Autowired
> >>>  private CamelContext context;
> >>>
> >>>  @Configuration
> >>>  @EnableAutoConfiguration
> >>>  public static class Config extends SpringRouteBuilder {
> >>>
> >>>  @Override
> >>>  public void configure() throws Exception {
> >>>  from("direct:a").to("direct:b");
> >>>  from("direct:b").to("mock:end");
> >>>  }
> >>>  }
> >>>
> >>>  @Test
> >>>  public void testMock() throws InterruptedException {
> >>>  end.expectedMessageCount(0);
> >>>  directB.expectedBodiesReceived("hello");
> >>>
> >>>  producer.sendBody("hello");
> >>>
> >>>  MockEndpoint.assertIsSatisfied(context);
> >>>  }
> >>>
> >>>  @Test
> >>>  public void testMock2() throws InterruptedException {
> >>>  end.expectedMessageCount(0);
> >>>  directB.expectedBodiesReceived("hello");
> >>>
> >>>  producer.sendBody("hello");
> >>>
> >>>  MockEndpoint.assertIsSatisfied(context);
> >>>  }
> >>> }
> >>>
> >>> testMock and testMock2 are exactly the same and if run individually,
> >> they pass. However if you run both, the second one will always fail.
> >> Running them both inside eclipse and from maven command line exhibit the
> >> same behaviour.
> >>>
> >>> The error I get is
> >>> java.lang.AssertionError: mock://end Received message count. Expected:
> >> <0> but was: <1>
> >>>
> >>> Which must mean that the skipping isn’t working. Here’s the tracer
> >> output to confirm
> >>> org.apache.camel.processor.interceptor.Tracer -
> >> ID-minhmac-local-51406-1470352938165-1-2 >>> (route3) from(direct://a)
> -->
> >> direct://b <<< Pattern:InOnly,
> >> Headers:{breadcrumbId=ID-minhmac-local-51406-1470352938165-1-1},
> >> BodyType:String, Body:hello
> >>> org.apache.camel.processor.interceptor.Tracer -
> >> ID-minhmac-local-51406-1470352938165-1-2 >>> (route4) direct://b -->
> >> mock://end <<< Pattern:InOnly,
> >> Headers:{breadcrumbId=ID-minhmac-local-51406-1470352938165-1-1},
> >> BodyType:String, Body:hello
> >>>
> >>>
> >>>
> >>
> >>
>
>


Re: Spring boot + MockEndpointsAndSkip + DirtiesContext

2017-01-10 Thread Pontus Ullgren
Hi,

Did anyone ever raise a Jira for this issue ?

It seems that @MockEndpointAndSkip still (2.18.0) does not work.

Best regards
Pontus Ullgren

On Tue, 9 Aug 2016 at 02:59 Minh Tran  wrote:

> Hi, should I raise a jira for this?
>
> > On 5 Aug 2016, at 10:03 AM, Minh Tran  wrote:
> >
> > Hi
> >
> > I am using Camel 2.17.2, Spring Boot 1.3.6 and seeing strange behaviour
> in my unit tests. I’ve simplified it to the following example
> >
> > @RunWith(CamelSpringBootJUnit4ClassRunner.class)
> > @SpringApplicationConfiguration
> > @MockEndpointsAndSkip("direct:b")
> > @DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
> > public class MockTest {
> >
> >   @Produce(uri = "direct:a")
> >   private ProducerTemplate producer;
> >
> >   @EndpointInject(uri = "mock:end")
> >   private MockEndpoint end;
> >
> >   @EndpointInject(uri = "mock:direct:b")
> >   private MockEndpoint directB;
> >
> >   @Autowired
> >   private CamelContext context;
> >
> >   @Configuration
> >   @EnableAutoConfiguration
> >   public static class Config extends SpringRouteBuilder {
> >
> >   @Override
> >   public void configure() throws Exception {
> >   from("direct:a").to("direct:b");
> >   from("direct:b").to("mock:end");
> >   }
> >   }
> >
> >   @Test
> >   public void testMock() throws InterruptedException {
> >   end.expectedMessageCount(0);
> >   directB.expectedBodiesReceived("hello");
> >
> >   producer.sendBody("hello");
> >
> >   MockEndpoint.assertIsSatisfied(context);
> >   }
> >
> >   @Test
> >   public void testMock2() throws InterruptedException {
> >   end.expectedMessageCount(0);
> >   directB.expectedBodiesReceived("hello");
> >
> >   producer.sendBody("hello");
> >
> >   MockEndpoint.assertIsSatisfied(context);
> >   }
> > }
> >
> > testMock and testMock2 are exactly the same and if run individually,
> they pass. However if you run both, the second one will always fail.
> Running them both inside eclipse and from maven command line exhibit the
> same behaviour.
> >
> > The error I get is
> > java.lang.AssertionError: mock://end Received message count. Expected:
> <0> but was: <1>
> >
> > Which must mean that the skipping isn’t working. Here’s the tracer
> output to confirm
> > org.apache.camel.processor.interceptor.Tracer -
> ID-minhmac-local-51406-1470352938165-1-2 >>> (route3) from(direct://a) -->
> direct://b <<< Pattern:InOnly,
> Headers:{breadcrumbId=ID-minhmac-local-51406-1470352938165-1-1},
> BodyType:String, Body:hello
> > org.apache.camel.processor.interceptor.Tracer -
> ID-minhmac-local-51406-1470352938165-1-2 >>> (route4) direct://b -->
> mock://end <<< Pattern:InOnly,
> Headers:{breadcrumbId=ID-minhmac-local-51406-1470352938165-1-1},
> BodyType:String, Body:hello
> >
> >
> >
>
>


Re: Nested routing using rest and MQ processing asyncronously

2017-01-08 Thread Pontus Ullgren
Hi,

If you don't want to wait for the reply from the queue you can use inOnly
to force a one way MEP.

Something like this
 

Best regards
Pontus

On Sat, 7 Jan 2017, 18:00 Rajneesh,  wrote:

> I have a use case:
> 1. Client send the msg via rest endpoint
> 2. App need to get it, validate it, put in MQ, and send acknowledgement
> (message received) to client app in rest response.
> 3. MQ endpoint has its own route to offline processing of msg which
> triggers
> as soon as msg is in queue.
> 4. rest response can not wait till the MQ processing to be complete and has
> to go independently.
>
> Problem what I am facing is some time rest respone get delayed and
> stuck/meshed up with MQ processing and client is not getting response on
> given SLA.
>
> I have done nested routing Configuration in camel context like below.. not
> sure is it right way or not..but its not working as expected. Please
> advise:
>
> 
> 
>  
>  
>  
> 
>
> 
> 
>   
> 
>  uri="bean:restCallResponserService?method=generateSuccessResponse"/>
> 
> java.lang.Exception
>  
>  true
>  
>   
> 
> 
>
> 
>  
>   
> 
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Nested-routing-using-rest-and-MQ-processing-asyncronously-tp5792279.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Contract first with Swagger and Camel

2016-11-22 Thread Pontus Ullgren
Hi.

I'm looking in to the possibility to do Contract First development with
Camel when the contract is a Swagger document. However I have been unable
to find any good resources on this subject. So before we run of and build
something I would like to check with the mailing list.

How do you do contract first REST development with Camel ? Is there any
tools out there  ?
I know about,  and have used, swagger codegen (for otrher frameworks). But
as it is now it does not seem to have support OOTB for Camel REST DSL.

What would be the preferred way to do this from the community ?

Personally I can see two ways to go.

A) Add support in swagger codegen for generating Camel REST DSL (as XML
and/or Java). The con of this option is that after generating code from
swagger the resulting implementation will never expose a swagger definition
that is exactly as the original. At least that is my experience from using
codegen for other frameworks.

B) Create a new Camel component that takes the Swagger definition file and
then acts as a dynamic router. It could be as simple as sending the message
to an direct endpoint based on the resource "operationId".
This new camel component could also expose a Swagger UI console based on
the original contract swagger definition instead of generating one from
REST DSL comments.
The con here is obviously that it would create yet another REST component
for camel.


// Pontus


Re: JSON -> JSON Transformation

2016-11-16 Thread Pontus Ullgren
If you just want to do json to json transformation there is also the camel
jolt component.

Best regards
Pontus

On Wed, 16 Nov 2016, 00:16 Kasun Indrasiri,  wrote:

> What's the most efficient way to do type conversions from JSON to JSON.
> Does Camel use any internal canonical model while doing this?
>
> Thanks.
>


Re: 'host' configuration param not used by servlet

2016-11-11 Thread Pontus Ullgren
I agree with Jonas original comment.

Since camel-swagger-java allows for explicitly setting a hostname it should
have precedence over the hostname taken from the servlet context
(regardless if it in turn is taken from 'X-Forwarded-Host' or 'Host').

@Jonas: I would suggest that you log a Jira with your findings.

// Pontus


On Fri, 11 Nov 2016 at 03:26 Vitalii Tymchyshyn  wrote:

> In Tomcat you can add
>
> https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html
>
> Ср, 2 лист. 2016 о 13:51 Jonas Koperdraat  пише:
>
> > Hi Zoran,
> >
> > I've checked and the proxy sets the 'X-Forwarded-Host' header and this
> > contains the 'correct' host. The 'Host' header is also present on the
> > request and this contains the hostname of the actual machine the servlet
> is
> > running on. I'm not sure if we have the option to set it, but seeing as
> we
> > already have the desired hostname available in de 'X-Forwarded-Host'
> option
> > I'm not going to investigate that further ;-)
> >
> > But I guess our servlet container, which indeed is Tomcat, doesn't take
> the
> > X-Forwarded-Host header into consideration when constructing the
> requestUrl
> > parameter of the SerlvetRequest. So we'll have to manually insert the
> > desired hostname into the request url.
> >
> > Kind regards,
> >
> > Jonas
> >
> > Op wo 2 nov. 2016 om 16:33 schreef Zoran Regvart :
> >
> > > Hi Jonas,
> > >
> > > On Wed, Nov 2, 2016 at 4:25 PM, Jonas Koperdraat
> > >  wrote:
> > > > I don't know whether that header is being sent by the proxy. Should
> > that
> > > > impact the behavior I am seeing (e.g. should does that influence the
> > > result
> > > > of getRequestURL)?
> > >
> > > It does on some Servlet engines / middlewares, it might not in your
> > > case, especially if you're using Tomcat.
> > >
> > > Another header that you might want to investigate is the `Host`
> > > header, it's used for virtual hosts, and you might have an option to
> > > set it in your proxy (on the request sent to the backend).
> > >
> > > zoran
> > > --
> > > Zoran Regvart
> > > zregv...@redhat.com
> > >
> >
>


Re: smb cannot connect to server

2016-10-28 Thread Pontus Ullgren
Hi,

Looking into the source of the jcifs library (where the exception
originates) it seems that the root cause of the exception is
a UnknownHostException.

See the FAQ for the jcifs library (https://jcifs.samba.org/FAQ.html#ukhost).
Is the server address resolvable over DNS you can try changing the
resolveOrder property to first use DNS resolution (see the documentation
https://jcifs.samba.org/src/docs/resolver.html).

Best regards
Pontus Ullgren

On Fri, 28 Oct 2016 at 20:05 Peter J Nelson 
wrote:

> Camel: 2.16.3, camel-jcifs: 2.15.0 (latest)
>
> I am using jCIFS and attempting to connect to a remote share in a different
> domain.  I can connect to this share without issue using Windows Explorer
> (Win 7) and the UNC path.  I can also connect through Linux using smbclient
> (SuSE 11, samba-client-3.6.3-0.56.1) and mount it as -t cifs
> (cifs-utils-5.1-0.11.1).
>
> However, connecting to the share through camel's jcifs/smb component does
> not work on shares outside of the default domain.  I was initially using
> the
> smb://domain;username:password@fullyqualifiedhost/share/path .  This
> format
> worked fine for Windows shares within my default domain, but failed when
> trying to connect to a remote domain.
>
> I turned up logging to debug for "org.apacheextras.camel.component.jcifs",
> and found this when I'd try connecting:
>
> 10/28/2016 12:58:49 DEBUG [Camel (tritechProcessorContext) thread #0 -
> smb://rce_cad_rms_es.rc-ecc.org/StPaul/Out]
> org.apacheextras.camel.component.jcifs.DefaultSmbClient login()
> domain[null]
> username[null] password[***]
>
> From that, it appears as if the username & domain were not being sent.  I
> added these as query strings, and that seemed to fix THAT issue:
>
> 10/28/2016 13:03:12 DEBUG [Camel (tritechProcessorContext) thread #0 -
> smb://rce_cad_rms_es.rc-ecc.org/StPaul/Out]
> org.apacheextras.camel.component.jcifs.DefaultSmbClient login()
> domain[rc-ecc] username[testuser] password[***]
>
> However, it still cannot connect to that server:
>
> org.apache.camel.component.file.GenericFileOperationFailedException: Could
> not get files Failed to connect to server
> at
>
> org.apacheextras.camel.component.jcifs.SmbOperations.listFiles(SmbOperations.java:345)
> ~[camel-jcifs-2.15.0.jar:2.15.0]
> at
>
> org.apacheextras.camel.component.jcifs.SmbConsumer.pollDirectory(SmbConsumer.java:58)
> ~[camel-jcifs-2.15.0.jar:2.15.0]
> at
>
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:119)
> ~[camel-core-2.16.3.jar:2.16.3]
> at
>
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
> [camel-core-2.16.3.jar:2.16.3]
> at
>
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
> [camel-core-2.16.3.jar:2.16.3]
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> [na:1.8.0_102]
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> [na:1.8.0_102]
> at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> [na:1.8.0_102]
> at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> [na:1.8.0_102]
> at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> [na:1.8.0_102]
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> [na:1.8.0_102]
> at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
> Caused by: jcifs.smb.SmbException: Failed to connect to server
> at jcifs.smb.SmbFile.connect0(SmbFile.java:882)
> ~[jcifs-1.3.17.jar:na]
> at jcifs.smb.SmbFile.resolveDfs(SmbFile.java:669)
> ~[jcifs-1.3.17.jar:na]
> at jcifs.smb.SmbFile.send(SmbFile.java:773) ~[jcifs-1.3.17.jar:na]
> at jcifs.smb.SmbFile.doFindFirstNext(SmbFile.java:1986)
> ~[jcifs-1.3.17.jar:na]
> at jcifs.smb.SmbFile.doEnum(SmbFile.java:1738)
> ~[jcifs-1.3.17.jar:na]
> at jcifs.smb.SmbFile.listFiles(SmbFile.java:1715)
> ~[jcifs-1.3.17.jar:na]
> at jcifs.smb.SmbFile.listFiles(SmbFile.java:1648)
> ~[jcifs-1.3.17.jar:na]
> at
>
> org.apacheextras.camel.component.jcifs.DefaultSmbClient.listFiles(DefaultSmbClient.java:161)
> ~[camel-jcifs-2.15.0.jar:2.15.0]
> at
>
> org.apacheextras.camel.component.jcifs.SmbOperations.listFiles(SmbOperations.java:341)
> ~[camel-jcifs-2.15.0.jar:2.15.0]
> ... 11 common frames omitted
>
> What am I missing?  Does camel not fully support smb?
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/smb-cannot-connect-to-server-tp5789414.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


IDE for newer Camel versions using Camel Spring Boot

2016-10-23 Thread Pontus Ullgren
Hi,

I know about JBoss Tools Camel Tooling and been using it. It works great as
long as we stayed with the RedHat supported versions of Camel and JBoss
Fuse. But lately we have moved away from this and going with Camel Spring
Boot and more up to date versions of Camel.

The main reason for this is to get new features faster.

The problem now is that JBoss Tools does not handle this combination well.
But that is a JBoss specific issue so that is not what I want to discuss
here. There is other forums for this.

Instead my question: What do you use for developing your Camel based
applications ?
I quickly tested Spring Tool Suite which kind of give us most of what we
look for including good support for gradle. But hope to get some more
suggestions.

We mostly use the Spring XML DSL to define the routes but also some Java
DSL.
Code completion and some tooltips in XML editing mode is a requirement.
Graphical visualisation and editing of the routes is a bonus but I assume
that JBoss Tools is the only one that supports this.

Thanks for any insight you can share
Pontus


Re: Is there Camel integration with the Spread Toolkit ?

2016-07-22 Thread Pontus Ullgren
Never used spread but a quick google shows that there is a jms
implementation available (http://www.spread.org/JMS4Spread/)  so perhaps
you can use that together with the camel-jms or camle-sjms component.

Spread toolkit also has a java sdk so you can use that to build your own
processors and beans. Or even build you own spread camel component.

Best regards
Pontus Ullgren

Den fre 22 juli 2016 17:06jkam...@caci.com  skrev:

> On to my next fun task. I'm being asked to integrate messages being
> generated
> from a  Spread Toolkit <http://www.spread.org/index.html>   messaging
> service application to our Camel/ActiveMQ implementation. Searching for
> whether there is any handy tool for integrating these yielded no useful
> results on Google leading me to believe this is not a common task or that
> my
> Google skills have diminished greatly of late. I should also note for your
> own well-being that when Googling "Spread" make sure you're not including
> images in the results.
>
> That said, has anyone tried to directly route messages from Spread through
> Camel? If so could you point me towards any helpful documentation and/or
> toolkits for accomplishing the same?
>
> TIA -
>
> j.kammer.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Is-there-Camel-integration-with-the-Spread-Toolkit-tp5785368.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Trying to use the TarSplitter ...

2016-06-09 Thread Pontus Ullgren
No sorry none of the work-arounds I tested seemed to work.
To be honest I've never used the TarSplitter myself in any project.
My initial answer was simply based on the class hierarchy of
TarElementInputStreamWrapper and expericne from the ZipFile component.

Any way for reference could you post a link to the Jira issue here.


On Thu, 9 Jun 2016 at 10:22 nicolasduminil <
nicolas.dumi...@simplex-software.fr> wrote:

> Waiting for the Jira, how could I work-around this issue ? Do you have any
> suggestion ?
>
> Many thanks in advance,
>
> Nicolas DUMINIL
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Trying-to-use-the-TarSplitter-tp5783658p5783749.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Trying to use the TarSplitter ...

2016-06-08 Thread Pontus Ullgren
Yes agree,

I also get the same behaviour from a similare route when running Camel
2.17.1.

Could you create a issue in Jira for this.

// Pontus

On Wed, 8 Jun 2016 at 17:23 nicolasduminil <
nicolas.dumi...@simplex-software.fr> wrote:

> Hello,
>
> Thanks for your reply. So, what you're saying is that
> org.apache.camel.dataformat.tarfile.TarElementInputStreamWrapper would be
> an
> input stream, right ? In this case I don't need to convert it, just could
> read from it. But I tried the following:
>
> from("direct:unzip").unmarshal().gzip()
> .split(new TarSplitter())
> .to("file:{{file.unzip.path}}?fileName=${file:name}");
>
> The file-system structure gets correctly created, I mean folders,
> sub-folders, etc., until the file level. But all the files are created with
> 0 blocks, i.e. empty. Do you have any idea of what might happening here ?
>
> Many thanks in advance,
>
> Nicolas
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Trying-to-use-the-TarSplitter-tp5783658p5783722.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Trying to use the TarSplitter ...

2016-06-08 Thread Pontus Ullgren
You can try to convert the input stream to the desired format using
convertBodyTo before the debug processor.

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

Best regards
Pontus

On Wed, 8 Jun 2016, 11:46 nicolasduminil, <
nicolas.dumi...@simplex-software.fr> wrote:

> Hello,
>
> I need to process a .tar.gz file in a route and, after some googling, I
> came
> at something like the following:
>
> ...
> from("direct:unzip").unmarshal().gzip()
> .split(new TarSplitter()).process("debug")
> ...
>
> I didn't find much documentation concerning TarSplitter and I'm wondering
> whether it is a fully supported component. Also, in the "debug" processor,
> I
> display inMessage.getBody().getClass().getName() which displays:
>
> org.apache.camel.dataformat.tarfile.TarElementInputStreamWrapper
>
> So, my question is how can I get either the file or its content out of this
> ?
>
> Many thanks in advance.
>
> Nicolas
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Trying-to-use-the-TarSplitter-tp5783658.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: XML Configuration with Spring boot

2016-06-03 Thread Pontus Ullgren
Hi,

For beans you can place your beans in a separate spring xml in
src/main/resources and import it in your FatJarRouter using the @Import(..)
annotation.


@SpringBootApplication
@ImportResource( "beans.xml" )
public class MyFatJarRouter extends FatJarRouter {
...

// Pontus

On Sat, 4 Jun 2016 at 00:03 J-  wrote:

> Hi,
>
> When using camel with spring-boot with xml config, can you only use
>  and  xml components?
>
> Is it possible to do other configuration in xml when using spring-boot?
> For example  or  inside the xml?
>
> I know this has been asked before a long time ago, but now that it's a few
> years later, is there any preference/benefits of using xml over java.
>
> Our lead wants us to switch back to using xml instead of java, and so far
> the xml is far more difficult to write.
>
> Thanks,
>
> -J
>


Re: Problem transfer from SMB to FTP OutMemory Java Heap Space

2016-06-03 Thread Pontus Ullgren
Strange I have run applications where I transfer files up to 300MB without
problems using camel-jcifs.
Feel free to log a jira (
https://camel-extra.atlassian.net/projects/CAMEX/issues) with your findings.

However I do agree that if you use case is such that you can mount the
shares (either on windows or using smbmount on linux) then using the
file:// transport is probably a more stable and tested way to go.
Also if you are running from a Windows machine I do belive using file://
witth a UNC path is also possible. Provided that the user your JVM is
running as has access to the share.

Best regards
Pontus Ullgren



On Fri, 3 Jun 2016 at 15:17 Hans Orbaan  wrote:

> Hi,
>
> You should mount your share and use the file:// component to avoid out of
> memory errors. There is something wrong with camel-jcifs. It will go out of
> memory (threads I guess, not memory, but system resources) will retrieving
> a file.
> This already happens from 5 MB or more we found. Could not really locate
> the issue though.
>
> With kind regards,
>
> Hans Orbaan
>
>
> -----Oorspronkelijk bericht-
> Van: Pontus Ullgren [mailto:ullg...@gmail.com]
> Verzonden: Friday 3 June 2016 13:15
> Aan: users@camel.apache.org
> Onderwerp: Re: Problem transfer from SMB to FTP OutMemory Java Heap Space
>
> localWorkDirectory is a directory on the server where your camel route run
> (in Fuse as you say),
>
> localWorkDirectory is also supported in camel-jcifs (
> http://camel.apache.org/jcifs.html).
>
>
> // Pontus
>
> On Fri, 3 Jun 2016 at 08:12 Daniel Pompa  wrote:
>
> > Hi Pontus, sorry Im new in Fuse. The Camel version is 2.12.0
> >
> > how I can defined the heap size to the Java Process?
> >
> > I add localWorkDirectory into the URI, but fail again, this
> > localWorkDirectory is a directory in Fuse or in the smb server? I put
> > in the localWorkDirectory  in smb.
> >
> > I saw localWorkDirectory is just for FTP.
> >
> > Thanks.
> >
> >
> >
> > --
> > View this message in context:
> > http://camel.465427.n5.nabble.com/Problem-transfer-from-SMB-to-FTP-Out
> > Memory-Java-Heap-Space-tp5783383p5783388.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>


Re: Problem transfer from SMB to FTP OutMemory Java Heap Space

2016-06-03 Thread Pontus Ullgren
localWorkDirectory is a directory on the server where your camel route run
(in Fuse as you say),

localWorkDirectory is also supported in camel-jcifs (
http://camel.apache.org/jcifs.html).


// Pontus

On Fri, 3 Jun 2016 at 08:12 Daniel Pompa  wrote:

> Hi Pontus, sorry Im new in Fuse. The Camel version is 2.12.0
>
> how I can defined the heap size to the Java Process?
>
> I add localWorkDirectory into the URI, but fail again, this
> localWorkDirectory is a directory in Fuse or in the smb server? I put in
> the
> localWorkDirectory  in smb.
>
> I saw localWorkDirectory is just for FTP.
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Problem-transfer-from-SMB-to-FTP-OutMemory-Java-Heap-Space-tp5783383p5783388.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Problem transfer from SMB to FTP OutMemory Java Heap Space

2016-06-02 Thread Pontus Ullgren
Which version of Camel and Camel Extra are you using ?
What heap size have you allocated to the Java process ?

Have you tried adding the localWorkDirectory URI option to the smb URI to
avoid loading the file content into memory ?

Best regard
Pontus Ullgren

On Thu, 2 Jun 2016 at 11:40 Daniel Pompa  wrote:

> I have a problema with Fuse. I created a route,
>
> http://camel.apache.org/schema/spring";
> id="sap-xrt-connect-interface-receive-20160414">
>  uri="smb://x;x@x
> /APLICACIONES/EFACDES/xxxs/?password=&delete=false&delay=6"/>
> 
>  redeliveryDelay="2" retryAttemptedLogLevel="WARN"/>
> 
> 
> ${property.CamelBatchComplete}
> 
> 
> 
> net.aqualogy.sap.xrt.connect.SapProcessor$1$2
> 
>  uri="sftp://x@x
> //DATOS/Interfaces/EXTRACTOS_xxx/extractosXRT?flatten=true&password=x&passiveMode=true&binary=true&autoCreate=false"/>
> 
> 
> 
>
> The route smb have 5000 files, when a start to tranfer I have the error
> OutMemory Java Heap Space, and sockedRead(File Descriptor). I think is for
> the amount of files in smb.
>
> Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Problem-transfer-from-SMB-to-FTP-OutMemory-Java-Heap-Space-tp5783383.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Spring Boot adding XML routes

2016-04-23 Thread Pontus Ullgren
Doh !

Thanks for your quick reply.
Pontus Ullgren


On Fri, 22 Apr 2016 at 09:59 Luca Burgazzoli  wrote:

> Looks like the xml definition lacks the from element ;)
> ---
> Luca Burgazzoli
>
>
> On Thu, Apr 21, 2016 at 10:01 PM, Pontus Ullgren 
> wrote:
> > Hello,
> >
> > From a project based on the camel-archetype-spring-boot I'm trying to add
> > additional routes defined in XML as described in the documentation[0].
> >
> > However when starting the application it fails with
> > a java.util.NoSuchElementException. The full stacktrace can be found
> > here[1].
> >
> > I use Camel 2.17.0. The full project is available on bitbucket[2].
> >
> > Is this a bug or is there something I'm doing wrong ?
> >
> > [0] http://camel.apache.org/spring-boot.html#SpringBoot-AddingXMLroutes
> > [1]
> >
> https://bitbucket.org/ullgren/camelspringbootexample/raw/ef6274c60163e4a324a67e07a270a8dde7d68308/startup-error.txt
> > [2] https://bitbucket.org/ullgren/camelspringbootexample
>


Camel Spring Boot adding XML routes

2016-04-21 Thread Pontus Ullgren
Hello,

>From a project based on the camel-archetype-spring-boot I'm trying to add
additional routes defined in XML as described in the documentation[0].

However when starting the application it fails with
a java.util.NoSuchElementException. The full stacktrace can be found
here[1].

I use Camel 2.17.0. The full project is available on bitbucket[2].

Is this a bug or is there something I'm doing wrong ?

[0] http://camel.apache.org/spring-boot.html#SpringBoot-AddingXMLroutes
[1]
https://bitbucket.org/ullgren/camelspringbootexample/raw/ef6274c60163e4a324a67e07a270a8dde7d68308/startup-error.txt
[2] https://bitbucket.org/ullgren/camelspringbootexample


Re: Camel Version compatibility with Java Version

2016-03-18 Thread Pontus Ullgren
You can find a list of Camel dependencies here.
http://camel.apache.org/what-are-the-dependencies.html

>From that it actually seems that 2.14 onwards should require jdk 1.7. Which
seems to contradict what you report you are using.
So I guess the page needs updating :-)

Best regards
Pontus

On Thu, 17 Mar 2016, 18:37 Sag21,  wrote:

> Unable to find out the which old camel versions support Java 1.6.
> Is there any page or info about the same.
> Right now I am using 1.6 with 2.14.1 so does it good idea to move to higher
> Camel Version if anything available for Java 1.6. I don't want to upgrade
> java version.
>
> Your help is really appreciated.
>
> Thanks,
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Version-compatibility-with-Java-Version-tp5779243.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Version compatibility with Java Version

2016-03-18 Thread Pontus Ullgren
If it is code that are not yet in production then I would strongly
recommend that you upgrade the Java version to 1.8.
Java 1.6 is after all effectively EOL by Oralce since Feb 2013.
So if you want to have a application build on supported products going live
now with application based on Java 1.6 is not the way to do it :-)


On Thu, 17 Mar 2016 at 19:21 Sag21  wrote:

> Thanks Pontus for reply. Can someone please through some light as the code
> will move to production,so it will be very bad move to use Camel with
> Spring.
> I don't see any issue yet for 1.6 and Camel 2.14.1.
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Version-compatibility-with-Java-Version-tp5779243p5779246.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: JCIFS component and overwriting

2015-11-06 Thread Pontus Ullgren
Which version of Camel and Camel Extra are you using?

You should be able to control this using the fileExist URI option. See the
documentation on the file component (http://camel.apache.org/file2.html)

On Fri, 6 Nov 2015, 19:22 fliot33  wrote:

> Hi,
> I'm using : wireTap to smb:///
> And when trying to overwrite, I get
>
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> store file smb:///
> at
>
> org.apacheextras.camel.component.jcifs.SmbOperations.storeFile(SmbOperations.java:296)
> at
>
> org.apacheextras.camel.component.jcifs.SmbProducer.writeFile(SmbProducer.java:267)
> at
>
> org.apacheextras.camel.component.jcifs.SmbProducer.processExchange(SmbProducer.java:122)
> at
>
> org.apacheextras.camel.component.jcifs.SmbProducer.process(SmbProducer.java:70)
> at
>
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at
>
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416)
> at
>
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
> at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)
> at
>
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
> at
>
> org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:98)
> at
>
> org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:94)
> at java.util.concurrent.FutureTask.run(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
> at java.lang.Thread.run(Unknown Source)
> Caused by: jcifs.smb.SmbException: The system cannot find the path
> specified.
> at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:563)
> at jcifs.smb.SmbTransport.send(SmbTransport.java:663)
> at jcifs.smb.SmbSession.send(SmbSession.java:238)
> at jcifs.smb.SmbTree.send(SmbTree.java:119)
> at jcifs.smb.SmbFile.send(SmbFile.java:775)
> at jcifs.smb.SmbFile.open0(SmbFile.java:989)
> at jcifs.smb.SmbFile.open(SmbFile.java:1006)
> at
> jcifs.smb.SmbFileOutputStream.(SmbFileOutputStream.java:142)
> at
> jcifs.smb.SmbFileOutputStream.(SmbFileOutputStream.java:97)
> at
>
> org.apacheextras.camel.component.jcifs.JcifsSmbApiFactory.createSmbFileOutputStream(JcifsSmbApiFactory.java:50)
> at
>
> org.apacheextras.camel.component.jcifs.DefaultSmbClient.storeFile(DefaultSmbClient.java:134)
> at
>
> org.apacheextras.camel.component.jcifs.SmbOperations.storeFile(SmbOperations.java:293)
> ... 14 more
> ERROR | Camel (PoplidaysCamelContext) thread #19 - WireTap | Could not
> locate or create direction 'smb:///' due to
> 'jcifs.smb.SmbException: Cannot create a file when that file already
> exists.'
>
> I review component documentation, and I didn't find any additionnal
> parameters, is there a simple way to do so ?
>
> Thanks in advance.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/JCIFS-component-and-overwriting-tp5773458.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: what's happening to camel extra?

2015-09-04 Thread Pontus Ullgren
Victor and David: You are welcome to join the com-dev mailing list and
enlighten them.
Here is a link the latest answer on that question :-)

https://mail-archives.apache.org/mod_mbox/community-dev/201507.mbox/%3CBY2PR03MB490B6943E12F5D925203A2E99900%40BY2PR03MB490.namprd03.prod.outlook.com%3E

// Pontus


On Fri, 4 Sep 2015 at 16:01 David Karlsen  wrote:

> Why not github?
> 4. sep. 2015 3:54 p.m. skrev "Victor NOËL" :
>
> > Are they even aware of the problem with sourceforge?
> > Maybe someone that is known there (such as a member of an Apache Project
> > ;) could tell them before they take the wrong decision?
> >
> > It's even worse than what I thought because after the Gimp people told SF
> > to stop doing their shady things, they actually insisted during 2015:
> >
> https://mail.gnome.org/archives/gimp-developer-list/2015-May/msg00097.html
> >
> https://mail.gnome.org/archives/gimp-developer-list/2015-May/msg00098.html
> >
> > Victor
> >
> > Le 04/09/2015 15:36, Raul Kripalani a écrit :
> >
> >> Quite frankly, SF would be my last resort. But the Apache Extras
> >> repositories are governed by the ASF and the consensus seems to point to
> >> SF
> >> rather than Github (which would have been my personal preference) or
> >> Bitbucket.
> >>
> >> Regards,
> >>
> >> *Raúl Kripalani*
> >> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> >> Integration specialist
> >> http://about.me/raulkripalani |
> http://www.linkedin.com/in/raulkripalani
> >> http://blog.raulkr.net | twitter: @raulvk
> >>
> >> On Fri, Sep 4, 2015 at 2:22 PM, Victor NOËL 
> >> wrote:
> >>
> >> I arrive a bit late, but are we sure sourceforge is a good solution?
> >>>
> >>> After all the fuss about their terrible behaviour by implanting adware
> >>> and
> >>> other spyware in installers available to download there.
> >>> It became known with the big complain of the Gimp project (that wasn't
> >>> even fixed by SourceForge…).
> >>>
> >>> See
> >>>
> >>>
> http://www.theregister.co.uk/2013/11/08/gimp_dumps_sourceforge_over_dodgy_ads_and_installer/
> >>> for details.
> >>>
> >>> Victor
> >>>
> >>>
> >>> Le 04/09/2015 13:29, Pontus Ullgren a écrit :
> >>>
> >>> Do we not already have volunteers in the current set of contributors
> for
> >>>> the project ?
> >>>> I for one is willing in continue maintaining the project once it has
> >>>> been
> >>>> moved (where ever it is moved).
> >>>>
> >>>> I think the question right now is the progress of the SF migration.
> >>>>
> >>>> // Pontus
> >>>>
> >>>> On Fri, 4 Sep 2015 at 09:18 Henryk Konsek  wrote:
> >>>>
> >>>> Hi,
> >>>>
> >>>>> As far as I know the Apache Extras projects are being moved to the...
> >>>>> SourceForge. So we need to find a volunteer willing to maintain the
> >>>>> project
> >>>>> after  SourceForge migration.
> >>>>>
> >>>>> Cheers!
> >>>>>
> >>>>> czw., 3.09.2015 o 20:38 użytkownik Pontus Ullgren  >
> >>>>> napisał:
> >>>>>
> >>>>> Have not seen any other updates on the comdev mailing list no.
> >>>>>
> >>>>>> Perhaps we should reach out to Daniel Gruno (that seems to be in
> >>>>>> charge
> >>>>>>
> >>>>>> of
> >>>>>
> >>>>> the move) to get a status update for camel-extra.
> >>>>>>
> >>>>>> // Pontus
> >>>>>>
> >>>>>> On Wed, 2 Sep 2015 at 23:57 Raul Kripalani 
> wrote:
> >>>>>>
> >>>>>> Hey guys,
> >>>>>>
> >>>>>>> Do we have an update on the ASF front about the Apache Extras
> >>>>>>>
> >>>>>>> migration?
> >>>>>> Users are asking for new releases of camel-extras components...
> >>>>>>
> >>>>>>> I quickly went through the ComDev thread but found no conclusion.
> >>>>>>>
> >>>>>>> Maybe I
> &

Re: what's happening to camel extra?

2015-09-04 Thread Pontus Ullgren
Do we not already have volunteers in the current set of contributors for
the project ?
I for one is willing in continue maintaining the project once it has been
moved (where ever it is moved).

I think the question right now is the progress of the SF migration.

// Pontus

On Fri, 4 Sep 2015 at 09:18 Henryk Konsek  wrote:

> Hi,
>
> As far as I know the Apache Extras projects are being moved to the...
> SourceForge. So we need to find a volunteer willing to maintain the project
> after  SourceForge migration.
>
> Cheers!
>
> czw., 3.09.2015 o 20:38 użytkownik Pontus Ullgren 
> napisał:
>
> > Have not seen any other updates on the comdev mailing list no.
> >
> > Perhaps we should reach out to Daniel Gruno (that seems to be in charge
> of
> > the move) to get a status update for camel-extra.
> >
> > // Pontus
> >
> > On Wed, 2 Sep 2015 at 23:57 Raul Kripalani  wrote:
> >
> > > Hey guys,
> > >
> > > Do we have an update on the ASF front about the Apache Extras
> migration?
> > > Users are asking for new releases of camel-extras components...
> > >
> > > I quickly went through the ComDev thread but found no conclusion.
> Maybe I
> > > overlooked an email in that thread. Things tend to get very chatty over
> > > there and there's no clearly marked conclusion email.
> > >
> > > Regards,
> > >
> > > *Raúl Kripalani*
> > > Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> > > Integration specialist
> > > http://about.me/raulkripalani |
> http://www.linkedin.com/in/raulkripalani
> > > http://blog.raulkr.net | twitter: @raulvk
> > >
> > > On Fri, Aug 21, 2015 at 8:56 AM, Pontus Ullgren 
> > wrote:
> > >
> > > > From this thread[1]  it seems that Daniel Gruno is the one in charge
> > for
> > > > the move.
> > > > However I fail to find any indication on the progress or roadmap.
> > > > Using Github as a backup plan does NOT[2] seem to be a option in the
> > > > opinion of the community-dev decision.
> > > > Anyway perhaps we should move this discussion to the camel-dev
> > > mailinglist.
> > > >
> > > > [1]
> > > >
> > > >
> > >
> >
> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3C559EC097.7000707%40apache.org%3E
> > > > [2]
> > > >
> > > >
> > >
> >
> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3cby2pr03mb490b6943e12f5d925203a2e99...@by2pr03mb490.namprd03.prod.outlook.com%3E
> > > >
> > > > // Pontus
> > > >
> > > > On Fri, 21 Aug 2015 at 07:17 Christoph Emmersberger <
> > cemme...@gmail.com>
> > > > wrote:
> > > >
> > > > > Is there any date when this move is expected? We have still the
> > backup
> > > > plan
> > > > > with Github in place, ...
> > > > >
> > > > > On Thu, Aug 20, 2015 at 6:54 AM, Pontus Ullgren  >
> > > > wrote:
> > > > >
> > > > > > Diging through the community development list shows that it will
> be
> > > > moved
> > > > > > to sourceforge along with the rest of the apache extra.
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/browser
> > > > > >
> > > > > > On Thu, 20 Aug 2015 14:12 Pontus Ullgren 
> > wrote:
> > > > > >
> > > > > > >
> > > > > > > Yes this has been discussed on the dev list[1][2] and the
> Apache
> > > > > > community
> > > > > > > development mailing list [2].
> > > > > > >
> > > > > > > Unfortuantly there does not seem to be any conclusion on this
> > > > > discussion
> > > > > > > yet.
> > > > > > >
> > > > > > > // Pontus
> > > > > > >
> > > > > > > [1]
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://camel.465427.n5.nabble.com/Moving-camel-extra-to-github-tt5764066.html
> > > > > > > [2]
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://camel.465427.n5.nabble.com/PROPOSAL-camel-extra-moves-forward-tt5765822.html
> > > > > > > [3]
> > > > > > >
> > > > >
> > >
> http://www.apache.org/foundation/mailinglists.html#foundation-community
> > > > > > >
> > > > > > >
> > > > > > > On Wed, 19 Aug 2015 at 18:53 Tim Dudgeon <
> tdudgeon...@gmail.com>
> > > > > wrote:
> > > > > > >
> > > > > > >> Now that the Google code site is about to switch to read only
> > > > > > >> (https://code.google.com/a/apache-extras.org/p/camel-extra/)
> I
> > > > > wondered
> > > > > > >> what is going to happen to the Camel Extras stuff?
> > > > > > >>
> > > > > > >> Tim
> > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> --
> Henryk Konsek
> http://about.me/hekonsek
>


Re: what's happening to camel extra?

2015-09-03 Thread Pontus Ullgren
Have not seen any other updates on the comdev mailing list no.

Perhaps we should reach out to Daniel Gruno (that seems to be in charge of
the move) to get a status update for camel-extra.

// Pontus

On Wed, 2 Sep 2015 at 23:57 Raul Kripalani  wrote:

> Hey guys,
>
> Do we have an update on the ASF front about the Apache Extras migration?
> Users are asking for new releases of camel-extras components...
>
> I quickly went through the ComDev thread but found no conclusion. Maybe I
> overlooked an email in that thread. Things tend to get very chatty over
> there and there's no clearly marked conclusion email.
>
> Regards,
>
> *Raúl Kripalani*
> Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
> Integration specialist
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>
> On Fri, Aug 21, 2015 at 8:56 AM, Pontus Ullgren  wrote:
>
> > From this thread[1]  it seems that Daniel Gruno is the one in charge for
> > the move.
> > However I fail to find any indication on the progress or roadmap.
> > Using Github as a backup plan does NOT[2] seem to be a option in the
> > opinion of the community-dev decision.
> > Anyway perhaps we should move this discussion to the camel-dev
> mailinglist.
> >
> > [1]
> >
> >
> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3C559EC097.7000707%40apache.org%3E
> > [2]
> >
> >
> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3cby2pr03mb490b6943e12f5d925203a2e99...@by2pr03mb490.namprd03.prod.outlook.com%3E
> >
> > // Pontus
> >
> > On Fri, 21 Aug 2015 at 07:17 Christoph Emmersberger 
> > wrote:
> >
> > > Is there any date when this move is expected? We have still the backup
> > plan
> > > with Github in place, ...
> > >
> > > On Thu, Aug 20, 2015 at 6:54 AM, Pontus Ullgren 
> > wrote:
> > >
> > > > Diging through the community development list shows that it will be
> > moved
> > > > to sourceforge along with the rest of the apache extra.
> > > >
> > > >
> > > >
> > >
> >
> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/browser
> > > >
> > > > On Thu, 20 Aug 2015 14:12 Pontus Ullgren  wrote:
> > > >
> > > > >
> > > > > Yes this has been discussed on the dev list[1][2] and the Apache
> > > > community
> > > > > development mailing list [2].
> > > > >
> > > > > Unfortuantly there does not seem to be any conclusion on this
> > > discussion
> > > > > yet.
> > > > >
> > > > > // Pontus
> > > > >
> > > > > [1]
> > > > >
> > > >
> > >
> >
> http://camel.465427.n5.nabble.com/Moving-camel-extra-to-github-tt5764066.html
> > > > > [2]
> > > > >
> > > >
> > >
> >
> http://camel.465427.n5.nabble.com/PROPOSAL-camel-extra-moves-forward-tt5765822.html
> > > > > [3]
> > > > >
> > >
> http://www.apache.org/foundation/mailinglists.html#foundation-community
> > > > >
> > > > >
> > > > > On Wed, 19 Aug 2015 at 18:53 Tim Dudgeon 
> > > wrote:
> > > > >
> > > > >> Now that the Google code site is about to switch to read only
> > > > >> (https://code.google.com/a/apache-extras.org/p/camel-extra/) I
> > > wondered
> > > > >> what is going to happen to the Camel Extras stuff?
> > > > >>
> > > > >> Tim
> > > > >>
> > > > >
> > > >
> > >
> >
>


Re: what's happening to camel extra?

2015-08-21 Thread Pontus Ullgren
>From this thread[1]  it seems that Daniel Gruno is the one in charge for
the move.
However I fail to find any indication on the progress or roadmap.
Using Github as a backup plan does NOT[2] seem to be a option in the
opinion of the community-dev decision.
Anyway perhaps we should move this discussion to the camel-dev mailinglist.

[1]
https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3C559EC097.7000707%40apache.org%3E
[2]
https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/%3cby2pr03mb490b6943e12f5d925203a2e99...@by2pr03mb490.namprd03.prod.outlook.com%3E

// Pontus

On Fri, 21 Aug 2015 at 07:17 Christoph Emmersberger 
wrote:

> Is there any date when this move is expected? We have still the backup plan
> with Github in place, ...
>
> On Thu, Aug 20, 2015 at 6:54 AM, Pontus Ullgren  wrote:
>
> > Diging through the community development list shows that it will be moved
> > to sourceforge along with the rest of the apache extra.
> >
> >
> >
> https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/browser
> >
> > On Thu, 20 Aug 2015 14:12 Pontus Ullgren  wrote:
> >
> > >
> > > Yes this has been discussed on the dev list[1][2] and the Apache
> > community
> > > development mailing list [2].
> > >
> > > Unfortuantly there does not seem to be any conclusion on this
> discussion
> > > yet.
> > >
> > > // Pontus
> > >
> > > [1]
> > >
> >
> http://camel.465427.n5.nabble.com/Moving-camel-extra-to-github-tt5764066.html
> > > [2]
> > >
> >
> http://camel.465427.n5.nabble.com/PROPOSAL-camel-extra-moves-forward-tt5765822.html
> > > [3]
> > >
> http://www.apache.org/foundation/mailinglists.html#foundation-community
> > >
> > >
> > > On Wed, 19 Aug 2015 at 18:53 Tim Dudgeon 
> wrote:
> > >
> > >> Now that the Google code site is about to switch to read only
> > >> (https://code.google.com/a/apache-extras.org/p/camel-extra/) I
> wondered
> > >> what is going to happen to the Camel Extras stuff?
> > >>
> > >> Tim
> > >>
> > >
> >
>


Re: what's happening to camel extra?

2015-08-20 Thread Pontus Ullgren
Diging through the community development list shows that it will be moved
to sourceforge along with the rest of the apache extra.

https://mail-archives.apache.org/mod_mbox/community-dev//201507.mbox/browser

On Thu, 20 Aug 2015 14:12 Pontus Ullgren  wrote:

>
> Yes this has been discussed on the dev list[1][2] and the Apache community
> development mailing list [2].
>
> Unfortuantly there does not seem to be any conclusion on this discussion
> yet.
>
> // Pontus
>
> [1]
> http://camel.465427.n5.nabble.com/Moving-camel-extra-to-github-tt5764066.html
> [2]
> http://camel.465427.n5.nabble.com/PROPOSAL-camel-extra-moves-forward-tt5765822.html
> [3]
> http://www.apache.org/foundation/mailinglists.html#foundation-community
>
>
> On Wed, 19 Aug 2015 at 18:53 Tim Dudgeon  wrote:
>
>> Now that the Google code site is about to switch to read only
>> (https://code.google.com/a/apache-extras.org/p/camel-extra/) I wondered
>> what is going to happen to the Camel Extras stuff?
>>
>> Tim
>>
>


Re: what's happening to camel extra?

2015-08-20 Thread Pontus Ullgren
Yes this has been discussed on the dev list[1][2] and the Apache community
development mailing list [2].

Unfortuantly there does not seem to be any conclusion on this discussion
yet.

// Pontus

[1]
http://camel.465427.n5.nabble.com/Moving-camel-extra-to-github-tt5764066.html
[2]
http://camel.465427.n5.nabble.com/PROPOSAL-camel-extra-moves-forward-tt5765822.html
[3]  http://www.apache.org/foundation/mailinglists.html#foundation-community


On Wed, 19 Aug 2015 at 18:53 Tim Dudgeon  wrote:

> Now that the Google code site is about to switch to read only
> (https://code.google.com/a/apache-extras.org/p/camel-extra/) I wondered
> what is going to happen to the Camel Extras stuff?
>
> Tim
>


Re: Cannot use ${file:xx} in blueprint route / properties

2015-08-17 Thread Pontus Ullgren
Probably due to how escaping the backslash is handled when using property
placeholder.
Try adding additional backslash to escape the backslashes in the config
file.
So
example.endpoint = file:\\example.host.com

Also note that using the file component to access windows shares only work
when running on windows and the access will be done using the user the
camel process is running as.
This might lead to problems when running the application as a service as
oppose to when you run it as your self during development.

Perhaps you should take a look at the camel-jcifs component in the
camel-extra project.
https://camel.apache.org/jcifs.html

Best regards
Pontus

On Mon, 17 Aug 2015 at 16:06 rwijngaa 
wrote:

> On a related note (an maybe blueprint related)
>
> example.endpoint = file:example.host.com
>
> 
> => Does not work: creates folder in root of c:\  named example.host.com
> and
> reads from that
>
> 
> => Works / reads from windows share example.host.com
>
>
> Any ideas on this? Should i try spring based routes here or is this sort of
> property usage
> not supported?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Cannot-use-file-xx-in-blueprint-route-properties-tp5770764p5770770.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Sending abort() to a httpclient

2015-07-01 Thread Pontus Ullgren
I guess you could create you own clientConnectionManager (see the option on
the HTTP/HTTP4 component documentation) that returns a decorated HTTP
client that, when execute is called, creates the timer and starts it.
Or do some other more fancy handling to avoid having to start another
thread for each request.

Best regards
Pontus

On Wed, 1 Jul 2015 13:07 Henrik Brautaset Aronsen  wrote:

> I can control the httpclient connection and socket timeouts by adding query
> parameters to the URL delivered in ProcessorDefinition.to(), e.g. "
>
> http://example.com/stuff?httpClient.connectTimeout=1000&httpClient.socketTimeout=5000
> "
>
> I'd like to have an hard overall time limit on the request, though.
> HttpClient doesn't support that as an argument, but it has an abort() call
> that can be used like this:
>
> DefaultHttpClient httpClient = new DefaultHttpClient();
> HttpGet getMethod = new HttpGet("http://example.com/stuff";);
> TimerTask task = new TimerTask() {
> @Override
> public void run() {
> if (getMethod != null) {
> getMethod.abort();
> }
> }
> };
> new Timer(true).schedule(task, 5000);
> HttpResponse response = httpClient.execute(getMethod);
>
> How can I achieve the same in a Camel route?
>
> Cheers,
> Henrik
>


Re: Jackson JSON Dataformat can not unmarshal what it has marshaled

2015-06-05 Thread Pontus Ullgren
A small update. When using the xstream library it successfully unmarshal the
json. However the resulting List is a List of Map, each containing one
element with the class name as key, and not a List or POJOs as one might
expect.


On Fri, 5 Jun 2015 at 21:26 Pontus Ullgren  wrote:

> Hello again,
>
> Tried adding FAIL_ON_UNKNOWN_PROPERTIES to the object mapper but it did
> not help.
> I also tried with the gson datamapper with the same result.
>
> What I find strange is that the datamappers can not unmarshal the json
> they have them self created. :-/
> Apart from that the fact that marshaling a list adds the class name to
> the json.
> This makes the resulting json very tightly coupled to the implementation.
>
> On Wed, 3 Jun 2015 at 12:16 Pontus Ullgren  wrote:
>
>> Thanks I will try this.
>>
>> However I'm still a bit surprised over the way that the unmarshal add the
>> full name of the POJO class to the JSON.
>> Not very convenient when sending data to a external system where I do not
>> have any control over the logic.
>>
>> Not sure if this is an issue only when  useList="true" or if unmarshaling
>> a separate POJO will also add this data.
>>
>>
>> // Pontus
>>
>> On Wed, 3 Jun 2015 at 10:28 Henryk Konsek  wrote:
>>
>>> Hi,
>>>
>>> IMHO We should ignore unknown fields in Jackson by default:
>>>
>>>
>>> objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,
>>> false);
>>>
>>> This is the essential option for Jackson, as JSON is usually not as
>>> strict
>>> as XML. I would say that we should add failOnUnknownProperties options to
>>> Jackson data format and default it to 'false'. What do you think?
>>>
>>> Cheers!
>>>
>>> PS Pontus, you can set the option on the object mapper by yourself as a
>>> workaround.
>>>
>>> wt., 2.06.2015 o 22:32 użytkownik Pontus Ullgren 
>>> napisał:
>>>
>>> > Hi,
>>> >
>>> > I'm trying to build a solution when I marshal POJO into JSON and send
>>> over
>>> > JMS to a remote machine. On the remote machine message is also
>>> consumed by
>>> > a Camel route.
>>> >
>>> > However the JSON on the remote machine is unable to marshal the JSON
>>> that
>>> > the dataformater created.
>>> >
>>> > To show the error I created a smaller POC where I use a SEDA within the
>>> > same camel context and it shows the same error.
>>> > Here is the test project https://bitbucket.org/ullgren/jsonmarshaltest
>>> >
>>> > It seems that the unmarshal does not like the fact that the POJO class
>>> name
>>> > is added as a field. Is there anyway to change this behaviour,
>>> >
>>> > The error I get is:
>>> >
>>> > [/jsonmarshaltest.sendToBackend] SedaConsumer   WARN
>>> Error
>>> > processing exchange. Exchange[Message:
>>> >
>>> [{"com.ullgren.pontus.example.model.Order":{"id":"1","customerName":"Joe
>>> > Doe","customerEmail":"joe@acme.com
>>> >
>>> ","productNo":"ABC123","amount":"10","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"2","customerName":"Elmer
>>> > Fudd","customerEmail":"elmer.f...@acme.com
>>> >
>>> ","productNo":"GUN12G","amount":"2","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"3","customerName":"Porky
>>> > Pig","customerEmail":"porky@acme.com
>>> >
>>> ","productNo":"STU3","amount":"8","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"4","customerName":"Foghorn
>>> > J. Leghorn","customerEmail":"legh...@acme.com
>>> > ","productNo":"CORN961","amount":"10","dispatched":false}},{"
>>> com.ullgren.pontus.example.model.Order":{"id":"5","customerName":"Wile
>>> > E. Coyote","customerEmail&qu

Re: Jackson JSON Dataformat can not unmarshal what it has marshaled

2015-06-05 Thread Pontus Ullgren
Hello again,

Tried adding FAIL_ON_UNKNOWN_PROPERTIES to the object mapper but it did not
help.
I also tried with the gson datamapper with the same result.

What I find strange is that the datamappers can not unmarshal the json they
have them self created. :-/
Apart from that the fact that marshaling a list adds the class name to the
json.
This makes the resulting json very tightly coupled to the implementation.

On Wed, 3 Jun 2015 at 12:16 Pontus Ullgren  wrote:

> Thanks I will try this.
>
> However I'm still a bit surprised over the way that the unmarshal add the
> full name of the POJO class to the JSON.
> Not very convenient when sending data to a external system where I do not
> have any control over the logic.
>
> Not sure if this is an issue only when  useList="true" or if unmarshaling
> a separate POJO will also add this data.
>
>
> // Pontus
>
> On Wed, 3 Jun 2015 at 10:28 Henryk Konsek  wrote:
>
>> Hi,
>>
>> IMHO We should ignore unknown fields in Jackson by default:
>>
>>
>> objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,
>> false);
>>
>> This is the essential option for Jackson, as JSON is usually not as strict
>> as XML. I would say that we should add failOnUnknownProperties options to
>> Jackson data format and default it to 'false'. What do you think?
>>
>> Cheers!
>>
>> PS Pontus, you can set the option on the object mapper by yourself as a
>> workaround.
>>
>> wt., 2.06.2015 o 22:32 użytkownik Pontus Ullgren 
>> napisał:
>>
>> > Hi,
>> >
>> > I'm trying to build a solution when I marshal POJO into JSON and send
>> over
>> > JMS to a remote machine. On the remote machine message is also consumed
>> by
>> > a Camel route.
>> >
>> > However the JSON on the remote machine is unable to marshal the JSON
>> that
>> > the dataformater created.
>> >
>> > To show the error I created a smaller POC where I use a SEDA within the
>> > same camel context and it shows the same error.
>> > Here is the test project https://bitbucket.org/ullgren/jsonmarshaltest
>> >
>> > It seems that the unmarshal does not like the fact that the POJO class
>> name
>> > is added as a field. Is there anyway to change this behaviour,
>> >
>> > The error I get is:
>> >
>> > [/jsonmarshaltest.sendToBackend] SedaConsumer   WARN
>> Error
>> > processing exchange. Exchange[Message:
>> > [{"com.ullgren.pontus.example.model.Order":{"id":"1","customerName":"Joe
>> > Doe","customerEmail":"joe@acme.com
>> >
>> ","productNo":"ABC123","amount":"10","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"2","customerName":"Elmer
>> > Fudd","customerEmail":"elmer.f...@acme.com
>> >
>> ","productNo":"GUN12G","amount":"2","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"3","customerName":"Porky
>> > Pig","customerEmail":"porky@acme.com
>> >
>> ","productNo":"STU3","amount":"8","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"4","customerName":"Foghorn
>> > J. Leghorn","customerEmail":"legh...@acme.com
>> >
>> ","productNo":"CORN961","amount":"10","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"5","customerName":"Wile
>> > E. Coyote","customerEmail":"wile.coy...@acme.com
>> > ","productNo":"BOM44","amount":"100","dispatched":false}}]].
>> > Caused by:
>> > [com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException -
>> > Unrecognized field "com.ullgren.pontus.example.model.Order" (class
>> > com.ullgren.pontus.example.model.Order), not marked as ignorable (6
>> known
>> > properties: "productNo", "amount", "customerName", "dispatched", "id",
>> > "customerEmail"])
>> >  at [Source: java.io.ByteArrayInputStream@506208e4; line: 1, column:
>> 45]
>

Re: Jackson JSON Dataformat can not unmarshal what it has marshaled

2015-06-03 Thread Pontus Ullgren
Thanks I will try this.

However I'm still a bit surprised over the way that the unmarshal add the
full name of the POJO class to the JSON.
Not very convenient when sending data to a external system where I do not
have any control over the logic.

Not sure if this is an issue only when  useList="true" or if unmarshaling a
separate POJO will also add this data.


// Pontus

On Wed, 3 Jun 2015 at 10:28 Henryk Konsek  wrote:

> Hi,
>
> IMHO We should ignore unknown fields in Jackson by default:
>
>   objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,
> false);
>
> This is the essential option for Jackson, as JSON is usually not as strict
> as XML. I would say that we should add failOnUnknownProperties options to
> Jackson data format and default it to 'false'. What do you think?
>
> Cheers!
>
> PS Pontus, you can set the option on the object mapper by yourself as a
> workaround.
>
> wt., 2.06.2015 o 22:32 użytkownik Pontus Ullgren 
> napisał:
>
> > Hi,
> >
> > I'm trying to build a solution when I marshal POJO into JSON and send
> over
> > JMS to a remote machine. On the remote machine message is also consumed
> by
> > a Camel route.
> >
> > However the JSON on the remote machine is unable to marshal the JSON that
> > the dataformater created.
> >
> > To show the error I created a smaller POC where I use a SEDA within the
> > same camel context and it shows the same error.
> > Here is the test project https://bitbucket.org/ullgren/jsonmarshaltest
> >
> > It seems that the unmarshal does not like the fact that the POJO class
> name
> > is added as a field. Is there anyway to change this behaviour,
> >
> > The error I get is:
> >
> > [/jsonmarshaltest.sendToBackend] SedaConsumer   WARN
> Error
> > processing exchange. Exchange[Message:
> > [{"com.ullgren.pontus.example.model.Order":{"id":"1","customerName":"Joe
> > Doe","customerEmail":"joe@acme.com
> >
> ","productNo":"ABC123","amount":"10","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"2","customerName":"Elmer
> > Fudd","customerEmail":"elmer.f...@acme.com
> >
> ","productNo":"GUN12G","amount":"2","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"3","customerName":"Porky
> > Pig","customerEmail":"porky@acme.com
> >
> ","productNo":"STU3","amount":"8","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"4","customerName":"Foghorn
> > J. Leghorn","customerEmail":"legh...@acme.com
> >
> ","productNo":"CORN961","amount":"10","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"5","customerName":"Wile
> > E. Coyote","customerEmail":"wile.coy...@acme.com
> > ","productNo":"BOM44","amount":"100","dispatched":false}}]].
> > Caused by:
> > [com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException -
> > Unrecognized field "com.ullgren.pontus.example.model.Order" (class
> > com.ullgren.pontus.example.model.Order), not marked as ignorable (6 known
> > properties: "productNo", "amount", "customerName", "dispatched", "id",
> > "customerEmail"])
> >  at [Source: java.io.ByteArrayInputStream@506208e4; line: 1, column: 45]
> > (through reference chain:
> >
> >
> com.ullgren.pontus.example.model.Order["com.ullgren.pontus.example.model.Order"])]
> > com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
> > Unrecognized field "com.ullgren.pontus.example.model.Order" (class
> > com.ullgren.pontus.example.model.Order), not marked as ignorable (6 known
> > properties: "productNo", "amount", "customerName", "dispatched", "id",
> > "customerEmail"])
> >  at [Source: java.io.ByteArrayInputStream@506208e4; line: 1, column: 45]
> > (through reference chain:
> >
> >
> com.ullgren.pontus.example.model.Order["com.ullgren.pontus.example.model.Order"])
> > at
> >
&g

Re: Can simple() be made to compare strings in a case insensitive way?

2015-06-02 Thread Pontus Ullgren
I would rather see a new operator than changing the behaviour of ==


On Tue, 2 Jun 2015 at 09:44 Claus Ibsen  wrote:

> Hi
>
> Yeah I am not sure if end users would be surprised if we change == to
> be case insensitive for strings?
>
> Or we could consider having =~ as an alternative comparison operator
> (although =~ may not be though as insensitive operator?)
>
> If we have a new operator or change the default behavior it would have
> the performance benefit to avoid the reflection method invocation that
> a .toLowerCase() would require.
>
>
> Any thoughts in the community ?
>
>
>
>
> On Mon, Jun 1, 2015 at 7:52 PM, s.marjanovic
>  wrote:
> > Hello Andrew,
> >
> > I managed to find the same information as you posted in the example,
> > although without the "?" part.
> >
> > Great tip about that, thanks.
> >
> > Regards,
> > Slavisa
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Can-simple-be-made-to-compare-strings-in-a-case-insensitive-way-tp5767732p5767756.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/
>


Jackson JSON Dataformat can not unmarshal what it has marshaled

2015-06-02 Thread Pontus Ullgren
Hi,

I'm trying to build a solution when I marshal POJO into JSON and send over
JMS to a remote machine. On the remote machine message is also consumed by
a Camel route.

However the JSON on the remote machine is unable to marshal the JSON that
the dataformater created.

To show the error I created a smaller POC where I use a SEDA within the
same camel context and it shows the same error.
Here is the test project https://bitbucket.org/ullgren/jsonmarshaltest

It seems that the unmarshal does not like the fact that the POJO class name
is added as a field. Is there anyway to change this behaviour,

The error I get is:

[/jsonmarshaltest.sendToBackend] SedaConsumer   WARN  Error
processing exchange. Exchange[Message:
[{"com.ullgren.pontus.example.model.Order":{"id":"1","customerName":"Joe
Doe","customerEmail":"joe@acme.com","productNo":"ABC123","amount":"10","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"2","customerName":"Elmer
Fudd","customerEmail":"elmer.f...@acme.com","productNo":"GUN12G","amount":"2","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"3","customerName":"Porky
Pig","customerEmail":"porky@acme.com","productNo":"STU3","amount":"8","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"4","customerName":"Foghorn
J. 
Leghorn","customerEmail":"legh...@acme.com","productNo":"CORN961","amount":"10","dispatched":false}},{"com.ullgren.pontus.example.model.Order":{"id":"5","customerName":"Wile
E. 
Coyote","customerEmail":"wile.coy...@acme.com","productNo":"BOM44","amount":"100","dispatched":false}}]].
Caused by:
[com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException -
Unrecognized field "com.ullgren.pontus.example.model.Order" (class
com.ullgren.pontus.example.model.Order), not marked as ignorable (6 known
properties: "productNo", "amount", "customerName", "dispatched", "id",
"customerEmail"])
 at [Source: java.io.ByteArrayInputStream@506208e4; line: 1, column: 45]
(through reference chain:
com.ullgren.pontus.example.model.Order["com.ullgren.pontus.example.model.Order"])]
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
Unrecognized field "com.ullgren.pontus.example.model.Order" (class
com.ullgren.pontus.example.model.Order), not marked as ignorable (6 known
properties: "productNo", "amount", "customerName", "dispatched", "id",
"customerEmail"])
 at [Source: java.io.ByteArrayInputStream@506208e4; line: 1, column: 45]
(through reference chain:
com.ullgren.pontus.example.model.Order["com.ullgren.pontus.example.model.Order"])
at
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51)
at
com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:731)
at
com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:915)
at
com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1292)
at
com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1270)
at
com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:247)
at
com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118)
at
com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:232)
at
com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:206)
at
com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:25)
at
com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3051)
at
com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2206)
at
org.apache.camel.component.jackson.JacksonDataFormat.unmarshal(JacksonDataFormat.java:126)
at
org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:67)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:424)
at
org.apache.

Re: What is the best way to implement "RunLevel" equivalent functionality with camel.

2015-05-27 Thread Pontus Ullgren
I agree with you Claus. In our special case we used the extra meta data to
be able to start and stop all routes belonging to the same group when a new
definition, version, is published.

But as you say since the logic depends on very specific use cases I do not
see any real reason for adding this to the dsl. As it is very easy to
achieve using the existing public api.

For the original run level request one might simply add a run level
property to the route, using a custom route policy, and then loop through
all routes and start them in the correct order.

Or, as already been mentioned, use the depends on feature.

On Wed, 27 May 2015 14:45 Claus Ibsen  wrote:

> Hi
>
> There is no official way. Well all is the official way if using the public
> api.
>
> Storing those kind of meta-data hasn't been requested much in the
> community and therefore hasn't been exposed in the DSL. We tend to
> avoid adding to much to the DSL, unless its useable and needed by
> average use-cases.
>
> Most people just need to provide a id of the route and an optional
> description. Also those meta-data are not integrated with other parts
> such as EIPs, et all so they wont be so useable.
>
> One meta-data that never was so much exposes was the idea of
> associating a group to routes. So you could do bulk operations on a
> group. Though that may require expose group level operations in JMX
> and Karaf commands and whatnot so they can easily be used from
> operations pov. Things  tend to further complicate a bit if eg
> starting a group, and then 1 route fails, what should happen then?
>
>
>
>
>
> On Wed, May 27, 2015 at 11:01 AM, Pontus Ullgren 
> wrote:
> > I'm sure this is not the way it was intended but I have in the past used
> a
> > custom RoutePolicy that includes the custom properties and attached this
> to
> > the route.
> > In the onInit(Route) method of this RoutePolicy we then set the
> properties
> > in the route.
> >
> > class FileRouteVersionPolicy extends RoutePolicySupport {
> > final String  group;
> > final Integer version;
> >
> > public FileRouteVersionPolicy(String group, Integer version) {
> > this.group = group;
> > this.version = version;
> > }
> >
> > @Override
> > public void onInit(Route route) {
> > route.getProperties().put("group", group);
> > route.getProperties().put("version", version);
> >
> > super.onInit(route);
> > }
> > }
> >
> > FileRouteVersionPolicy frvp = new FileRouteVersionPolicy();
> > frvp.put("someproperty", "value");
> >
> > from(input)
> >   .routeId("myroute")
> >   .routePolicy(frvp)
> >   .to("direct:dosomething");
> >
> > Then when you can get the route based on routeId and access the route
> > properties.
> >
> > Again I'm not sure that this is a officially supported way of doing
> things
> > but it seems to work in that application :-)
> >
> > // Pontus
> >
> > On Wed, 27 May 2015 at 07:31 Claus Ibsen  wrote:
> >
> >> Hi
> >>
> >> You can use .description to set a route description.
> >> But there is no key/value map that you can associate to a route.
> >>
> >> You could also look at startup order and assign 1xx for level 1, 2xx
> >> for level 2, etc.
> >>
> >>
> http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html
> >>
> >> On Tue, May 26, 2015 at 9:10 PM, Zoltan Farkas
> >>  wrote:
> >> > Thank you,
> >> >
> >> > is there a way to attach some metadata(attributes) to a camel route?
> >> >
> >> >
> >> > —Z
> >> >
> >> >
> >> >
> >> >> On May 26, 2015, at 3:48 AM, Henryk Konsek 
> wrote:
> >> >>
> >> >> Hi Zoltan,
> >> >>
> >> >> You can use splitter with conjunction with the Control Bus [1] to
> >> achieve
> >> >> this.
> >> >>
> >> >> from("direct:splitAndStart").
> >> >>  split().body().setHeader("routeId", body()
> >> >> ).to("controlbus:route?&action=start");
> >> >>
> >> >> from("direct:startLevel1").
> >> >>  setBody().constant(Arrays.asList("route1", "route2")).
> >> >>  to("direct:splitAndStart");
&g

Re: What is the best way to implement "RunLevel" equivalent functionality with camel.

2015-05-27 Thread Pontus Ullgren
I'm sure this is not the way it was intended but I have in the past used a
custom RoutePolicy that includes the custom properties and attached this to
the route.
In the onInit(Route) method of this RoutePolicy we then set the properties
in the route.

class FileRouteVersionPolicy extends RoutePolicySupport {
final String  group;
final Integer version;

public FileRouteVersionPolicy(String group, Integer version) {
this.group = group;
this.version = version;
}

@Override
public void onInit(Route route) {
route.getProperties().put("group", group);
route.getProperties().put("version", version);

super.onInit(route);
}
}

FileRouteVersionPolicy frvp = new FileRouteVersionPolicy();
frvp.put("someproperty", "value");

from(input)
  .routeId("myroute")
  .routePolicy(frvp)
  .to("direct:dosomething");

Then when you can get the route based on routeId and access the route
properties.

Again I'm not sure that this is a officially supported way of doing things
but it seems to work in that application :-)

// Pontus

On Wed, 27 May 2015 at 07:31 Claus Ibsen  wrote:

> Hi
>
> You can use .description to set a route description.
> But there is no key/value map that you can associate to a route.
>
> You could also look at startup order and assign 1xx for level 1, 2xx
> for level 2, etc.
>
> http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html
>
> On Tue, May 26, 2015 at 9:10 PM, Zoltan Farkas
>  wrote:
> > Thank you,
> >
> > is there a way to attach some metadata(attributes) to a camel route?
> >
> >
> > —Z
> >
> >
> >
> >> On May 26, 2015, at 3:48 AM, Henryk Konsek  wrote:
> >>
> >> Hi Zoltan,
> >>
> >> You can use splitter with conjunction with the Control Bus [1] to
> achieve
> >> this.
> >>
> >> from("direct:splitAndStart").
> >>  split().body().setHeader("routeId", body()
> >> ).to("controlbus:route?&action=start");
> >>
> >> from("direct:startLevel1").
> >>  setBody().constant(Arrays.asList("route1", "route2")).
> >>  to("direct:splitAndStart");
> >>
> >> from("direct:startLevel2").
> >>  to("direct:startLevel1").
> >>  setBody().constant(Arrays.asList("route3", "route4")).
> >>  to("direct:splitAndStart");
> >>
> >> Cheers!
> >>
> >> [1] http://camel.apache.org/controlbus.html
> >>
> >> wt., 26.05.2015 o 02:24 użytkownik Zoltan Farkas
> >>  napisał:
> >>
> >>> I want to be able in implement similar functionality like unix run
> levels
> >>> ..
> >>>
> >>> level 1 - start level 1 set of routes
> >>> level 2 - run all from level 1 + level 2 specific routes.
> >>> ...
> >>>
> >>> I want to be able to go from level 1 -> level 2 and vice versa.
> >>> (starting/stopping the necessary routes..)
> >>>
> >>> What would be the best way to implement this? Currently I am leaning
> >>> towards using different camel contexts for each level…
> >>>
> >>> Any help appreciated
> >>>
> >>> thank you
> >>>
> >>> —Z
> >
>
>
>
> --
> 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: route <-> XML <-> route

2015-05-26 Thread Pontus Ullgren
On Tue, 26 May 2015 at 18:10 Tim Dudgeon  wrote:

> On 26/05/2015 16:55, Pontus Ullgren wrote:
> > Depending on the registry you use you can create the beans in java and
> add
> > them to the registry in runtime before you add (and start) the route in
> the
> > context.
> Yes, that's what I figured. Its the exact mechanism for doing so that
> I'm trying to figure out.
>

Since the Camel Registry interface does not have any put/add/register
method you will need to know what registry you are using and use methods
specific to that implementation. So if you use
org.apache.camel.impl.SimpleRegistry you can do something like this.

SimpleRegistry myRegistry = (SimpleRegistry)camelContext.getRegistry();
myRegistry.put("myBeanName", new MyBean());

if you use a Spring and a SpringRouteBuilder to configure your routes you
can do something like this.
ConfigurableListableBeanFactory beanFactory =
((ConfigurableApplicationContext)getApplicationContext()).getBeanFactory();
MyBean bean = new MyBean();
beanFactory.autowireBean(bean);
beanFactory.initializeBean(bean, "myBeanName");
beanFactory.registerSingleton("myBeanName", bean);

There are probably similar ways of doing things with guice, CDI, JNDI,
YourOwnMagicRegistry


> > I have some example code on how to do this using a spring registry.
> However
> > since you say you are not using spring you will have to figure out how to
> > add the beans programmatically to the registry implementation you are
> > using.
> I'm not currently using spring, but I could do so if there was a good
> reason too.
> Performance is a key issue. I'm finding that creating a new Spring
> ApplicationContext including Camel from XML is fairly slow (about 1.3s),
> whilst creating a new Camel context directly in Java (no Spring) is
> quite a bit faster (about 0.3s) whilst adding a new route to a running
> context is superfast (about 0.01s), hence the preferred option.
>
> Tim
>
> >
> > Best regards
> > Pontus
> >
> > On Tue, 26 May 2015 16:28 Tim Dudgeon  wrote:
> >
> >> The beans are defined at runtime, so can't go in the spring xml that is
> >> used on startup (and I'm not actually using spring, though could do if
> >> essential).
> >> I need to provide the route definition plus any beans it uses at
> >> runtime, after the context has started.
> >>
> >> Tim
> >>
> >> On 26/05/2015 15:23, Claus Ibsen wrote:
> >>> Hi
> >>>
> >>> If you are using spring xml then the beans need to go in the spring
> >>> xml file as .
> >>>
> >>> You may be able to add those beans later using some spring java api.
> >>>
> >>> On Tue, May 26, 2015 at 2:21 PM, Tim Dudgeon 
> >> wrote:
> >>>> Sorry, not clear on this. Where does the  element go?
> >>>> The XML generated from the route looks like this:
> >>>>
> >>>> 
> >>>> http://camel.apache.org/schema/spring";>
> >>>> 
> >>>>   
> >>>>   
> >>>>   
> >>>> 
> >>>> 
> >>>>
> >>>>
> >>>> The  element would normally be part of the spring XML, but
> >> outside the
> >>>> routes definition looking something like this:
> >>>>
> >>>> 
> >>>> 
> >>>> 
> >>>>
> >>>> http://camel.apache.org/schema/spring";>
> >>>>   
> >>>> 
> >>>>   
> >>>> 
> >>>> 
> >>>>
> >>>> Can the beans be defined in this way at runtime or is some other
> >> mechanism
> >>>> needed to instantiate the beans and add them to the registry
> >> independently
> >>>> of adding the route (as XML)?
> >>>>
> >>>> Tim
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On 26/05/2015 08:19, Claus Ibsen wrote:
> >>>>> Hi
> >>>>>
> >>>>> Yeah 
> >>>>>
> >>>>> On Tue, May 26, 2015 at 9:02 AM, Tim Dudgeon 
> >>>>> wrote:
> >>>>>> Yes, but how to specify the bean that is referenced? Can that be
> >>>>>> specified
> >>>>>> in the XML using a bean element as if it was being using on startup,
> >> or
> >>>>>> does
> >>>>

Re: route <-> XML <-> route

2015-05-26 Thread Pontus Ullgren
Depending on the registry you use you can create the beans in java and add
them to the registry in runtime before you add (and start) the route in the
context.

I have some example code on how to do this using a spring registry. However
since you say you are not using spring you will have to figure out how to
add the beans programmatically to the registry implementation you are
using.

Best regards
Pontus

On Tue, 26 May 2015 16:28 Tim Dudgeon  wrote:

> The beans are defined at runtime, so can't go in the spring xml that is
> used on startup (and I'm not actually using spring, though could do if
> essential).
> I need to provide the route definition plus any beans it uses at
> runtime, after the context has started.
>
> Tim
>
> On 26/05/2015 15:23, Claus Ibsen wrote:
> > Hi
> >
> > If you are using spring xml then the beans need to go in the spring
> > xml file as .
> >
> > You may be able to add those beans later using some spring java api.
> >
> > On Tue, May 26, 2015 at 2:21 PM, Tim Dudgeon 
> wrote:
> >> Sorry, not clear on this. Where does the  element go?
> >> The XML generated from the route looks like this:
> >>
> >> 
> >> http://camel.apache.org/schema/spring";>
> >>
> >>  
> >>  
> >>  
> >> 
> >> 
> >>
> >>
> >> The  element would normally be part of the spring XML, but
> outside the
> >> routes definition looking something like this:
> >>
> >> 
> >> 
> >>
> >>
> >>http://camel.apache.org/schema/spring";>
> >>  
> >>
> >>  
> >>
> >> 
> >>
> >> Can the beans be defined in this way at runtime or is some other
> mechanism
> >> needed to instantiate the beans and add them to the registry
> independently
> >> of adding the route (as XML)?
> >>
> >> Tim
> >>
> >>
> >>
> >>
> >> On 26/05/2015 08:19, Claus Ibsen wrote:
> >>> Hi
> >>>
> >>> Yeah 
> >>>
> >>> On Tue, May 26, 2015 at 9:02 AM, Tim Dudgeon 
> >>> wrote:
>  Yes, but how to specify the bean that is referenced? Can that be
>  specified
>  in the XML using a bean element as if it was being using on startup,
> or
>  does
>  it need to be added to the registry "manually"?
> 
>  Tim
> 
> 
>  On 26/05/2015 07:49, Claus Ibsen wrote:
> > On Mon, May 25, 2015 at 3:01 PM, Tim Dudgeon 
> > wrote:
> >> Hi,
> >>
> >> I'm wanting some guidance on how to generate a route definition
> using
> >> the
> >> API in a way that allows it to be converted to XML and then
> executed.
> >> I've
> >> got the basics sorted, but struggling on how to handle processors
> and
> >> beans.
> >> For instance, if I generate a route like this:
> >>
> >> // generate the route
> >> RoutesDefinition routes1 = new RoutesDefinition()
> >> RouteDefinition route = routes1.route()
> >> route.from("timer://foo?fixedRate=true&period=200")
> >> route.log("Hello World!")
> >> route.process(new SimpleProcessor())
> >>
> >> // set route to context
> >> CamelContext camelContext = new DefaultCamelContext()
> >> camelContext.start()
> >> camelContext.addRouteDefinitions(routes1.getRoutes())
> >>
> >> Then the route works fine (e.g. my SimpleProcessor gets called as
> >> expected).
> >> But if I generate the XML definition of the route it looks like
> this:
> >>
> >> 
> >> http://camel.apache.org/schema/spring";>
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >>
> >> e.g. the processor definition has been lost.
> >> I suspect I need to register the processor bean with the registry
> and
> >> use
> >> the processRef() method on the route, or something along those
> lines.
> >> Does anyone have any examples of how to handle this?
> >>
> > Yes for representing this as xml, you would need to use a ref for the
> > processor
> >
> >
> >
> >> Thanks
> >> Tim
> >
> >
> >>>
> >
> >
>
>


Re: How to wiretap without consuming the original queue

2015-05-20 Thread Pontus Ullgren
For your use case camel is not the right tool. The camel jms component will
be a consumer consuming messages from the queue and process them as camle
exchanges.

The camel wiretap is for wiretapping camel exchanges in a camel route to
some other endpoint.

Take Claus advice and look at the features avail in activemq.

Best regards
Pontus Ullgren

On Wed, 20 May 2015 14:37 Jonasty  wrote:

> The only helpful are questions that I posted by myself...
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-wiretap-without-consuming-the-original-queue-tp5767253p5767324.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Handle white space - JSON to XML using XMLJSON component

2015-05-14 Thread Pontus Ullgren
The xmljson component is using json-lib[1] to do the actual work. Check the
documentation for that project or put a question in there forum if there is
some configuration that can be set to properly handle whitespaces.

[1] http://json-lib.sourceforge.net/

On Thu, 14 May 2015 08:48 Gnanaguru S  wrote:

> Well, I understand your point. But any valid string is a valid JSON key.
>
> We cant blame the JSON payload at this point :(
>
> So any ideas ? Or best way to handle these kind of scenarios ?
>
> Cheers
> Guru
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Handle-white-space-JSON-to-XML-using-XMLJSON-component-tp5767042p5767084.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: How to route the file like lst_20140427.tar.gz if the lst_20140427.done file exists

2015-03-12 Thread Pontus Ullgren
I think something like this should work

from("file:bar?doneFileName=${file:onlyname.noext}.done");

Have a look at the  File Expression Language[1] documentation.

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

// Pontus

On Thu, Mar 12, 2015 at 12:53 PM, skasish  wrote:
> I have to route file with the pattern
> lst_20140427.tar.gz if the lst_20140427.done file exists
>
> How to define a camel route with doneFileName ??
>
> Please help me.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-route-the-file-like-lst-20140427-tar-gz-if-the-lst-20140427-done-file-exists-tp5764034.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: direct endpoint across camel context

2014-12-31 Thread Pontus Ullgren
I would suggest that you take a look at the direct-vm component.
http://camel.apache.org/direct-vm.html

Best regards
Pontus
On 31 Dec 2014 14:49, "leofprince"  wrote:

> Dear Camel Users,
>
> We have a couple of camel contexts and have a scenario where we need to
> invoke a synchronous call to a route in different camel context. We have
> used direct endpoint for synchronous call within same camel context ,we
> would like to have same behavior for different camel contexts.
>
> Just needed your advice on the same.
>
> Thanks,
> Leo.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/direct-endpoint-across-camel-context-tp5761200.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Issue in publishTopicName in mqtt component

2014-12-21 Thread Pontus Ullgren
Just tested this usecase and I can indeed recreate it with the Camel 2.14.1.
Have you opened a Jira for this issue already if not I can create one
with a test case showing the issue.

As a workaround you can add split the route into two with a seda queue
between them.












On Thu, Dec 11, 2014 at 7:19 AM, Jinesh M.K  wrote:
> Hi,
>
> I have a spring DSL route definition
>
> 
>  uri="mqtt:foo?host=tcp://myhost:1883&subscribeTopicName=test/hello" />
>  uri="mqtt:bar?host=tcp:/myhost:1883&publishTopicName=test1/test" />
> 
> 
>
> here message is consumed from test/hello topic and publishing is happen in
> the same consumed topic (publishTopicName is ignored). How to solve it?
>
> Thanks
> --
>
> Jinesh M.K


Re: host multiple environment from same installation

2014-11-21 Thread Pontus Ullgren
No but for camel running in tomcat this should work.
Which is what I think you asked for ?

// Pontus

On Fri, Nov 21, 2014 at 1:15 PM, arno noordover  wrote:
> Pontus,
>
> We use mule-standalone-3.5.0, so I suppose we don't have a servletContext.
>
> Arno
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/host-multiple-environment-from-same-installation-tp5759379p5759442.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: host multiple environment from same installation

2014-11-21 Thread Pontus Ullgren
Would be easier to help if you describe what runtime and DSL you
was/are using for Camel (and Mule).

If your using a servlet container deploying your integration
applications as WAR filer and use Spring DSL then you can use this
simple trick 
(http://stackoverflow.com/questions/4221974/external-config-based-on-context-path).

So simply add this to your beans definition and it will load
properties files from /etc/ based on context path of the war.



Since Mule is Spring based you can do the same there (provided you
deploy those apps as WAR and do not use the Mule ESB runtime).

// Pontus

On Fri, Nov 21, 2014 at 7:12 AM, Claus Ibsen  wrote:
> Hi
>
> Do you want to keep the configuration external to the deployed
> artifact (eg WAR)?
> And the only thing you do is copying the WAR with a new name, and then
> deploy that in Tomcat.
> You are not including the configuration inside the WAR file?
>
> You would need some kind of servlet init code that figures out the
> context-path or name of the WAR and then use that to load the
> configuration / or set some system property that are used for knowing
> where the external configuration files are etc.
>
> Or some known file that has a mapping where you add a line when you
> deploy a new artifact, and the new line then directs where the
> configuration is for that new deployment.
>
> You can also use ENV or JVM system properties but the ENV cannot
> easily be changed when a JVM has started up. But a JVM system property
> can be reconfigured, but that requires Java code to do so etc.
>
>
>
> And btw shame on the Mule change, as the donkeys are much less
> powerful as Camels when it comes to animals.
> http://camel.apache.org/why-the-name-camel.html
>
>
>
> On Thu, Nov 20, 2014 at 7:43 PM, arno noordover  wrote:
>> We are in the proces of deciding what "ESB" implementation to use.
>> Previously we used Camel. Currently we are experimenting with Mule (not my
>> choice ).
>> Apparently the bussiness wants to use one "ESB" installation to support
>> multiple test environments while in production we only support one
>> environment.
>> A Mule-consultant is trying to implement something like "war"-name based. He
>> is trying to implement the loading of properties using the name of the
>> deployment.
>> With this strategy we can copy the deployment, rename it and have a separate
>> configuration for this second deployment.
>>
>> How would you solve this using the camel/fuse/hawtio/zookeeper stack?
>> So, the requirements are:
>> - one server;
>> - one instance of e.g. tomcat;
>> - multiple deployments on this tomcat server of the same artifact (maybe
>> renamed)
>> - configuration per deployed artifact
>>
>> It isn't needed to describe everything but naming the tools that should be
>> use is helpfull.
>>
>> Thanks,
>> Arno Noordover
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/host-multiple-environment-from-same-installation-tp5759379.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: New to Camel, adding smtp completion notification using XML DSL

2014-11-14 Thread Pontus Ullgren
Hi,

Simply set the body to the content you want in the email.
Something like this (pseudo code that is not tested) should do it


File ${in.header.CamelFileName} has been processed


// Pontus

On Thu, Nov 13, 2014 at 4:29 PM, fidoedidoe  wrote:
> Hi I'm new to camel (so forgive me for asking dumb question). Having worked a
> few examples and successfully created some test routes - I'd like to email
> recipient(s) on completion. Ultimately the intent would  be to email success
> / failure...but taking baby steps, just an email at the end of processing
> would be enough for me to expand my understanding.
>
> In my real code (not the pseudo below) I've successfully received an email
> *but* I cannot understand how to override the email body (currently it's the
> content of the message processed by direct:start - in my instance a zip
> file).
>
> I've experimented with  (to transform the message/body before
> emailing) but that didn't appear to work.
>
> Any suggestions?!
>
> Kind regards
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/New-to-Camel-adding-smtp-completion-notification-using-XML-DSL-tp5759060.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel SQL component - Insert Operation

2014-11-13 Thread Pontus Ullgren
According to the documentation the syntax should be ":#data" so it
looks like you have switched places on the : and #

On Fri, Nov 14, 2014 at 3:49 AM, contactreji  wrote:
> Hi
>
> I am trying to insert a record into the camel database. I have no errors
> when I hard code the value like **
>
>
> I was wondering  why I get following error when I have following camel
> Spring DSL line
>
> *
> Samson
> 
> *
>
> *
> org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback;
> bad SQL grammar [INSERT INTO testtable VALUES (?:data)]; nested exception is
> java.sql.SQLException: No value specified for parameter 1
> at
> org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:98)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
> at
> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
> at
> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
> at
> org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
> at
> org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
> at
> org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
> at
> org.apache.camel.component.sql.SqlProducer.process(SqlProducer.java:48)[camel-sql-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
>   

Re: JSch connection issue with Maverick SSHD server

2014-09-20 Thread Pontus Ullgren
Hi Keshav,

Looking at SftpOperations.java[1] it is obvious that both these
configuration parameters are set automatically when defining a
compression level above 0.

[1] 
https://github.com/apache/camel/blob/master/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java

// Pontus

On Sat, Sep 20, 2014 at 7:09 PM, Claus Ibsen  wrote:
> On Tue, Sep 16, 2014 at 1:06 PM, Baweja, Keshav
>  wrote:
>> Hello
>>
>> JSch has configuration parameters to set compression algorithm for client to 
>> server and server to client transport.
>>
>> compression.c2s
>> Compression algorithms for client-to-server transport. The default is 
>> "none", but this library also supports "zlib" and "z...@openssh.com". (Other 
>> compression algorithms can't be put in, it seems.)
>>
>> compression.s2c
>> Compression algorithms for server-to-client transport. The default is 
>> "none", but this library also supports "zlib" and "z...@openssh.com". (Other 
>> compression algorithms can't be put in, it seems.)
>>
>> Is it possible to set this configuration parameter in Options part of Camel 
>> URI?
>>
>> The only Option I could see on Camel's FTP2 page is below -
>> compression | Default Value = 0 | SFTP Only: Camel 2.8.3/2.9: To use 
>> compression. Specify a level from 1 to 10. Important: You must manually add 
>> the needed JSCH zlib JAR to the classpath for compression support.
>>
>>
>> Does setting this Camel option (with JSch zlib on classpath) automatically 
>> sets both these configuration parameters.
>>
>
> Did you find out about this? If not I suggest to dive into the source
> code of camel-ftp, eg the sftp classes and see what happens in the
> code.
>
>
>
>>
>>
>> Regards
>> Keshav
>>
>>
>> -Original Message-
>> From: Baweja, Keshav [mailto:keshav.baw...@jpmorgan.com.INVALID]
>> Sent: Monday, September 15, 2014 2:30 PM
>> To: users@camel.apache.org
>> Subject: RE: JSch connection issue with Maverick SSHD server
>>
>> Thanks for your reply Nodet,
>>
>> The sftp server is hosted externally and is outside our infrastructure. I 
>> can't make any changes to the server, and need to make client work with the 
>> server configuration.  Would you know how I can do it, found the below on 
>> Camel's ftp2 page and guess need to look at this -
>>
>> compression | Default Value = 0 | SFTP Only: Camel 2.8.3/2.9: To use 
>> compression. Specify a level from 1 to 10. Important: You must manually add 
>> the needed JSCH zlib JAR to the classpath for compression support.
>>
>> Regards
>> Keshav
>>
>>
>> -Original Message-
>> From: Guillaume Nodet [mailto:gno...@apache.org]
>> Sent: Monday, September 15, 2014 2:15 PM
>> To: users@camel.apache.org
>> Subject: Re: JSch connection issue with Maverick SSHD server
>>
>> Your server is configured with "zlib" compression only, while the client 
>> only supports compression "none", so there's a mismatch and both can't talk 
>> to each other.  You need to configure the server with both "zlib" *and* 
>> "none" compression factories.
>>
>> 2014-09-15 7:39 GMT+02:00 Baweja, Keshav >>:
>>
>>> Hello
>>>
>>> I am using Camel 2.13.2 in my application to build up routes to
>>> download files from sftp server locations. The codebase has been
>>> tested ok against 5 different sftp servers. However against one
>>> particular sftp server, JSch the sftp implementation used  by Camel
>>> seems to disconnect immediately after connecting. Could you please
>>> advise what could be the issue here. The log from application is as
>>> below -
>>>
>>> [2014-09-15 05:52:32.236] [Camel (camel-1) thread #0 -
>>> sftp://user@hostname:port/data] DEBUG
>>> org.apache.camel.component.file.remote.SftpOperations - Using private
>>> keyfile: /home/.ssh/id_rsa
>>> [2014-09-15 05:52:32.238] [Camel (camel-1) thread #0 -
>>> sftp://user@hostname:port/data] DEBUG
>>> org.apache.camel.component.file.remote.SftpOperations - Using
>>> knownhosts file: /home/.ssh/known_hosts
>>> [2014-09-15 05:52:32.329] [Camel (camel-1) thread #0 -
>>> sftp://user@hostname:port/data] DEBUG
>>> org.apache.camel.component.file.remote.SftpOperations - Using
>>> StrickHostKeyChecking: no
>>> [2014-09-15 05:52:32.329] [Camel (camel-1) thread #0 -
>>> sftp://user@hostname:port/data] INFO
>>> org.apache.camel.component.file.remote.SftpOperations - JSCH ->
>>> Connecting to hostname port port
>>> [2014-09-15 05:52:32.462] [Camel (camel-1) thread #0 -
>>> sftp://user@hostname:port/data] INFO
>>> org.apache.camel.component.file.remote.SftpOperations - JSCH ->
>>> Connection established
>>> [2014-09-15 05:52:32.589] [Camel (camel-1) thread #0 -
>>> sftp://user@hostname:port/data] INFO
>>> org.apache.camel.component.file.remote.SftpOperations - JSCH -> Remote
>>> version string: SSH-2.0-Maverick_SSHD
>>> [2014-09-15 05:52:32.589] [Camel (camel-1) thread #0 -
>>> sftp://user@hostname:port/data] INFO
>>> org.apache.camel.component.file.remote.SftpOperations - JSCH -> Local
>>> version string: SSH-2.0-JSCH-0.1.5

Re: Reading queunames from database to camelcontext.xml

2014-09-18 Thread Pontus Ullgren
You can use a custom processor or the content enrich[1] EIP to fetch
the queuename from the database and set the CamelJmsDestinationName
header.
There is a small example in the JMS component[2] documentation.

As an alternative you can populate a header (as above) and then use
the recipient list[3] EIP.

[1] http://camel.apache.org/content-enricher.html
[2] http://camel.apache.org/jms.html
[3] http://camel.apache.org/recipient-list.html

// Pontus

On Fri, Sep 19, 2014 at 8:27 AM, trilochan237
 wrote:
> Hi All,
>
>
> Is it possible to pass queuenames to camelcontext.xml file at runtime by
> fetching from database?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Reading-queunames-from-database-to-camelcontext-xml-tp5756730.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: I want to save the whole reply on disk an read the reply later ?

2014-09-09 Thread Pontus Ullgren
Hi

You can use camel cache ( http://camel.apache.org/cache.html) for this
purpose. Check example 8 in the documentation. However to be complete it
should also contain an otherwise where the cached value is read from the
cache.

//Pontus
On 9 Sep 2014 08:29, "Frankiboy"  wrote:

>
>
>
> Can someone give me a hint, where and what i schould look for solving this
> problem.
> I want to save the reply, and if the same request comes again, "can see it
> in header information", give the reply back i have saved on disk.
>
> Frank
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/I-want-to-save-the-whole-reply-on-disk-an-read-the-reply-later-tp5756223.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel configuration to pick up file from Shared location and remote file location

2014-06-17 Thread Pontus Ullgren
Hello,

I have in the past successfully used the file component to access a remote
windows share. However when doing so the share will be accessed by the user
that the camel process is running as. So that user needs permission to read
and write on the share. Also it only works when running the camel process
on another windows machinen.

Since the company I work for favour Linux based servers we created
camel-jcifs.

So it depends on your use case if you require camel-jcifs or not.

//Pontus
Den 17 jun 2014 07:57 skrev "sakchakravarthi" <
ajit.kalyan.chakravar...@gmail.com>:

> HI akoufoudakis/Pontus
> As I mentioned file was picked up from a shared folder which is present in
> my local machine. But same
> file:server/sharefiletest?fileName={{filename}}.txt is  not working
> when
> server is a remote machine.
>
> Are u saying that in that case I need to use jcifs component right.
>
> Thanks
> Ajit
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-configuration-to-pick-up-file-from-Shared-location-and-remote-file-location-tp5752233p5752399.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel configuration to pick up file from Shared location and remote file location

2014-06-16 Thread Pontus Ullgren
As akoufoudakis say the jcifs component behaves like the File2 or FTP component.
You can see some examples in the docs and also the test source code I
send links to earlier.

If you have questions about camel-jcifs please use the camel-extras
mailing list (http://camel-extra.1091541.n5.nabble.com/)

// Pontus

On Mon, Jun 16, 2014 at 5:43 PM, akoufoudakis  wrote:
> Glad that it works.
> As for JCIFS, I've never used it so far.
>
> So, I am not a big helper with specifically this component, unfortunately.
> However, you can start reading some docs about
> it:http://camel.apache.org/jcifs.html.
> They say, that it is an extension of the File2 component, so most probably,
> you will just have to change in you route:
> ("from:file...")
>
> to the following:
> ("smb://usern...@server.com/...?password=...")...
>
> May be, you won't need password in certain cases.
> Since it is an extension of File2, then you will be able to use all other
> parameters (noop, move, delete, etc.).
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-configuration-to-pick-up-file-from-Shared-location-and-remote-file-location-tp5752233p5752366.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel configuration to pick up file from Shared location and remote file location

2014-06-16 Thread Pontus Ullgren
If you read the documentation there is examples:

from("smb://f...@myserver.example.com/sharename?password=secret&localWorkDirectory=/tmp")
  .to("bean:foo");

Also you can have a look at the unit tests.
https://camel-extra.apache-extras.org.codespot.com/git/components/camel-jcifs/src/test/java/org/apacheextras/camel/component/jcifs/
or
https://camel-extra.apache-extras.org.codespot.com/git/components/camel-jcifs/src/integrationtest/java/org/apacheextras/camel/component/jcifs/

// Pontus

On Mon, Jun 16, 2014 at 10:52 AM, sakchakravarthi
 wrote:
> Hi Pontus
>
> Thanks for your resp. I used forward slash also. but it didnt work for me.
> Can you share any examples on camel-jcifs. I couldn't get any.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-configuration-to-pick-up-file-from-Shared-location-and-remote-file-location-tp5752233p5752331.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel configuration to pick up file from Shared location and remote file location

2014-06-16 Thread Pontus Ullgren
Hello,

If I remember correctly you should use forward slashes '/' in the path
when using the file component to access a UNC path on a windows
network.
But I could be wrong. I do not have any windows machines available to test.
Also when using the file component camel will access the share as the
user running the camel process.

An alternative is to use the camel-jcifs component from camel-extras
(http://camel.apache.org/jcifs.html) where you can define a different
user.

// Pontus


On Mon, Jun 16, 2014 at 8:53 AM, sakchakravarthi
 wrote:
> Hi I configured my route as bellow
>
> 
>  uri="file:{{config.fileloc}}?fileName={{filename}}.txt"/>
> 
> 
>
> filename=DataMoveCommand
> config.fileloc = \\Server\\FileLoc
>
> I mapped shared location \\Remote_Server\\FileLoc as network drive
>  when I bring my camel context up in logs found like as bellow
>
> Route: route18 started and consuming from:
> Endpoint[file://%5CRemote_Server%5CFileLoc?fileName=DataMoveCommand.txt]
>
> Could anyone help me on this.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-configuration-to-pick-up-file-from-Shared-location-and-remote-file-location-tp5752233p5752326.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel sql component

2014-05-21 Thread Pontus Ullgren
Hi,

I'm just fine.

Provided that you do this only within one route and do not
pass the message over any external protocol (such as JMS)
with the headers there should not be much overhead since
the header value is a reference to the same String object.

So make sure to set the header just before the 
and then remove the headers before passing the exchange to another transport.

But as Claus suggest please open a Jira with a improvement suggestion for
adding support for reading the body or even support simple expressions
in the statement.

// Pontus


On Tue, May 20, 2014 at 11:34 PM, Poyan G  wrote:
> Hello Pontus,
> How are you ? :)
> Actually that was the way I solved it, but I field that it should be an
> better solution on it,
> I don't now how much overhead it is to set the body as a header ?
> I think it should be an better way to set the body in the sql statement.
> Thanks
>
>
>
>
> 2014-05-20 23:20 GMT+02:00 Pontus Ullgren :
>
>> Hello Poyan,
>>
>> You could try something like this to assign a header the value of the
>> body and then use the header name.
>> --
>> http://camel.apache.org/schema/spring";>
>> 
>>   
>>   
>> id
>>   
>>   
>> body
>>   
>>   
>>   
>> 
>>   
>> --
>>
>> Hope this helps
>> // Pontus
>>
>> On Tue, May 20, 2014 at 10:11 PM, Poyan G  wrote:
>> > Hello,
>> >
>> > I have an route there I want to insert complete message in an row in the
>> > database, the problem is that the insert statement want # header name or
>> > body name, and to have body name my body need to be hashmap, my body is
>> > just an String and I want to insert the complete string in to database.
>> > What is the best way to to this ? I do not use Java for my route it's
>> plain
>> > spring camel xml configuration.
>> >
>> > Thanks
>> >
>> > --
>> > Poyan Gerami
>> > poyan.ger...@gmail.com
>>
>
>
>
> --
> Poyan Gerami
> poyan.ger...@gmail.com


Re: camel sql component

2014-05-20 Thread Pontus Ullgren
Hello Poyan,

You could try something like this to assign a header the value of the
body and then use the header name.
--
http://camel.apache.org/schema/spring";>

  
  
id
  
  
body
  
  
  

  
--

Hope this helps
// Pontus

On Tue, May 20, 2014 at 10:11 PM, Poyan G  wrote:
> Hello,
>
> I have an route there I want to insert complete message in an row in the
> database, the problem is that the insert statement want # header name or
> body name, and to have body name my body need to be hashmap, my body is
> just an String and I want to insert the complete string in to database.
> What is the best way to to this ? I do not use Java for my route it's plain
> spring camel xml configuration.
>
> Thanks
>
> --
> Poyan Gerami
> poyan.ger...@gmail.com


Re: Dynamic stylesheets and JIRA CAMEL-7129

2014-05-20 Thread Pontus Ullgren
I just updated the XSLT documentation to indicate that the
CamelXsltResourceUri has been removed and that dynamic URI should be
used instead.

Perhaps the information about CamelXsltResourceUri should be
completely removed but for now I left it for those users that run a
dated version of Camel.

// Pontus

On Mon, May 19, 2014 at 7:32 PM,   wrote:
> Hi Claus,
>
> thank you very much - this was the trick.
>
> -Ursprüngliche Nachricht-
> Von: Claus Ibsen [mailto:claus.ib...@gmail.com]
> Gesendet: Montag, 19. Mai 2014 19:00
> An: users@camel.apache.org
> Betreff: Re: Dynamic stylesheets and JIRA CAMEL-7129
>
> Hi
>
> Use
> http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html
>
> On Mon, May 19, 2014 at 6:38 PM,   wrote:
>> Dear Camel Users,
>>
>> in documentation http://camel.apache.org/xslt there is a sub chapter about 
>> Dynamic stylesheets, where the provision of CamelXsltResourceUri header is 
>> described.
>>
>> So, we used dynamic stylesheets in our application with no problems so far. 
>> Now we tried to update to the Camel Version 2.13.1 and had to learn from 
>> JIRA  https://issues.apache.org/jira/browse/CAMEL-7129 , that 
>> CamelXsltResourceUri header was removed from Xslt Component. Do not 
>> understand this, and discription says only "We should not encourage user to 
>> change the xslt url dynamically."
>>
>> It would be great if someone could give some background information about 
>> this removal. Is there another possibility to have dynamic stylesheets now, 
>> or do i have to extend the xslt component to get the old functionality?
>>
>> Thanks very much for any insight,
>> Kindest Regards,
>> Robert
>
>
>
> --
> 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-dropbox

2014-03-07 Thread Pontus Ullgren
In the the dropbox core API zip file there is a License.txt

https://www.dropbox.com/developers/downloads/sdks/core/java/dropbox-java-sdk-1.7.6.zip
---
Copyright (c) 2013 Dropbox Inc., http://www.dropbox.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--

Why would this license stop the camel-dropbox component from beeing
released under the Apache License ?
To me the dropbox API license seems pretty permissive.

// Pontus

On Fri, Mar 7, 2014 at 12:36 PM, Henryk Konsek  wrote:
>> What I can not answer is, if the dropbox license and terms of conditions
>> meet the general ASF requirements or not.
>
> Apparently not.
>
>> If it is not possible to contribute the component to the ASF branch, I would
>> vote for a contribution to camel-extra.
>
> I asked to author of the DropBox pull request if he would like to
> contribute the project to Camel Extra.
>
> Cheers.
>
> --
> Henryk Konsek
> http://henryk-konsek.blogspot.com


Re: Load testing for Camel appliation

2014-01-21 Thread Pontus Ullgren
Hi,

To add to Jans answer.

JMeter can also handle JMS
http://jmeter.apache.org/usermanual/build-jms-topic-test-plan.html

An alternative to JMeter if your "message channel" is a SOAP or REST
endpoint is to use soapUI (with loadUI).
http://www.soapui.org/

It also has support for JMS though I never tested it my self.

// Pontus

On Tue, Jan 21, 2014 at 7:29 AM, Jan Matèrne (jhm)  wrote:
> I am not aware of special Camel load test tools.
> Testing the whole route depends on the incoming chanel where you want to
> give load on.
>
> If it is from(http://) then you could tools like JMeter.
> Having from(file://) you have to create files faster Camel slurps them.
> Having from(jdbc://) you need a big database table.
> ...
>
> You also could insert a special endpoint for load test.
> Having:
>   from("...").to(nextStep)...
> Inserting:
>   from("...").to(nextStep)...
>   from(loadTest).to(nextStep)...
>
> loadTest:
>   http4:// and using JMeter
>   direct:// and using ?
>   ...
>
>
> Jan
>
>
>> -Ursprüngliche Nachricht-
>> Von: bonnahu [mailto:bonn...@gmail.com]
>> Gesendet: Dienstag, 21. Januar 2014 06:22
>> An: users@camel.apache.org
>> Betreff: Load testing for Camel appliation
>>
>> Hi all, currently I am working on a Camel application which has a
>> event-driven consumer listening on a message channel. After message
>> arrives, the processor will parse XML content to retrieve the
>> properties we want. I want to do some load testing for the app, can
>> someone give me some suggestion of tools or apps of performing load
>> testing?
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Load-
>> testing-for-Camel-appliation-tp5746265.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Need for XA?

2014-01-04 Thread Pontus Ullgren
It all depends on your requirements and how your database and the
system consuming from the second queue is designed.

If the write operation to the database and the system consuming from
the second queue is idempotent, ie they can both gracefully handle
that the same message is processed twice. Then you can think about
skipping XA.

If this is NOT the case, or if you are unsure what would happen if the
same message is consumed twice, then you will need XA.

In the scenario you describe I would defiantly consider using XA just
to be safe.

Pontus

On Fri, Jan 3, 2014 at 11:48 PM, Larry Meadors  wrote:
> Just to be clear here...if you're doing this:
>  - get a message from JMS broker A
>  - write to database
>  - put a messages in a queue on JMS broker A
>
> Should you or should you not need XA?
> Larry


Re: Zipping multiple files to one Zip-File

2013-12-28 Thread Pontus Ullgren
Here is a AggregationStrategy, that I'm using in a project, that
aggregates all incoming messages into a ZIP file.
It uses a temporary file to store the data in between messages.

https://gist.github.com/ullgren/8160215


Best regards
Pontus


On Fri, Dec 27, 2013 at 8:23 PM, alex  wrote:
> Thank you very much, i'll try to aggregate the messages and zip them. Let you
> know about my progress soon :-)
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Zipping-multiple-files-to-one-Zip-File-tp5745128p5745289.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FTP to FTP file transfer through camel with Source Failover

2013-12-17 Thread Pontus Ullgren
Hi,

I can see several different solutions to the problem.

If files only appear on the backupSourceFTP when the sourceFTP is down
you could have one route for each thus camel will always transfer
files from both FTP servers.
It would be up to the producer to place them on the active one.

You could also expand this with building a custom
PollingConsumerPollStrategy that only allows for consuming files if
the sourceFTP is down and have that configured on the route that reads
from the backupSourceFTP.

A, non-camel, way to solve this is to have a service IP address that
fail-over to the backup if the primary goes down. This way when camel
looses connection and reconnects it will start to poll from the
backup.
However this is a feature that you need to fix outside of camel using
some loadbalancer or ha-daemon.

// Pontus

On Tue, Dec 17, 2013 at 8:11 AM, kuntalc-techid
 wrote:
> Hi,I want to transfer some files from one FTP location (Source FTP) to
> another FTP location (Destination FTP) through camel. Now, I know that
> through Camel we can handle the failover of the destination FTP server as
> following:public class FtpRouteBuilder extends RouteBuilder {  @Override
> public void configure() throws Exception {
> from(sourceFTP).loadBalance().failover()
> .to(destinationFTP).to(backupFTP).end();  }}But my requirement is that I
> need to have source FTP failover support. That is suppose I have one
> sourceFTP and one backupSourceFTP server. Camel should poll files from
> sourceFTP and transfer them to destinationFTP. However, when sourceFTP  goes
> down it will automatically poll files from backupSourceFTP server and send
> them to destinationFTP.Please, let me know if this can be achieved through
> Camel. If not, is there any other way to achieve this?Thanks in advance.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/FTP-to-FTP-file-transfer-through-camel-with-Source-Failover-tp5744921.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Read Multiple files or using concurrent consumers in one route

2013-12-10 Thread Pontus Ullgren
Hi,

If the directories are subfolders of the same directory then you can
use the recursive URI option see the File2 documentation[1].

If the directories are completely different directories in totally
different locations I would create multiple routes, one per directory.
These can then use a direct endpoint to send the data to a common
transformation route.

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

// Pontus

On Tue, Dec 10, 2013 at 9:40 AM, Claire  wrote:
> Hi,
>
> That one is for files from one directory? what if i want to read multiple
> files from different directory? what I can use to modify the content of each
> file. What should i specify to modify those files?
>
> Thanks
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Read-Multiple-files-or-using-concurrent-consumers-in-one-route-tp5744545p5744552.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Default value for a timer?

2013-11-05 Thread Pontus Ullgren
It will be fired according to the defaults for the timer component which is
evry 1000 milisecond.
See the documentation[1].

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

// Pontus


On Mon, Nov 4, 2013 at 7:07 PM, John D. Ament wrote:

> I'm using Camel 2.10.7.  We just noticed in our code we have a timer with
> no values set.  How often will this timer fire?
>
> John
>


Re: Consume files periodically or on demand

2013-10-09 Thread Pontus Ullgren
You could create the file consuming route with autoStart(false). Then have
a separate "controller" route that starts the first route on incoming
message.
Have a look at the Controlbus EIP[1]

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

// Pontus


On Wed, Oct 9, 2013 at 10:09 PM, christoffer  wrote:

> Hi,
>
> thank you very much for your great input.
> I tried using the approach with pollEnrich - but that only consumes one
> file
> from the (potentially) many files.
>
> I figured out the following approach using pollEnrich
> from(demandFileConsumption).pollEnrich(fileEndpointName +
> "?sendEmptyMessageWhenIdle=true").choice()
> .when(body().isNull()).stop()
> .otherwise().wireTap(demandFileConsumption, false,
> constant("trigger")).to("mock:result").endChoice();
>
> demandFileConsumption is direct endpoint URI and fileEndpointName is a file
> endpoint URI. When I send a message to demandFileConsumption, this will
> consume the first file, which in turn trigger the consumption of the next
> file via the wireTap. If the source directory is drained of files the
> content based router shuts down the polling for files.
> This seems to work; is there a cleaner or more "camelish" approach. I think
> using the approach would basically be the same idea.
> Thanks for your input and keep ridin', chris
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Consume-files-periodically-or-on-demand-tp5741235p5741247.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel JBDC : Connection pooling

2013-09-11 Thread Pontus Ullgren
Not that it has anything to do with Camel but Spring JDBCTemplate does not
provide pooling either.

Just as with camel-jdbc the Spring JDBCTemplate uses the provided data
source and you will need to use a connection pool libraries or get a
container managed datasource pool.

// Pontus


On Wed, Sep 11, 2013 at 6:47 PM, myhumandreams <
kv.prajeesh.rajas...@gmail.com> wrote:

> Thanks Claus...
>
> I am planning to use spring JDBCTemplate for all my data access with
> pooling.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-JBDC-Connection-pooling-tp5739116p5739179.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: How to Give any java application as a end point in from (....)

2013-09-01 Thread Pontus Ullgren
A simplified answer is that the seda queue is defined when you use it as a
from endpoint ie from("seda:start").

To send messages to it in your example simply use the producer template
just change so the message is send to the seda uri instead of the direct.

Best regards
Pontus
Thanks Pontus Ullgren ,
can you explain something about seda implementation, i go to url but am not
able to get much,
want to know how we define seda que and put the messages to it ?  in my
given example



--
View this message in context:
http://camel.465427.n5.nabble.com/How-to-Give-any-java-application-as-a-end-point-in-from-tp5738327p5738424.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to Give any java application as a end point in from (....)

2013-08-30 Thread Pontus Ullgren
If you want to call the camel route synchronously then you can use a direct
endpoint[1] and then in getMessage() use a producer template[2].
Other options are to use a seda[3] endpoint.

So something like this:

public class StandAloneCameClass implements MessageProducer {

   ProducerTemplate template;

public static void main(String args[]) throws Exception {

CamelContext context = new DefaultCamelContext();

context.addRoutes(new RouteBuilder() {

@Override
public void configure() throws Exception {

from("direct:start").process(
MyProcessorInstance);

}
});
   template = context.createProducerTemplate();

context.start();
Thread.sleep(1);
context.stop();
}


@Override
public void getMessages(String s) throws Exception {
// here am getting/received messages , which need to pass
// to processor
   template.sendBody("direct:start", s);
}

}


[1] http://camel.apache.org/direct.html
[2] http://camel.apache.org/producertemplate.html
[3] http://camel.apache.org/seda.html

Best regards
Pontus Ullgren


On Fri, Aug 30, 2013 at 7:27 PM, jhonny  wrote:

> getMessage() is called by the java application contiously , where it insert
> the messages coniniously
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-Give-any-java-application-as-a-end-point-in-from-tp5738327p5738328.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Mina BufferDataException when using disconnectOnNoReply option

2013-08-22 Thread Pontus Ullgren
I have never used the mina component so I could be out on thin ice here.
But I am not sure about the ';'  to separate the parameters. Should it not
be '&'?

Best regards
Pontus
Den 21 aug 2013 17:58 skrev "milltj" :

> Ok, So I decided to go back to the drawing board and decided to run some
> tests.
>
> First, I implemented a very simple decoder that contains the following
> code:
>
> @Override
> protected boolean doDecode(IoSession is, IoBuffer ib,
> ProtocolDecoderOutput pdo) throws Exception {
>
> System.out.println("IoBuffer hasRemaining: " + ib.hasRemaining());
> System.out.println("IoBuffer remaining: " + ib.remaining());
> byte[] data = new byte[ib.remaining()];
> ib.get(data);
> System.out.println("IoBuffer read: " + new String(data));
>
> return true;
>
> }
>
> Then I implemented my route in the camel-context as...
>
>   http://camel.apache.org/schema/spring";>
> 
>  uri="mina2:tcp://10.5.60.60:9000?codec=#gilbarcoDecoder" />
> 
> 
>   
>
> When I run this it will successfully read the input and output the received
> message to the console. However when I change the route to..
>
>   http://camel.apache.org/schema/spring";>
> 
>  uri="mina2:tcp://
> 10.5.60.60:9000?disconnectOnNoReply=false;codec=#gilbarcoDecoder"
> />
> 
> 
>   
>
> Then I get the following error message and it never calls the doDecode
> method..
> org.apache.camel.CamelException:
> org.apache.mina.filter.codec.ProtocolDecoderException:
> org.apache.mina.core.buffer.BufferDataException: dataLength: 1347375948
> (Hexdump: REMOVED FOR BREVITY)
> at
>
> org.apache.camel.component.mina2.Mina2Consumer$ReceiveHandler.exceptionCaught(Mina2Consumer.java:312)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.exceptionCaught(DefaultIoFilterChain.java:672)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:461)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1100(DefaultIoFilterChain.java:47)
> at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.exceptionCaught(DefaultIoFilterChain.java:760)
> at
> org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:93)
> at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
> at
>
> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:769)
> at
>
> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:761)
> at
>
> org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:703)
> at java.lang.Thread.run(Thread.java:722)
>
>
> Not sure exactly why this is occurring.  Is it the way I have configured my
> route?  Or is this a bug in the Mina2 2.11.1 component?
>
> - Tim
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Mina-Synchronous-Communication-tp5737223p5737692.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Conditional routing and local variables

2013-08-19 Thread Pontus Ullgren
On Mon, Aug 19, 2013 at 10:41 PM, peacock.snowdrift <
mark.har...@arcinnovations.co.nz> wrote:

> Claus Ibsen-2 wrote
> > A good idea is to check the docs
> > http://camel.apache.org/predicate.html
> >
> > For example you can use the front page of Apache Camel
> > http://camel.apache.org/
> >
> > And type in keywords in the search box.
> >
> > As well read some of the intro guides and whatnot.
> > There is also a lot of links to external Camel intro and resources at
> > http://camel.apache.org/articles
>
> Hi,
>
> I have looked through the documentation as you suggest but still cannot
> find
> the syntax for referring to local variables with predicates - all the
> examples I have found look at the exchange's headers.
>
> Thanks.
>

Hello,

As Willem points out your mixing design time and runtime.

Predicates is mostly intended for runtime hence most examples works on
exchange headers.

However if you want to use predicts I believe you can use the constant()
method in your predicate.
---
from(uri)
... stuff here...
.to(destination)
.choice()
.when(constant(localVar).isEqualTo("value")).to(additionalDestination);
---
Or since you are doing all this in design time you can also build the route
normal if statements (as you do) but use a local route definition variable
to avoid having to duplicating code .
---
RouteDefinition myRoute = from(uri)
  stuff here...
.to(destination):

if ( localVar == value) {
  myRoute.to(additionalDestination);
} else {
  myRoute.to(someotherDestination);
}

myRoute.to(commonFinalDestination);
---

Best regards
Pontus Ullgren


Re: How to schedule FTP with quartz?

2013-03-26 Thread Pontus Ullgren
Glad to hear that you solved it.

If possible, I would not mind having a peek at the code for your new policy.

//Pontus
On 27 Mar 2013 04:21, "Chris Wolf"  wrote:

> Yes, and after Raul's clarification in his response this evening
> (GMT-4), I changed my RoutePolicy implementation
> and now it works!
>
> For example, to kick off a cron job at 0615 daily, with a run duration
> of 30 minutes, you would do:
>
> CronRoutePolicy ftpPolicy = new CronRoutePolicy(TimeUnit.MINUTES);
> ftpPolicy.setRouteStartTime("0 15 6 * * ?");
> ftpPolicy.setPollWindowTime(30);
>
> This implementation uses the same Quartz scheduler instance as
> ScheduledRoutePolicy, but with
> a different job/trigger naming convention, so there's no duplication
> and (hopefully) no conflicts.
>
> I appreciate your empty message solution, however, in my case, the
> remote files will intermittently appear
> during the 30 minute window time, so we have to keep trying, even
> after getting some files.
>
> On Tue, Mar 26, 2013 at 4:43 PM, Pontus Ullgren  wrote:
> > Sorry read your message a bit to quick.
> >
> > If you do not want to calculate the suspend cron expression I guess
> > you need to mimic the behaviour of
> > org.apache.camel.routepolicy.quartz.ScheduledRoutePolicy where (as you
> > point out in another email) the consumer is suspended and not the
> > route.
> >
> > I'm sorry can not explain why it's implemented this way, I just know
> > that in the case of the existing scheduled route policies it seem to
> > work as expected. :-)
> > Hopefully somebody with more knowledge of the in and outs of Camel can
> > explain this to us both.
> >
> > // Pontus
> >
> >
> >
> > On Tue, Mar 26, 2013 at 9:12 PM, Pontus Ullgren 
> wrote:
> >> Chris,
> >>
> >> Is there no way for you to calculate a cron expression for when the
> >> suspend should occure ?
> >>
> >> Say that you want the route to start every 10 minutes (starting at 0)
> >> and run for 5 minutes then suspend.
> >> This would mean that you should be able to define the start/resume
> >> cron as "0 0,10,20,30,40,50 * * * * ?".
> >> And the suspend cron expression as "0 5,15,25,35,45,55 * * * * ?".
> >>
> >> The CronScheduledRoutePolicy will trigger a start/resum at 00:00:00
> >> and then a suspend at 00:05:00, then a new start/resume at 00:10:00
> >> and a new suspends at 00:15:00 and so on.
> >>
> >> // Pontus
> >>
> >> On Tue, Mar 26, 2013 at 7:39 PM, Chris Wolf 
> wrote:
> >>> Pontus,
> >>>
> >>> I actually gave up on CronScheduledRoutePolicy because I don't want to
> >>> have to calculate an absolute suspend time based on the start/resume
> >>> time.  What I need is a cron-based policy that specifies the initial
> >>> start time, which there-after becomes the resume time - this is a cron
> >>> expression - then I just want a relative run duration, after which,
> >>> the route is suspended until the next cron-specified resume time.
> >>>
> >>> So, after a few days, I finally have that and it works in the unit
> >>> test - even the initial one-off route start will transparently switch
> >>> to a resume schedule.  The only problem is that I really need this
> >>> policy to control a route with an FTP consumer.  What I'm seeing is
> >>> that
> >>> even though the route is suspended, the FTP consumer continues to poll
> >>> - this partially answers my question about the coding of
> >>> ScheduleRoutePolicy - which only suspends the consumer - not the
> >>> route, itself.   While my policy suspends the route.
> >>>
> >>> I suspect that any route which has a component using
> >>> PollingConsumerPollStrategy will not behave as I though - which is -
> >>> you only need to suspend the route and all it's components will be
> >>> suspended.  My suspicion is that components whose Consumers are under
> >>> the influence of PollingConsumerPollStrategy may not suspend by only
> >>> suspended the route.
> >>>
> >>>-Chris
> >>>
> >>>
> >>> On Sat, Mar 23, 2013 at 3:15 AM, Pontus Ullgren 
> wrote:
> >>>> This is probably because your route is autoStart=false. So you the
> first
> >>>> time you need to start it. In my example you see I set both the start
> and
> >&

Re: How to schedule FTP with quartz?

2013-03-26 Thread Pontus Ullgren
Sorry read your message a bit to quick.

If you do not want to calculate the suspend cron expression I guess
you need to mimic the behaviour of
org.apache.camel.routepolicy.quartz.ScheduledRoutePolicy where (as you
point out in another email) the consumer is suspended and not the
route.

I'm sorry can not explain why it's implemented this way, I just know
that in the case of the existing scheduled route policies it seem to
work as expected. :-)
Hopefully somebody with more knowledge of the in and outs of Camel can
explain this to us both.

// Pontus



On Tue, Mar 26, 2013 at 9:12 PM, Pontus Ullgren  wrote:
> Chris,
>
> Is there no way for you to calculate a cron expression for when the
> suspend should occure ?
>
> Say that you want the route to start every 10 minutes (starting at 0)
> and run for 5 minutes then suspend.
> This would mean that you should be able to define the start/resume
> cron as "0 0,10,20,30,40,50 * * * * ?".
> And the suspend cron expression as "0 5,15,25,35,45,55 * * * * ?".
>
> The CronScheduledRoutePolicy will trigger a start/resum at 00:00:00
> and then a suspend at 00:05:00, then a new start/resume at 00:10:00
> and a new suspends at 00:15:00 and so on.
>
> // Pontus
>
> On Tue, Mar 26, 2013 at 7:39 PM, Chris Wolf  wrote:
>> Pontus,
>>
>> I actually gave up on CronScheduledRoutePolicy because I don't want to
>> have to calculate an absolute suspend time based on the start/resume
>> time.  What I need is a cron-based policy that specifies the initial
>> start time, which there-after becomes the resume time - this is a cron
>> expression - then I just want a relative run duration, after which,
>> the route is suspended until the next cron-specified resume time.
>>
>> So, after a few days, I finally have that and it works in the unit
>> test - even the initial one-off route start will transparently switch
>> to a resume schedule.  The only problem is that I really need this
>> policy to control a route with an FTP consumer.  What I'm seeing is
>> that
>> even though the route is suspended, the FTP consumer continues to poll
>> - this partially answers my question about the coding of
>> ScheduleRoutePolicy - which only suspends the consumer - not the
>> route, itself.   While my policy suspends the route.
>>
>> I suspect that any route which has a component using
>> PollingConsumerPollStrategy will not behave as I though - which is -
>> you only need to suspend the route and all it's components will be
>> suspended.  My suspicion is that components whose Consumers are under
>> the influence of PollingConsumerPollStrategy may not suspend by only
>> suspended the route.
>>
>>-Chris
>>
>>
>> On Sat, Mar 23, 2013 at 3:15 AM, Pontus Ullgren  wrote:
>>> This is probably because your route is autoStart=false. So you the first
>>> time you need to start it. In my example you see I set both the start and
>>> resume schedule to the same cron expression. So the policy will trigger
>>> both a start and a resume action.
>>>
>>> And you will get a WARN log since the first time it can not resume (but it
>>> will start) and after that it can not start but it will resume.
>>>
>>> Perhaps if you share some code it would be easier to help you.
>>> //Pontus
>>> On 22 Mar 2013 22:06, "Chris Wolf"  wrote:
>>>
>>>> I found the issue with my custom CronScheduledRoutePolicy - initially
>>>> the startTime/resumeTime are only scheduled in
>>>> onInit() - so to re-resume (re-start), you need to call
>>>> scheduleRoute(Action.RESUME, route); in onStart()
>>>>
>>>> ...but now I'm getting:
>>>>
>>>> quartz.ScheduledRoutePolicy WARN  Route is not in a started state and
>>>> cannot be resumed. The current route state is Suspended
>>>>
>>>> What is the deal?  I thought resumeRoute was the inverse of
>>>> suspenRoute, but this log message seems to indicate that
>>>> calling CamelContext.suspendRoute(routeId) will put the route into a
>>>> state that cannot be resumed.
>>>>
>>>> Thanks,
>>>>
>>>>
>>>> Chris
>>>>
>>>> On Fri, Mar 22, 2013 at 4:04 PM, Chris Wolf  wrote:
>>>> > Pontus,
>>>> >
>>>> > Thanks for that.  Since I already has started implementing a class
>>>> > derived from CronScheduledRoutePolicy, I just finished it.
>>>> > It works by starting a Timer thread in onStart/onR

Re: How to schedule FTP with quartz?

2013-03-26 Thread Pontus Ullgren
Chris,

Is there no way for you to calculate a cron expression for when the
suspend should occure ?

Say that you want the route to start every 10 minutes (starting at 0)
and run for 5 minutes then suspend.
This would mean that you should be able to define the start/resume
cron as "0 0,10,20,30,40,50 * * * * ?".
And the suspend cron expression as "0 5,15,25,35,45,55 * * * * ?".

The CronScheduledRoutePolicy will trigger a start/resum at 00:00:00
and then a suspend at 00:05:00, then a new start/resume at 00:10:00
and a new suspends at 00:15:00 and so on.

// Pontus

On Tue, Mar 26, 2013 at 7:39 PM, Chris Wolf  wrote:
> Pontus,
>
> I actually gave up on CronScheduledRoutePolicy because I don't want to
> have to calculate an absolute suspend time based on the start/resume
> time.  What I need is a cron-based policy that specifies the initial
> start time, which there-after becomes the resume time - this is a cron
> expression - then I just want a relative run duration, after which,
> the route is suspended until the next cron-specified resume time.
>
> So, after a few days, I finally have that and it works in the unit
> test - even the initial one-off route start will transparently switch
> to a resume schedule.  The only problem is that I really need this
> policy to control a route with an FTP consumer.  What I'm seeing is
> that
> even though the route is suspended, the FTP consumer continues to poll
> - this partially answers my question about the coding of
> ScheduleRoutePolicy - which only suspends the consumer - not the
> route, itself.   While my policy suspends the route.
>
> I suspect that any route which has a component using
> PollingConsumerPollStrategy will not behave as I though - which is -
> you only need to suspend the route and all it's components will be
> suspended.  My suspicion is that components whose Consumers are under
> the influence of PollingConsumerPollStrategy may not suspend by only
> suspended the route.
>
>-Chris
>
>
> On Sat, Mar 23, 2013 at 3:15 AM, Pontus Ullgren  wrote:
>> This is probably because your route is autoStart=false. So you the first
>> time you need to start it. In my example you see I set both the start and
>> resume schedule to the same cron expression. So the policy will trigger
>> both a start and a resume action.
>>
>> And you will get a WARN log since the first time it can not resume (but it
>> will start) and after that it can not start but it will resume.
>>
>> Perhaps if you share some code it would be easier to help you.
>> //Pontus
>> On 22 Mar 2013 22:06, "Chris Wolf"  wrote:
>>
>>> I found the issue with my custom CronScheduledRoutePolicy - initially
>>> the startTime/resumeTime are only scheduled in
>>> onInit() - so to re-resume (re-start), you need to call
>>> scheduleRoute(Action.RESUME, route); in onStart()
>>>
>>> ...but now I'm getting:
>>>
>>> quartz.ScheduledRoutePolicy WARN  Route is not in a started state and
>>> cannot be resumed. The current route state is Suspended
>>>
>>> What is the deal?  I thought resumeRoute was the inverse of
>>> suspenRoute, but this log message seems to indicate that
>>> calling CamelContext.suspendRoute(routeId) will put the route into a
>>> state that cannot be resumed.
>>>
>>> Thanks,
>>>
>>>
>>> Chris
>>>
>>> On Fri, Mar 22, 2013 at 4:04 PM, Chris Wolf  wrote:
>>> > Pontus,
>>> >
>>> > Thanks for that.  Since I already has started implementing a class
>>> > derived from CronScheduledRoutePolicy, I just finished it.
>>> > It works by starting a Timer thread in onStart/onResume at the end of
>>> > the time period, the route is suspended, but then upon
>>> > the next schedule cron start time, I don't see it being resumed - I
>>> > wonder if the RoutePolicy itself is being suspend too?
>>> >
>>> > Well, I try it your way also.
>>> >
>>> >
>>> > Thanks,
>>> >
>>> >
>>> > Chris
>>> >
>>> > On Wed, Mar 20, 2013 at 4:34 AM, Pontus Ullgren 
>>> wrote:
>>> >> Hello,
>>> >>
>>> >> On Tue, Mar 19, 2013 at 11:22 PM, Chris Wolf 
>>> wrote:
>>> >>> On Mon, Mar 18, 2013 at 4:57 PM, Pontus Ullgren 
>>> wrote:
>>> >>>> Hello Chris,
>>> >>>>
>>> >>>> On Mon, Mar 18, 2013 at 8:54 PM, Chris Wolf 
>>> wrote:
>>> >>>>> Claus,
>

Re: How to schedule FTP with quartz?

2013-03-23 Thread Pontus Ullgren
This is probably because your route is autoStart=false. So you the first
time you need to start it. In my example you see I set both the start and
resume schedule to the same cron expression. So the policy will trigger
both a start and a resume action.

And you will get a WARN log since the first time it can not resume (but it
will start) and after that it can not start but it will resume.

Perhaps if you share some code it would be easier to help you.
//Pontus
On 22 Mar 2013 22:06, "Chris Wolf"  wrote:

> I found the issue with my custom CronScheduledRoutePolicy - initially
> the startTime/resumeTime are only scheduled in
> onInit() - so to re-resume (re-start), you need to call
> scheduleRoute(Action.RESUME, route); in onStart()
>
> ...but now I'm getting:
>
> quartz.ScheduledRoutePolicy WARN  Route is not in a started state and
> cannot be resumed. The current route state is Suspended
>
> What is the deal?  I thought resumeRoute was the inverse of
> suspenRoute, but this log message seems to indicate that
> calling CamelContext.suspendRoute(routeId) will put the route into a
> state that cannot be resumed.
>
> Thanks,
>
>
> Chris
>
> On Fri, Mar 22, 2013 at 4:04 PM, Chris Wolf  wrote:
> > Pontus,
> >
> > Thanks for that.  Since I already has started implementing a class
> > derived from CronScheduledRoutePolicy, I just finished it.
> > It works by starting a Timer thread in onStart/onResume at the end of
> > the time period, the route is suspended, but then upon
> > the next schedule cron start time, I don't see it being resumed - I
> > wonder if the RoutePolicy itself is being suspend too?
> >
> > Well, I try it your way also.
> >
> >
> > Thanks,
> >
> >
> > Chris
> >
> > On Wed, Mar 20, 2013 at 4:34 AM, Pontus Ullgren 
> wrote:
> >> Hello,
> >>
> >> On Tue, Mar 19, 2013 at 11:22 PM, Chris Wolf 
> wrote:
> >>> On Mon, Mar 18, 2013 at 4:57 PM, Pontus Ullgren 
> wrote:
> >>>> Hello Chris,
> >>>>
> >>>> On Mon, Mar 18, 2013 at 8:54 PM, Chris Wolf 
> wrote:
> >>>>> Claus,
> >>>>>
> >>>>> I have a few further questions about CronScheduledRoutePolicy.  I
> >>>>> noticed that it has setters such as setRouteStartTime,
> >>>>> setRouteStopTime, each which takes a cron expression string.  What
> I'm
> >>>>> looking for is to be able to use a cron expression for the start, but
> >>>>> a relative time length for stop.   Otherwise, I need to write code to
> >>>>> parse the start time expression, then calculate a stop time cron
> >>>>> expression.  Any ideas?
> >>>>>
> >>>> Depending on your needs you could enable "sendEmptyMessageWhenIdle" on
> >>>> the endpoint and then suspend the route when you receive a empty
> >>>> message. Which means that there is no more files to poll at the
> >>>> moment.
> >>>> You can use the content based route EIP for this.
> >>>
> >>> That is interesting to know, thanks.  In my case, the files at the
> >>> remote end are themselves deposited at an irregular rate, but within a
> >>> defined time window, so during that time window, there will be
> >>> intermittent idleness...
> >>>>
> >>>> Another solution would be to write your own RoutePolicy to take care
> >>>> of your needs.
> >>>
> >>> Yes, this sounds like the best approach...
> >>>
> >>>
> >>>>
> >>>> I just started to wonder if it might be possible to combine the
> >>>> CronScheduledRoutePolicy with a SimpleScheduledRoutePolicy.
> >>>> I have _not_ tested this so I'm not sure if it works. It might be that
> >>>> there is a collision in the way they work with Quartz.
> >>>>
> >>>>> Also I see that CronScheduledRoutePolicy has setRouteResumeTime,
> >>>>> setRouteSuspendTime such that for my FTP poll window, I could either
> >>>>> do start/stop or resume/suspend - which is recommended?
> >>>>>
> >>>> I would highly recommend resume/suspend.
> >>>> I've had some thread leak problem with the file component when it was
> >>>> repetitively started/stopped.
> >>>
> >>> Ok, but I guess the first policy callback with be onStart since the
> >>> route will be
> >>&g

Re: Couchdb peer not authenticated exception

2013-03-20 Thread Pontus Ullgren
Hi,

Could be that this has to do with the server certificate not beeing
trusted by your java process.
Check if the sever (hangstrap.iriscouch.com) has a valid certificate
and that the root ca cert and any intermediate ca certs is in your
trust store.

Some browsers will auto-magicaly download the intermediate ca certs or
it could be that you have the proper certs installed in your
browser/OS but not in the Java trust store. This might be the reason
that it works in the browser.

I could not access the server so I could not verify server certificate.

Just my $0.02
// Pontus



On Sun, Mar 17, 2013 at 10:17 PM, hangstrap  wrote:
> Hi
>
> I have been trying to use camel-couchdb to send data to a couchDb datastore
>
>
> My code looks like
>
> .to(
> "couchdb:https://hangstrap.iriscouch.com/test?username=hangstrap&password=";);
>
> When the code runs a get a  javax.net.ssl.SSLPeerUnverifiedException: peer
> not authenticated exception
> from the CouchDbClientBase.executeRequest method.
>
> However, when I past the url
> https://hangstrap.iriscouch.com/test?username=hangstrap&password= into
> my browser I can connect to my couchDB without problems.
>
> Any ideas what I am missing out?
>
> Thanks
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Couchdb-peer-not-authenticated-exception-tp5729323.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Aggregator Strategy Question

2013-03-20 Thread Pontus Ullgren
Add a transformation from CSV to Map object before the aggregator.

Then let the aggregator store a list of maps, or a map of maps, in the
exchange body.

You can then use this list in any subsequent transformation.

It all depends on what it is you intend to do with the data after it
has been aggregated.

// Pontus

On Wed, Mar 20, 2013 at 10:48 AM, Jothi  wrote:
> Thanks for the reply.
>
> Would I be able to do the following? The 3 CSV files will contain different
> information. I need to poll for these 3 files and get 3 Map objects out of
> those 3 CSV files. I've seen the aggregation examples from the Camel
> documentation, but there we combine the old and the new exchange. If I had
> to do that, I will end up with one Map object which is not what I want. If I
> use the headers to store the Map, am I exploiting the very purpose of Camel
> headers? Is there a better way to do this?
>
> Regards,
> Joe
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Aggregator-Strategy-Question-tp5729337p5729489.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to schedule FTP with quartz?

2013-03-20 Thread Pontus Ullgren
Hello,

On Tue, Mar 19, 2013 at 11:22 PM, Chris Wolf  wrote:
> On Mon, Mar 18, 2013 at 4:57 PM, Pontus Ullgren  wrote:
>> Hello Chris,
>>
>> On Mon, Mar 18, 2013 at 8:54 PM, Chris Wolf  wrote:
>>> Claus,
>>>
>>> I have a few further questions about CronScheduledRoutePolicy.  I
>>> noticed that it has setters such as setRouteStartTime,
>>> setRouteStopTime, each which takes a cron expression string.  What I'm
>>> looking for is to be able to use a cron expression for the start, but
>>> a relative time length for stop.   Otherwise, I need to write code to
>>> parse the start time expression, then calculate a stop time cron
>>> expression.  Any ideas?
>>>
>> Depending on your needs you could enable "sendEmptyMessageWhenIdle" on
>> the endpoint and then suspend the route when you receive a empty
>> message. Which means that there is no more files to poll at the
>> moment.
>> You can use the content based route EIP for this.
>
> That is interesting to know, thanks.  In my case, the files at the
> remote end are themselves deposited at an irregular rate, but within a
> defined time window, so during that time window, there will be
> intermittent idleness...
>>
>> Another solution would be to write your own RoutePolicy to take care
>> of your needs.
>
> Yes, this sounds like the best approach...
>
>
>>
>> I just started to wonder if it might be possible to combine the
>> CronScheduledRoutePolicy with a SimpleScheduledRoutePolicy.
>> I have _not_ tested this so I'm not sure if it works. It might be that
>> there is a collision in the way they work with Quartz.
>>
>>> Also I see that CronScheduledRoutePolicy has setRouteResumeTime,
>>> setRouteSuspendTime such that for my FTP poll window, I could either
>>> do start/stop or resume/suspend - which is recommended?
>>>
>> I would highly recommend resume/suspend.
>> I've had some thread leak problem with the file component when it was
>> repetitively started/stopped.
>
> Ok, but I guess the first policy callback with be onStart since the
> route will be
> configured with noAutoStartup(), so upon that first onStart, I'll
> suspend then toggle
> between onSuspend/onResume...
>
Yes this is what I do. We have a route that should start 06:30 each
day and then poll all files that are in the folder at that time.
After that it should suspend.

Here is some pseudo code.
SuspendRouteProcessor is a processor that suspends the route based on route id.
---
String cronStr = "* 30 6 * * * ?";
String input = 
"ftp://user@remotehost/inbox?sendEmptyMessageWhenIdle=true&password=secret";;
CronScheduledRoutePolicy scheduledRP = new CronScheduledRoutePolicy();
scheduledRoutePolicy.setRouteStartTime(cronStr);
scheduledRoutePolicy.setRouteResumeTime(cronStr);

from(input)
.routeId("input1")
.routePolicy(versionPolicy, scheduledRoutePolicy)
.noAutoStartup()
 .choice()
.when(body().isNotNull())
   .to("direct:processFiles")
.end()
.log(LoggingLevel.DEBUG, "All files processed, suspend route")
.process(new SuspendRouteProcessor("input1"))
;
--

The only downside with this is that after the initial start we get a
WARN log message that the route can not be started since it is in
suspend state.
But as long as you can live with the WARN log it works.

>>
>> // Pontus
>>
>>> Thanks,
>>>
>>> Chris
>>>
>>> On Sat, Mar 2, 2013 at 1:43 AM, Claus Ibsen  wrote:
>>>> Hi
>>>>
>>>> See about route policy
>>>> http://camel.apache.org/routepolicy
>>>>
>>>> And the scheduled route policy
>>>> http://camel.apache.org/scheduledroutepolicy.html
>>>>
>>>> On Sat, Mar 2, 2013 at 12:15 AM, Chris Wolf  wrote:
>>>>> I have a requirement to download files via FTP during a certain time
>>>>> window and according to a schedule. e.g. Only on trading days between
>>>>> 6:30AM and 7:00AM.  The FTP component, alone, seems to just do
>>>>> indefinite polling according to delay/initialDelay.
>>>>>
>>>>> From the "Camel In Action" book, chapter 7, I see some examples of
>>>>> sending a text message with the Timer and Quartz components, but I
>>>>> can't quite see how to put that together to implement "kicking off
>>>>> routes at specified intervals", mentioned in the best practices list
>>>>> at the end of that chapter.  How would I use quartz to stop/start the
>>>>> FTP component, or the route that it's in?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Chris
>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> -
>>>> Red Hat, Inc.
>>>> FuseSource is now part of Red Hat
>>>> Email: cib...@redhat.com
>>>> Web: http://fusesource.com
>>>> Twitter: davsclaus
>>>> Blog: http://davsclaus.com
>>>> Author of Camel in Action: http://www.manning.com/ibsen


Re: Camel Aggregator Strategy Question

2013-03-18 Thread Pontus Ullgren
Hello,

The file component will by default poll all files that are available
in the directory.
You could then use the aggregator EIP [1] and your own custom
aggregation strategy to combine the files.

Possibly you could also use a custom route policy to restrict the
polling of files until all files are available.

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

Just my $0.02
// Pontus

On Mon, Mar 18, 2013 at 10:42 AM, Joe San  wrote:
> Camel Users,
>
> I need to acheive the following scenario:
>
> I have a file system where 3 different CSV files will be written, csv1,
> csv2 and csv3. All these 3 files will be available at the same time. I need
> to read all the three files, do some processing on iut and produce one CSV
> file as a result.
>
> The question that I have here is, do I need to know the name of the csv
> files in advance to read them from the file system? or is there a way to
> read multiple files at once and get the file contents from the file name
> where the file name is available as a header?
>
> Regards,
> Joe


Re: How to schedule FTP with quartz?

2013-03-18 Thread Pontus Ullgren
Hello Chris,

On Mon, Mar 18, 2013 at 8:54 PM, Chris Wolf  wrote:
> Claus,
>
> I have a few further questions about CronScheduledRoutePolicy.  I
> noticed that it has setters such as setRouteStartTime,
> setRouteStopTime, each which takes a cron expression string.  What I'm
> looking for is to be able to use a cron expression for the start, but
> a relative time length for stop.   Otherwise, I need to write code to
> parse the start time expression, then calculate a stop time cron
> expression.  Any ideas?
>
Depending on your needs you could enable "sendEmptyMessageWhenIdle" on
the endpoint and then suspend the route when you receive a empty
message. Which means that there is no more files to poll at the
moment.
You can use the content based route EIP for this.

Another solution would be to write your own RoutePolicy to take care
of your needs.

I just started to wonder if it might be possible to combine the
CronScheduledRoutePolicy with a SimpleScheduledRoutePolicy.
I have _not_ tested this so I'm not sure if it works. It might be that
there is a collision in the way they work with Quartz.

> Also I see that CronScheduledRoutePolicy has setRouteResumeTime,
> setRouteSuspendTime such that for my FTP poll window, I could either
> do start/stop or resume/suspend - which is recommended?
>
I would highly recommend resume/suspend.
I've had some thread leak problem with the file component when it was
repetitively started/stopped.

// Pontus

> Thanks,
>
> Chris
>
> On Sat, Mar 2, 2013 at 1:43 AM, Claus Ibsen  wrote:
>> Hi
>>
>> See about route policy
>> http://camel.apache.org/routepolicy
>>
>> And the scheduled route policy
>> http://camel.apache.org/scheduledroutepolicy.html
>>
>> On Sat, Mar 2, 2013 at 12:15 AM, Chris Wolf  wrote:
>>> I have a requirement to download files via FTP during a certain time
>>> window and according to a schedule. e.g. Only on trading days between
>>> 6:30AM and 7:00AM.  The FTP component, alone, seems to just do
>>> indefinite polling according to delay/initialDelay.
>>>
>>> From the "Camel In Action" book, chapter 7, I see some examples of
>>> sending a text message with the Timer and Quartz components, but I
>>> can't quite see how to put that together to implement "kicking off
>>> routes at specified intervals", mentioned in the best practices list
>>> at the end of that chapter.  How would I use quartz to stop/start the
>>> FTP component, or the route that it's in?
>>>
>>> Thanks,
>>>
>>> Chris
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: cib...@redhat.com
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen


Re: Copy Files with doneFile in different Folder

2013-02-26 Thread Pontus Ullgren
(Shamless promo for own project)
Or if you are running windows you can look at camel-smb
(https://github.com/Redpill-Linpro/camel-smb)

// Pontus

On Tue, Feb 26, 2013 at 1:13 PM, Willem jiang  wrote:
> If the source and target directory is not on the same box, you need to check 
> the camel-ftp or camel-sftp component[1]
>
>
> [1]http://camel.apache.org/ftp2.html
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
> (English)
>   http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
>
> On Tuesday, February 26, 2013 at 7:30 PM, yxzhao wrote:
>
>> Hi all,
>>
>> We need to design a route as below.
>>
>> 
>> 
>> 
>> ...copy files from sourceDirectory to destDirectory...
>>
>> What about sourceDirectory and destDirectory are on different servers?
>>
>> Could anyone tell us if it's possible to get this done with camel existing
>> components or do we have to customize something for it?
>>
>> Thanks in advance for any help or hints.
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Copy-Files-with-doneFile-in-different-Folder-tp5728165.html
>> Sent from the Camel - Users mailing list archive at Nabble.com 
>> (http://Nabble.com).
>
>
>


Re: Event Driven Use Case

2013-02-04 Thread Pontus Ullgren
Hello Rakesh,

I would as you describe use the claimcheck EIP however I would not
create a separate seda queue for each request.

Here is a break down how I would do it.

Route A:
0. Make what you do before the call
1. Serialize the exchange just before making the service call and save it in
DB with UUID as key and a "timeout" timestamp at which point the
request times out.
2. Make the call.

Route B:
1. Listens for responses
2.  Retrieve the saved exchange state(using UUID) and enrich it with
information from the response.
Also make sure to handle cases where the UUID is not in the database
(time outs).
3. Continue to process the exchange.

Route C:
1. Use a timer to scan the database for requests that has expired.
2. Clean up the expired entries.

// Pontus Ullgren


On Sat, Feb 2, 2013 at 9:12 AM, Rakesh Sharma
 wrote:
> I am implementing a flow(route) using camel that requires interaction with
> multiple external systems via RestFul service calls. These service calls
> provide only an ACK back. The actual response is sent by external system by
> making another service call back to my application. My app is running in
> tomcat container on multiple machines fronted by a load balancer. The
> subsequent steps of my route are dependent on the response of the external
> service call. Having a load balancer complicates it further as external
> service response may not come to the same machine where the original service
> call was made from. I also need to timeout the exchange processing in case
> external service response does not come back within a specified time
> interval. I am thinking of using following strategy to solve this problem:
>
> 1. Break big route into multiple small routes. The last step of each small
> route will make the service call to the external system. Essentially, I will
> have as many routes as number of calls to external systems. The endpoint of
> every small route (other than the initial one) will be the service end-point
> where external service is going to come back with its response for the
> request that was sent by the last step of the previous route.
> 2. Serialize the exchange just before making the service call and save it in
> DB with UUID as key.
> 3. Create a consumer on SEDA endpoint "seda:{uuid}" with a timeout. It is
> being created only to track if external service provided a response back
> within the expected time interval.
> 4. Make the service call to external system with UUID as part of the
> request.
> 5. Retrieve the saved exchange state(using UUID) and remove the entry from
> DB as soon as external service responds(response has the same UUID that was
> passed with the request) back by invoking the next route endpoint. The route
> has the previous state(retrieved from DB) and response from the external
> system. It can proceed further now by merging the previous state and the
> external service response. We know that response did not come within
> expected interval if DB does not have an entry for the UUID extracted from
> the service response.
> 6. The SEDA consumer will timeout and will make a check if DB still has the
> entry. If entry exists we know that external service response has not come
> within the expected interval. The entry from DB will be removed.
>
> This is a very heavy traffic applications and I am not sure if I am doing it
> in right way. Any suggestion will be highly appreciated. Using messaging
> system is not an option due to many factors outside of my control.
>
> Thanks,
> Rakesh
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Event-Driven-Use-Case-tp5726809.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-smpp in trx mode

2013-01-13 Thread Pontus Ullgren
Agree, log and reject would be the best solution.

// Pontus

On Sun, Jan 13, 2013 at 12:01 PM, Christian Müller
 wrote:
> Yes, it's possible to share the jsmpp session, btw. we have to share it in
> this case (only one TRX connection is allowed).
> We could only log the received message, if no consumer route is defined.
> But may be this is not suitable for most of our users.
> We could also throw an exception at route/context start up, but this is not
> right in my opinion. Assume you do not expect to receive short message (you
> only send short message) and you send the messages with the flag that you
> are not interested in any delivery received message (part of the SMPP
> specification). In this case, you do not need a consumer route.
>
> The best solution I can think for this case (TRX mode connection and no
> consumer route) is to log the incomming message at WARN level (delivery
> receipt, short message, ...) and reject it. Than the SMSC should try to
> redeliver the short message at a later time and the user can fix this
> misconfiguration. What do you think?
>
> Best,
> Christian
>
> On Sun, Jan 13, 2013 at 11:31 AM, Pontus Ullgren  wrote:
>
>> Correction I was wrong on the direct endpoint restriction.
>>
>> I was thinking about the log message that occurs when a exchange is
>> send to a direct endpoint without a consumer. So perhaps there is no
>> way to determine if there is a corresponding consuming endpoint at
>> start.
>>
>> On Sun, Jan 13, 2013 at 11:19 AM, Pontus Ullgren 
>> wrote:
>> > On Sat, Jan 12, 2013 at 6:47 PM, Christian Müller
>> >  wrote:
>> >> The smslib model is a bit different. The smslib camel consumer pull the
>> >> short messages for the SMSC. And only if a consumer is defined (
>> >> from("smslib://...") ).
>> >> In the smpp Camel component, the SMPP library push the short messages
>> (and
>> >> delivery receipt messages) to the client if the client is connected in
>> the
>> >> TRX mode.
>> >> Assume there is only one producer ( to("smpp://...") ) defined and no
>> >> consumer. The SMPP library push the message to the client. Because
>> there is
>> >> no Camel consumer, there is no route which can
>> consume/handle/process/...
>> >> this message. What is a good/acceptable behavior in this case?
>> >>
>> > Not sure what the JSMPP library allows us to do but on a protocol level
>> you can
>> > reply with a deliver_sm_resp to indicate a failed command_status.
>> Perhaps this
>> > is a solution if there is no consuming endpoint.
>> >
>> > Another solution would be to refuse to start the producer endpoint in
>> > trx mode if
>> > there is no corresponding consuming endpoint defined. If I do not
>> > remember incorrectly
>> > a similar restriction applies to direct endpoints ?
>> >
>> > // Pontus
>> >
>> >
>> >> Best,
>> >> Christian
>> >>
>> >> On Thu, Jan 10, 2013 at 1:37 PM, Alex Anderson > >wrote:
>> >>
>> >>> On 4 January 2013 17:26, Christian Müller > >
>> >>> wrote:
>> >>> > I think we don't have another camel component where the endpoint is a
>> >>> > consumer and producer. I'm not sure how/if it works or if we hit
>> problems
>> >>> > in other areas (exception handling, ...).
>> >>>
>> >>> We do this for the camel-smslib component.  The endpoint represents a
>> >>> serial connection to an SMS modem, and therefore must deal with either
>> >>> sending or receiving of messages or both.  I have no idea if this is a
>> >>> recommended approach from camel perspective, but it works for us.  My
>> >>> interpretation of the camel doc was that returning `true` from
>> >>> Endpoint.isSingleton() should allow for one Endpoint per URI, but
>> >>> multiple consumers/producers tied to the Endpoint.
>> >>>
>> >>> You can see example at
>> >>>
>> >>>
>> https://github.com/frontlinesms/camel-smslib/blob/master/src/main/java/net/frontlinesms/camel/smslib/SmslibEndpoint.java
>> >>>
>> >>
>> >>
>> >>
>> >> --
>>
>
>
>
> --


Re: camel-smpp in trx mode

2013-01-13 Thread Pontus Ullgren
Correction I was wrong on the direct endpoint restriction.

I was thinking about the log message that occurs when a exchange is
send to a direct endpoint without a consumer. So perhaps there is no
way to determine if there is a corresponding consuming endpoint at
start.

On Sun, Jan 13, 2013 at 11:19 AM, Pontus Ullgren  wrote:
> On Sat, Jan 12, 2013 at 6:47 PM, Christian Müller
>  wrote:
>> The smslib model is a bit different. The smslib camel consumer pull the
>> short messages for the SMSC. And only if a consumer is defined (
>> from("smslib://...") ).
>> In the smpp Camel component, the SMPP library push the short messages (and
>> delivery receipt messages) to the client if the client is connected in the
>> TRX mode.
>> Assume there is only one producer ( to("smpp://...") ) defined and no
>> consumer. The SMPP library push the message to the client. Because there is
>> no Camel consumer, there is no route which can consume/handle/process/...
>> this message. What is a good/acceptable behavior in this case?
>>
> Not sure what the JSMPP library allows us to do but on a protocol level you 
> can
> reply with a deliver_sm_resp to indicate a failed command_status. Perhaps this
> is a solution if there is no consuming endpoint.
>
> Another solution would be to refuse to start the producer endpoint in
> trx mode if
> there is no corresponding consuming endpoint defined. If I do not
> remember incorrectly
> a similar restriction applies to direct endpoints ?
>
> // Pontus
>
>
>> Best,
>> Christian
>>
>> On Thu, Jan 10, 2013 at 1:37 PM, Alex Anderson wrote:
>>
>>> On 4 January 2013 17:26, Christian Müller 
>>> wrote:
>>> > I think we don't have another camel component where the endpoint is a
>>> > consumer and producer. I'm not sure how/if it works or if we hit problems
>>> > in other areas (exception handling, ...).
>>>
>>> We do this for the camel-smslib component.  The endpoint represents a
>>> serial connection to an SMS modem, and therefore must deal with either
>>> sending or receiving of messages or both.  I have no idea if this is a
>>> recommended approach from camel perspective, but it works for us.  My
>>> interpretation of the camel doc was that returning `true` from
>>> Endpoint.isSingleton() should allow for one Endpoint per URI, but
>>> multiple consumers/producers tied to the Endpoint.
>>>
>>> You can see example at
>>>
>>> https://github.com/frontlinesms/camel-smslib/blob/master/src/main/java/net/frontlinesms/camel/smslib/SmslibEndpoint.java
>>>
>>
>>
>>
>> --


Re: camel-smpp in trx mode

2013-01-13 Thread Pontus Ullgren
On Sat, Jan 12, 2013 at 6:47 PM, Christian Müller
 wrote:
> The smslib model is a bit different. The smslib camel consumer pull the
> short messages for the SMSC. And only if a consumer is defined (
> from("smslib://...") ).
> In the smpp Camel component, the SMPP library push the short messages (and
> delivery receipt messages) to the client if the client is connected in the
> TRX mode.
> Assume there is only one producer ( to("smpp://...") ) defined and no
> consumer. The SMPP library push the message to the client. Because there is
> no Camel consumer, there is no route which can consume/handle/process/...
> this message. What is a good/acceptable behavior in this case?
>
Not sure what the JSMPP library allows us to do but on a protocol level you can
reply with a deliver_sm_resp to indicate a failed command_status. Perhaps this
is a solution if there is no consuming endpoint.

Another solution would be to refuse to start the producer endpoint in
trx mode if
there is no corresponding consuming endpoint defined. If I do not
remember incorrectly
a similar restriction applies to direct endpoints ?

// Pontus


> Best,
> Christian
>
> On Thu, Jan 10, 2013 at 1:37 PM, Alex Anderson wrote:
>
>> On 4 January 2013 17:26, Christian Müller 
>> wrote:
>> > I think we don't have another camel component where the endpoint is a
>> > consumer and producer. I'm not sure how/if it works or if we hit problems
>> > in other areas (exception handling, ...).
>>
>> We do this for the camel-smslib component.  The endpoint represents a
>> serial connection to an SMS modem, and therefore must deal with either
>> sending or receiving of messages or both.  I have no idea if this is a
>> recommended approach from camel perspective, but it works for us.  My
>> interpretation of the camel doc was that returning `true` from
>> Endpoint.isSingleton() should allow for one Endpoint per URI, but
>> multiple consumers/producers tied to the Endpoint.
>>
>> You can see example at
>>
>> https://github.com/frontlinesms/camel-smslib/blob/master/src/main/java/net/frontlinesms/camel/smslib/SmslibEndpoint.java
>>
>
>
>
> --


Re: Camel Tracer Component - problem with persistence

2012-12-20 Thread Pontus Ullgren
My experience is that I have still had problems getting later versions
(2.9.x) working on JBoss 5.1.0.GA and JBoss 6.
So I still use the JBoss resolver to get things working.

But then again I've not put that much effort into finding the reason I
simply added the resolver and it started working.

Just my $0.02.

Happy holidays
// Pontus


On Thu, Dec 20, 2012 at 12:30 PM, BAnanth  wrote:
> camel-example-cxf-tomcat_-_tracer.zip
> 
>
> Hi Christian,
>
> I am not able to upload the WAR file(size of the file is huge).
>
> I am however sending the entire source content as a Zip. This has to be put
> and extracted in the camel/examples folder and built.  (Trust this is fine)
>
> We have tried o replicate the problem in camel-example-cxf-tomcat example.
>
>
> Thanks!.
>
> Regards,
> Bhavani
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Tracer-Component-problem-with-persistence-tp5724262p5724443.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: I created a basic file-unzip camel component...

2012-12-08 Thread Pontus Ullgren
I do not agree with you.
The current data formater do support compressing files with the zip
alorithm but from what I can tell clarkcb has created a processor that
do handle multi-file archives. Something the current data formater
does not handle.

However Gunnar Hillert has a similar processor:
http://hillert.blogspot.se/2009/10/camellos-iii-zipping-files-with-apache.html

Based on Hillerts code I've also created a aggretion strategy that
compresses multiple exchanges into one zip file (not yet published but
will come to a github repo soon).

So clarkcb do as Willem suggest. Create a github repo and publish your
code for comments. Preferably I would see a patch to the existing zip
dataformater to support multi file archives.

// Pontus

On Sat, Dec 8, 2012 at 4:03 AM, Hadrian Zbarcea  wrote:
> It does work with files, i.e. messages are the file content. There is also a
> camel-exec that is easy to use. Unfortunately I don't think your
> contribution would be a good addition to the camel distro.
>
> Thanks for using Camel though and we appreciate your contribution.
> Hadrian
>
>
> On 12/07/2012 01:41 AM, clarkcb wrote:
>>
>> Hi Willem,
>>
>> My understanding is that the existing zip and unzip marshalling are for
>> messages, not files. Please see this topic:
>> http://camel.465427.n5.nabble.com/Zip-format-problem-td477268.html
>>   .
>>
>> Please correct me if I'm wrong, but it seems like a file-unzip component
>> would satisfy an existing need.
>>
>> Thanks.
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/I-created-a-basic-file-unzip-camel-component-tp5723748p5723750.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>


Re: Windows 2003 server mount

2012-09-13 Thread Pontus Ullgren
Hello,

I would guess that the problem is just that. Since tomcat is running
as the System account it does not have the same mapped driver.

Have you tried to access the share not using the mount letter (h:) but
using a UNC path instead (\\server\share\file_path) ?

Also make sure that the tomcat service is running as a user that has
permission to access the driver.
Or you can try the camel-smb component [1] which lets you specify the
user to use when accessing the share.

[1] https://github.com/Redpill-Linpro/camel-smb
Best regards
Pontus Ullgren



On Thu, Sep 13, 2012 at 12:40 PM, mathbarth
 wrote:
>
> Camel 2.10.1 traces the following warning message when starting the route:
>
> "Cannot auto create starting directory h:/myRemoteFolder"
>
> Mount is alright and I can create folder manually.
>
> Camel is loaded within a Spring web application in the Apache tomcat
> container. I guess that I mistake the permissions of the windows user
> starting the tomcat service...
>
> Mathieu
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Windows-2003-server-mount-tp5719101p5719268.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using correlationid to isolate jms queues in multiple camelContexts

2012-09-12 Thread Pontus Ullgren
Hello,

The way you see it behave is the way it should behave. If you have
competing consumers on a queue they will consume messages in that way.

If I interpreted your requirement correctly you have messages from a#
that can only be consumed by c# and messages from b# that can only be
consumed by d#.
In that case you should really use two different queues for this one
between each pair of producer and consumer.

Adding extra queues in activemq is simple and very low cost when it
comes to resources. So I would advice you to solve it this way.

If you for some reason still want to use one queue (legacy, crazy
customer requirement or let's say that you are building a example for
bad architecture ;-P) then you can set a header on the messages in the
producer and then use a selector in the consumer. See the
documentation on the Camel JMS component[1] and the JMS component unit
test.

But again: Use two queues.

[1] http://camel.apache.org/jms.html
[2] 
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSelectorTest.java
Best regards
Pontus Ullgren


On Wed, Sep 12, 2012 at 7:18 PM, garrydias  wrote:
> Dear friends
>
> I´m facing the folowing problem: I have 2 producers systems sending messages
> to 1 jms queue that is consumed by 2 consumers systems. Ignore the VM where
> they are.
>
> #a) a producerSystem_1.war has the folowing camelContext:
>
> 
>   ...
>   
> 
> 
>   
>   ...
> 
>
>
> #b) a producerSystem_2.war has the folowing camelContext:
>
> 
>   ...
>   
> 
> 
>   
>   ...
> 
>
>
> #c) a consumerSystem_1.war has the folowing camelContext:
>
> 
>   
> 
> 
>   
> 
>
>
> #d) a consumerSystem_2.war has the folowing camelContext:
>
> 
>   
> 
> 
>   
> 
>
>
> The VM where these applications are running is not important.
>
> My *desired behavior *is:
> - Messages produced in #a must consumed in c#
> - Messages produced in #b must consumed in d#
>
> The *actual behavior* is:
> - Messages produced in #a sometimes is consumed in c# and sometimes in d#
> - Messages produced in #b sometimes is consumed in c# and sometimes in d#
>
> I understand that JMS endpoints were designed to execute in the *actual
> behavior*. But in this case, I need to run *my desired *behavior.
>
> There´s a way to do this using correlationIds (not send/receive approach)?
>
> Thanx a lot
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Using-correlationid-to-isolate-jms-queues-in-multiple-camelContexts-tp5719202.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


  1   2   >