Re: Camel jms - In Out Pattern

2016-05-18 Thread Henryk Konsek
Hi,

You don't have to send message to the response queue. Camel will create a
temporary response queue for you:

  from("jms:foo").setBody().constant("myresponse");
  ...
  String response = producerTemplate.requestBody("jms:foo", "body",
String.class);
  assertThat(response).isEqualTo("myresponse");

This is pretty convenient comparing to managing reply queue by yourself.

Cheers!

śr., 18.05.2016 o 09:22 użytkownik Adarsh_GU <adarsh.unnit...@ibsplc.com>
napisał:

> Hi, iam new to camel,Im trying to implement a synchronous request-reply
> mechanism using camel component.
> I have 2  wmq queues
> *1. requestQuee - application will send requests to this queue
> 2. responseQueue  - application will have to listen & receive response from
> this queue *
>
>
> /   
>  
>  
> uri="jms:queue:requestQuee?replyTo=queue:responseQueueexchangePattern=InOut"
> />
>/
>
>
>  /  
>uri="jms:queue:requestQuee?concurrentConsumers=5"/>
>   
>   
>/
>
>
> bean jmsResponseListener having logic
> public class MockResponseGenerator implements Processor{
> /
> public void process(Exchange ex) throws Exception {
> ex.getIn().setBody("mockresponse");
> String msgid=(String) ex.getIn().getHeader("JMSMessageID");
> if(msgid != null){
> ex.getIn().setHeader("JMSCorrelationID",msgid);
>
> }
> }
>
> }/
>
> *I getting error as follows,it is observed that. message is en queued to
> requestQuee , but not de queued.*
>
>
> /Caused by: org.apache.camel.ExchangeTimedOutException: The OUT message was
> not received within: 2 millis due reply message with correlationID:
> Camel-ID-ICB1864-58611-1463553066644-3-9 not received on destination:
> queue://responseQueue.
> Exchange[ID-ICB1864-58611-1463553066644-3-8][Message:
> 
> *If i remove inout pattern.message is en queued to requestQuee and after
> dequeed by mockresponse route ,eventually MockResponseGenerator  prepares
> mock response and enqueued to responseQueue.*
>
> Please update your suggestions to achieve the same. Thanks :)
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-jms-In-Out-Pattern-tp5782730.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
https://linkedin.com/in/hekonsek


Re: A silly idea?

2016-01-14 Thread Henryk Konsek
Hi Kay,

Those extra functionalities are outside the scope of the Camel. This is
usually where higher level runtime frameworks/servers like Spring Boot,
Karaf, etc. kicks in. So just choose the right runtime  for your purposes
(I personally prefer Spring Boot) and use Camel integration module
dedicated for this runtime (like camel-spring-boot).

Cheers!

czw., 14.01.2016 o 07:37 użytkownik Kay <seey...@gmail.com> napisał:

> Hello, I'm new to this forum, but I've used camel for a long time. ( as a
> matter of fact, I can't imagine the thing that I am able to do my java
> project without camel ). Anyway, a question teased me whenever I use Camel.
> The question was "why is there no base framework for only camel?" In the
> other word, I believe it would be better if there was a certain
> light-weighted environment supporing camel with some better functionalities
> like concurrency, extensibility, hot deploy. So, when I told my colleague
> about this idea, he replied, "Use zookeeper for failure tolerance, use OSGI
> for hot deploy, use Storm or Spark for data distribution. You don't need to
> build another similar thing for your own purpose." But I can't make certain
> with his words because I can't understand the reason why I should control
> so
> many applications for my project. I just want a light-weighted all-in-one
> package. Is building such an all-in-one package for camel a silly idea? How
> do you think about that?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/A-silly-idea-tp5776224.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: calling a spring bean inside an OSGI based project

2016-01-05 Thread Henryk Konsek
To use Spring, you have to stick to Spring DM configuration. Which is not
maintained anymore. So using Spring in OSGi creates more problem than it
solves.

If you want to use Spring I recommend dropping OSGi on the behalf of the
Spring Boot running as fat jar or WAR.

Cheers!

wt., 5.01.2016 o 11:54 użytkownik Meissa Sakho <mbsa...@gmail.com> napisał:

> Hi Greg,
> I've already reviewed this links above.
> You can't define a spring bean inside yous OSGI configuration. It won't
> work.
> Let me first explain to you why I need to do it.
> I need to use the Spring JdbcTemplate component because to leverage the
> stored procedure abstraction.
> I do that because either the JPA component,sql or jdbc component do not
> provide this feature.
> I've found another workaround so far.
> But if you know a working solution for that (calling a spring bean from a
> blueprint), let me know.
> Thans,
> Meissa
>
> 2016-01-04 17:35 GMT+01:00 Greg Autric <gaut...@redhat.com>:
>
> > hi Meissa,
> >
> >
> > Blueprint configuration uses "almost" the same syntax and behavior than
> > Spring XML.
> > IMHO, I dislike use a mix of spring conf and blueprint conf.
> > Your spring configuration should work w/ few modifications into your
> > blueprint [1].
> >
> > [1]
> >
> http://fuseesb.blogspot.fr/2014/10/what-is-differences-between-camel.html
> >
> > an other useful link :
> > http://camel.apache.org/using-osgi-blueprint-with-camel.html
> >
> > Greg AUTRIC
> > JBoss Middleware Consultant
> >
> > email   : gautric __at__ redhat __dot__ com
> > twitter : @gautric_io
> >
> > Red Hat Global Services
> > Red Hat France SARLsit: http://www.redhat.fr
> > Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
> > Sent from webmail
> >
> > - Mail original -
> > De: "Meissa Sakho" <mbsa...@gmail.com>
> > À: users@camel.apache.org
> > Envoyé: Mardi 22 Décembre 2015 12:37:29
> > Objet: calling a spring bean inside an OSGI based project
> >
> > Hi all,
> > I have created a restfull web service based on apache cxf with camel.
> > My endpoint is defined inside my blueprint configuration file like below:
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> > > "com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> >   
> >
> > 
> >
> > 
> >
> >  
> >
> >
> > I would like to Inject the Spring JdbcTemplate that I've defined in my
> > Spring configuration file to my BookingService business class.
> >
> > My question is :
> >
> > How can I a load and inject a Spring bean inside a OSGI based Bean?
> >
> > Thank you in advance,
> >
> > Meissa
> >
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: The Camel Name - Just A Thought

2015-12-10 Thread Henryk Konsek
Whoever is the smoker you refer to, he has great taste in cigarettes. I
also used to be chain-smokers of Camels several years ago ;) .

Cheers!

czw., 10.12.2015 o 16:48 użytkownik Claus Ibsen <claus.ib...@gmail.com>
napisał:

> On Thu, Dec 10, 2015 at 4:39 PM, Raul Kripalani <ra...@apache.org> wrote:
> > I would also venture a guess that the name Camel has something to do with
> > another platform called Mule back in 2006-2007 :)
> >
>
> Only one person really knows. And he was smooking cigarettes back then ;)
> But yeah a Camel is the strongest of all the beast of burdens. Mules
> are dumb ass donkeys.
>
>
>
> > Regards,
> > Raúl.
> >
> > On Thu, Dec 10, 2015 at 3:26 PM, Claus Ibsen <claus.ib...@gmail.com>
> wrote:
> >
> >> Yeah and there is some other reasons here
> >> http://camel.apache.org/why-the-name-camel.html
> >>
> >> On Thu, Dec 10, 2015 at 4:10 PM, gbchriste <gary.christe...@gmail.com>
> >> wrote:
> >> > Section 1.1 of Camel In Action says, "The Apache Camel project was
> named
> >> > Camel simply because the name is short and easy to remember."
> >> >
> >> > But here's a thought.  When you think about it, the name "Camel" is so
> >> > appropriate to the notion of what Camel does that you'd think the name
> >> was
> >> > chosen on purpose.  Even the picture of the Bedouin fits.
> >> >
> >> > For the nomadic, desert-dwelling people of ages past, the camel was
> the
> >> key
> >> > method of transport, and was essential to creating and maintaining the
> >> lines
> >> > of communication that connected distant communities.  Individuals,
> >> families,
> >> > trade goods of all kinds, and messages were all carried back and
> forth by
> >> > caravans of camels.
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://camel.465427.n5.nabble.com/The-Camel-Name-Just-A-Thought-tp5774938.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
> >>
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: Shutdown sequence when running Camel in Springboot

2015-12-10 Thread Henryk Konsek
Yes. CamelContext is wired as a Spring bean with registered shutdown
method, so calling Spring's shutdown will close CamelContext in the first
place before closing Spring context.

Cheers!

czw., 10.12.2015 o 20:25 użytkownik raffi <raffi.onj...@gmail.com> napisał:

> With respect to graceful shutdown, does Springboot hook into Camel such
> that
> invoking Springboot's standard "/shutdown" endpoint automatically shuts
> down
> Camel first, then the JVM?
>
> Trying to understand if explicit shutdown hooks are requried.
>
> Best
> Raffi
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Shutdown-sequence-when-running-Camel-in-Springboot-tp5774960.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: Camel and Activemq setup with Spring Boot

2015-12-05 Thread Henryk Konsek
Hi,

Spring Boot creates connectionFactory bean for you. It is named
"jmsConnectionfactory" [1]. In order to wire Camel with Spring Boot AMQ
support, you have to refer that bean from JMS component URI:

  from("jms:queue?connectionFactory=#jmsConnectionfactory").to(...);

Simple as that :)

Cheers!

[1]
https://github.com/spring-projects/spring-boot/blob/90f7bc03216c709634ea7ffd3832482e25e0ace3/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfiguration.java#L45

sob., 5.12.2015 o 15:01 użytkownik zpyoung <zpyo...@gmail.com> napisał:

> Really just trying to make sure I understand how the configuration works.
> If
> I auto configure activemq with Spring Boot, I have noticed that an activemq
> component is also created in the camel context.  Is Spring Boot creating
> this component or the camel context?
>
> So when I need to have a component configured differently, should I make
> the
> configuration changes on the endpoint or just create a different component?
>
> Are there really any differences between these two configurations?
>
> ---
> create new component to handle transaction.
>@Bean
> public ActiveMQComponent activemqtx(PooledConnectionFactory
> pooledConnectionFactory) {
> ActiveMQComponent activeMQComponent = new ActiveMQComponent();
> activeMQComponent.setTransacted(true);
> activeMQComponent.setTransactionManager(new
> JmsTransactionManager(pooledConnectionFactory));
> return activeMQComponent;
> }
>
>from("activemq:TRIGGER").routeId("Trigger")
> .onException(Exception.class)
> .maximumRedeliveries(2)
> .to("activemq:EXCEPTION")
> .markRollbackOnlyLast().end()
> .transacted()
> .bean("jpaRepository")
> .to("log:out");
>
> Or just configure the enpoint.
>
>from("activemq:TRIGGER?transacted=true").routeId("Trigger")
> .onException(Exception.class)
> .maximumRedeliveries(7)
> .to("activemq:EXCEPTION")
> .markRollbackOnlyLast().end()
> .transacted()
> .bean("jpaRepository")
> .to("log:out");
>
>
> I'm guessing that creating a component allows for better reuse if you have
> several routes using the same configuration.
>
> Sample code I have been testing with
> https://github.com/zachariahyoung/docker-camel
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-and-Activemq-setup-with-Spring-Boot-tp5774544p5774728.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: Columns order in ResultSetIterator

2015-11-20 Thread Henryk Konsek
Hi,

Can you create a pull request with the fix? It looks like a low hanging
fruit.

Cheers!

pt., 20.11.2015 o 14:30 użytkownik ftoresan <fabricio.tore...@gmail.com>
napisał:

> I'm using the JDBC component, and when I retrieve the columns from a
> ResultSetIterator using the method getColumns they are returned randomly. I
> expected to receive them in the same order they appear in the query
> projection.
>
> The problem is the use of a HashSet instead of a LinkedHashSet to return
> the
> list of columns inside the ResultSetIterator implementation. Is there a
> simple way to get the columns in the right order? Is it possible to change
> the behaviour of this method?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Columns-order-in-ResultSetIterator-tp5774150.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: Using BeanInvocation in camel cxf

2015-11-17 Thread Henryk Konsek
Hi Kasim,

Your route should work - it looks fine (just replace BeanInvocation
with BeanInvocation.class).
Can you send us the stacktrace you see?

Cheers!

wt., 17.11.2015 o 16:08 użytkownik Steve Huston <shus...@riverace.com>
napisał:

> I have this excerpt from a Camel route in blueprint XML:
>
>   
>  
>  
> 
>   
>...
> 
>
> > -Original Message-
> > From: Kasim Sert (Ibtech-Software Infrastructure)
> > [mailto:kasim.s...@ibtech.com.tr]
> > Sent: Tuesday, November 17, 2015 4:23 AM
> > To: users@camel.apache.org
> > Subject: Using BeanInvocation in camel cxf
> >
> > Hi,
> >
> > I am trying to develop a framework to invoke different web services based
> > on their db definitions of SEI names and web method names and parameters
> > etc.
> >
> > To make this I found how to generate and BeanInvocation object from
> > current web service definition. However I could not find any example on
> how
> > to invoke this beaninvocation object.
> >
> > Should it be something like :
> >
> > From(direct:start)
> > .bean(BeanInvocation,"invoke")
> >
> > When I try this I get null pointer and even I dont know if this is right
> way to
> > go.
> >
> > Can anybody send an example usage on camel routes please ?
> >
> >
> > [Facebook]<http://www.facebook.com/Finansbank>  [Twitter]
> > <http://twitter.com/finansbank>
> >
> > [https://www.finansbank.com.tr/Disclaimer/BannerImages.aspx?date=17.11
> > .201511:2300]<https://www.finansbank.com.tr/Disclaimer/Bannerlink.aspx?
> > date=17.11.201511:2300>
> >
> >
> > Bu e-posta'n?n i?erdi?i bilgiler (ekleri dahil olmak ?zere) gizlidir.
> Onay?m?z
> > olmaks?z?n ???nc? ki?ilere a?iklanamaz. Bu mesaj?n g?nderilmek istendi?i
> > ki?i de?ilseniz, l?tfen mesaj? sisteminizden derhal siliniz. IBTech A.?.
> bu
> > mesaj?n i?erdi?i bilgilerin do?rulu?u veya eksiksiz oldu?u konusunda bir
> > garanti vermemektedir. Bu nedenle bilgilerin ne ?ekilde olursa olsun
> > i?eri?inden, iletilmesinden, al?nmas?ndan, saklanmas?ndan sorumlu
> de?ildir.
> > Bu mesaj?n i?eri?i yazar?na ait olup, IBTech A.?.'nin g?r??lerini
> i?ermeyebilir.
> >
> > The information contained in this e-mail (including any attachments)is
> > confidential. It must not be disclosed to any person without our
> authority. If
> > you are not the intended recipient, please delete it from your system
> > immediately. IBTech A.S. makes no warranty as to the accuracy or
> > completeness of any information contained in this message and hereby
> > excludes any liability of any kind for the information contained therein
> or for
> > the information transmission, reception, storage or use of such in any
> way
> > whatsoever. Any opinions expressed in this message are those of the
> author
> > and may not necessarily reflect the opinions of IBTech A.S.
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: spring boot test mocks

2015-11-16 Thread Henryk Konsek
Hi,

Yes, @MockEndpoints annotation is not supported at the moment. This is a
feature that has to be coded and added to our Spring Boot module.

As a workaround you can define your mocked endpoint like:

  from("from...").to("{{target:jms:queue}}");

And then set the target=direct:queue for the tests using the Spring Boot
@IntegrationTest("target=direct:queue") annotation.

Also you are more than welcome to contribute @MockEndpoints support. It is
on my TODO list, but not with high priority.

Cheers!

pon., 16.11.2015 o 09:32 użytkownik Joakim Bjørnstad <joak...@gmail.com>
napisał:

> Hello,
>
> Doesn't seem like there is any support for @MockEndpoints and
> @MockEndpointsAndSkip with Spring Boot and Camel at the moment.
>
> The reason for this is that the CamelSpringTestContextLoader is never
> loaded. Typically you use:
>
> @RunWith(CamelSpringJUnit4ClassRunner.class)
> @BootstrapWith(CamelTestContextBootstrapper.class)
>
> Together with @SpringApplicationConfiguration, it goes directly to the
> SpringApplicationContextLoader and thus Camel test annotations are not
> loaded.
>
> Please see https://issues.apache.org/jira/browse/CAMEL-7963
>
> On Mon, Nov 16, 2015 at 2:40 AM, Minh Tran <minh.t...@winning.com.au>
> wrote:
> > Hi
> >
> > I’m trying to write unit tests in camel 2.16.0 and spring boot.
> >
> > My route looks like
> >
> > from(“direct:start”).to(“direct:end”)
> >
> > My unit test looks like
> >
> > @RunWith(SpringJUnit4ClassRunner.class)
> > @SpringApplicationConfiguration(classes = Config.class)
> > @MockEndpoints
> > public class MyUnitTest {
> >
> >   @Produce(uri=“direct:start”)
> >   private ProducerTemplate producer;
> >
> >   @EndpointInject(uri=“mock:direct:end”)
> >   private MockEndpoint end;
> >
> > @Test
> > public void testMock() throws InterruptedException {
> > end.expectedBodiesReceived("blah");
> > producerTemplate.sendBody("blah");
> > end.assertIsSatisfied();
> > }
> >
> > }
> >
> > It looks like the direct:end bit is never mocked so the assertion fails.
> It’s like @MockEndpoints is completely ignored.
> >
> > Is this the correct way to mock existing components when using spring
> boot? Thanks.
>
>
>
> --
> Kind regards
> Joakim Bjørnstad
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: How to read XML Payload

2015-11-03 Thread Henryk Konsek
Hi,

Have you taken a look at the XPath splitter by any chance?

Cheers!

wt., 3.11.2015 o 12:31 użytkownik calyan.bandi <calyan.ba...@gmail.com>
napisał:

> Hi,
>
> Could someone please provide me the syntax for reading the XML payload with
> only the relevant tags. My input XML contains data as below:
>
> 
> 
>  ...
> 
> 
>  
>  
>  
>  
>  
>  
>  
>  
>  
> 
> 
>
> I need to split the input XML and do custom processing for each individual
> customer. The XML after splitting should look as below i.e., from the
> entire
> XML i should split only the 'customer' tags contained in the Body and the
> non-body tags should remain untouched and added to the output XML.
>
> 
> 
>  ...
> 
> 
>  
>  
>  
> 
> 
>
>
> Any thoughts, please share.
>
> Thanks,
> Kalyan
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-read-XML-Payload-tp5773337.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: Share database connection pool among routes

2015-10-21 Thread Henryk Konsek
Hi,

Add you data source to your Camel registry [1]. For example for Spring that
would be just adding data source bean. Then refer to that data source in
your endpoints. For example:

@Bean
DataSource myDataSource() {
  ...
}

from("timer:dbOperation").to("jdbc:myDataSource");

Cheers!

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

śr., 21.10.2015 o 09:42 użytkownik ramnar <raam.s...@gmail.com> napisał:

> Hi
> I want to share the database connection poll among various routes i
> have.Iam
> using apache common dbcp to implement database connection pooling.Some
> where
> it was mentioned to create osgi service of the connection pool and use the
> service in all the routes.But I could not find resources how to do it.Any
> pointer s to it .Thanks in advance
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Share-database-connection-pool-among-routes-tp5772925.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: Custom endpoint configuration and Spring Boot

2015-09-25 Thread Henryk Konsek
Hi Jimmy,

If you would like to provide different destination resolvers for different
environments, use Spring Boot conditionals. For example:

@ConditionalOnProperty(name = "env", matchIfMissing = true)
@Bean(name="wmq")
DestinationResolver devdestinationResolver() {...}

@ConditionalOnProperty(name = "env", havingValue = "production")
@Bean(name="wmq")
DestinationResolver prodDestinationResolver() {...}

@ConditionalOnProperty(name = "env", havingValue = "staging")
@Bean(name="wmq")
DestinationResolver stagingDestinationResolver() {...}

Cheers!

pt., 25.09.2015 o 15:08 użytkownik Jimmy Selgen Nielsen <
jimmy.sel...@gmail.com> napisał:

>
> > On 25. sep. 2015, at 14.18, Henryk Konsek <hekon...@gmail.com> wrote:
> >
> > Hi Jimmy,
> >
> > If you would like to create a simple URI for the pre-configured
> component,
> > then Claus suggestion to create a Spring bean with name/alias matching
> your
> > target component, is a way to go. Register the pre-configured JMS
> component
> > via:
> >
> > @Bean(name = "wmq")
> > JmsComponent myWmqComponent() {
> >  JmsComponent  jmsComponent = new JmsComponent();
> >
> >  jmsComponent.setDestinationResolver(new MQDestinationResolver());
> >
> >  return jmsComponent;
> > }
> >
> >
> > Then use the "wmq" bean name in the endpoint URI:
> >
> >
> >  from("wmq:myQueue").to(…);
> >
>
> I was looking into this.
>
> I have multiple environments that i configure destination resolvers
> dynamically for, so it would have required manually registering them in the
> Spring context, which IIRC is a lot more work.
>
> I could use a BeanDefinitionRegistryPostProcessor, but since the
> destinationResolvers configuration is auto wired in, that wouldn’t work.
>
> I’ll keep looking at this when i have time, but for now the workaround
> actually works :)
>
> /J

-- 
Henryk Konsek
http://about.me/hekonsek


Re: Custom endpoint configuration and Spring Boot

2015-09-25 Thread Henryk Konsek
Hi Jimmy,

If you would like to create a simple URI for the pre-configured component,
then Claus suggestion to create a Spring bean with name/alias matching your
target component, is a way to go. Register the pre-configured JMS component
via:

@Bean(name = "wmq")
JmsComponent myWmqComponent() {
  JmsComponent  jmsComponent = new JmsComponent();

  jmsComponent.setDestinationResolver(new MQDestinationResolver());

  return jmsComponent;
}


Then use the "wmq" bean name in the endpoint URI:


  from("wmq:myQueue").to(...);


Cheers!




pt., 25.09.2015 o 13:42 użytkownik Jimmy Selgen Nielsen <
jimmy.sel...@gmail.com> napisał:

>
> > On 25. sep. 2015, at 12.00, Claus Ibsen <claus.ib...@gmail.com> wrote:
> >
> > Maybe an earlier callback can be added to CamelContextConfiguration?
> >
> > But instead of using that callback you can use some spring annotation
> > that creates this component and name it wmq. Then Camel lookup in the
> > spring bean registry for "wmq" when it wants to use the component with
> > that name, and uses your bean.
> >
>
> For now i’m using a workaround by routing my deadLetterChannel to a
> “direct:deadLetter” route, which then routes the message to the real
> deadLetter queue:
>
> from(directBackoutQueue)
> .wireTap("log:"+"dk.bec"+"?level=WARN=true")
> .to(backoutQueue);
>
> and then in my main route:
>
> from(…..)
> .errorHandler(deadLetterChannel(directBackoutQueue).maximumRedeliveries(0))
>
> I’m not sure if the deadLetterChannel resolving endpoints at route
> configuration time is intentional - it makes sense that a deadLetterChannel
> must exist - but it seems kinda pointless if it is that easily defeated.
>
> As for the earlier callback in CamelContextConfiguration, this seems like
> the correct solution.
>
> /J

-- 
Henryk Konsek
http://about.me/hekonsek


Re: Custom endpoint configuration and Spring Boot

2015-09-25 Thread Henryk Konsek
Hi Jimmy,

You have to add it as a Spring (not Camel) bean:

@Bean
MQDestinationResolver myCustomDestinationResolver() {
  return new MQDestinationResolver();
}

Then refer to it using "destinationResolver" option of the endpoint and
"hashtag" registry notation:

  from("jms:myqueue?destinationResolver=#myCustomDestinationResolver
").to(...);

Cheers!

pt., 25.09.2015 o 10:35 użytkownik Jimmy Selgen Nielsen <
jimmy.sel...@gmail.com> napisał:

> Hi
>
> I’m working on a Spring Boot/Camel application, and need to setup a custom
> MQDestinationResolver (WebSphere MQ).
>
> I was doing this in CamelContextConfiguration.beforeApplicationStart, but
> the deadLetterChannel resolves the channel at configuration time, and not
> at startup time, so i need the configuration done at context initialization
> time.
>
> I’ve tried adding a CamelContext @Bean, but that doesn’t seem to get
> called.
>
> Any hints/ideas as to where i might do this ?
>
> /J

-- 
Henryk Konsek
http://about.me/hekonsek


Re: simple camel route for wmq - help

2015-09-16 Thread Henryk Konsek
Hi,

Do you see any stacktrace or error in your logs?

Cheers!

śr., 16.09.2015 o 09:05 użytkownik <barry.barn...@wellsfargo.com> napisał:

> What would be the syntax for taking a message from a wmq queue and
> inserting it into an Oracle table?
>
>
> 
>${in.body}
> 
>
> This does not appear to be working.
>
>
>
>
> --
Henryk Konsek
http://about.me/hekonsek


Re: Workaround with REST DSL to avoid HTTP method not allowed - 405

2015-09-14 Thread Henryk Konsek
oduces("application/json").consumes("application/json")
>
>
>
>  
> .get("/article/search/user/{user}").id("rest-searchbyuser").outTypeList(Blog.class)
>.to("direct:searchByUser")
>
>/* .put("/article/").id("rest-put-article").type(Blog.class)
>.to("direct:add") */
>
>rest("/blog/article/").id("rest-options")
>  .verb("options")
>  .route()
>  .setHeader("Access-Control-Allow-Origin", constant("*"))
>  .setHeader("Access-Control-Allow-Methods", constant("GET,
> HEAD, POST, PUT, DELETE, OPTIONS"))
>  .setHeader("Access-Control-Allow-Headers", constant("Origin,
> Accept, X-Requested-With, Content-Type, Access-Control-Request-Method,
> Access-Control-Request-Headers"))
>  .setHeader("Allow", constant("GET, HEAD, POST, PUT, DELETE,
> OPTIONS"));
>
>
> Endpoints
>
> INFO  Route: rest-searchbyid started and consuming from: Endpoint[
> http://0.0.0.0:9191/blog/article/search/id/%7Bid%7D?httpMethodRestrict=GET
> ]
> INFO  Route: rest-searchbyuser started and consuming from: Endpoint[
>
> http://0.0.0.0:9191/blog/article/search/user/%7Buser%7D?httpMethodRestrict=GET
> ]
> INFO  Route: rest-deletearticle started and consuming from: Endpoint[
> http://0.0.0.0:9191/blog/article/%7Bid%7D?httpMethodRestrict=DELETE]
> INFO  Route: route1 started and consuming from: Endpoint[
> http://0.0.0.0:9191/blog/article?httpMethodRestrict=OPTIONS]
>
>
>
> http -v OPTIONS http://localhost:9191/blog/article/
>
> -->
>
> HTTP/1.1 200 OK
> Accept: */*
> Accept-Encoding: gzip, deflate
> Access-Control-Allow-Headers: Origin, Accept, X-Requested-With,
> Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers
> Access-Control-Allow-Methods: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS,
> CONNECT, PATCH
> Access-Control-Allow-Origin: *
> Access-Control-Max-Age: 3600
> Allow: GET, HEAD, POST, PUT, DELETE, OPTIONS
>
>
> Regards,
>
> --
> Charles Moulliard
> Apache Committer / Architect @RedHat
> Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: Interceptor into external file

2015-09-10 Thread Henryk Konsek
Hi,

What kind of interceptor do you have in mind? Spring AOP one or Camel one?

Cheers!

czw., 10.09.2015 o 12:57 użytkownik fabrizio.spataro <
fabrizio.spat...@bizmate.it> napisał:

> Hello,
>
> i would use same interceptor (XML Spring implementation) into my different
> projects.
>
> Can i reference an interceptor like "routeContextRef" tag or
> "restContextRef" tag?
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Interceptor-into-external-file-tp5771400.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: Interceptor into external file

2015-09-10 Thread Henryk Konsek
I don't think it is possible in Spring XML DSL. However it is definitely
possible with Java DSL. Maybe you can switch to Java? Java DSL is really
flexible :) .

Cheers!

czw., 10.09.2015 o 14:28 użytkownik fabrizio.spataro <
fabrizio.spat...@bizmate.it> napisał:

> Camel interceptor:
>
> http://camel.apache.org/schema/spring;
> errorHandlerRef="deadLetterErrorHandler">
>  ... ANOTHER CODE ..
>  ... ANOTHER CODE ..
>  ... ANOTHER CODE ..
>
> 
>  ... MY CODE ..
>  ... MY CODE ..
>  ... MY CODE ..
>  ... MY CODE ..
> 
>
>  ... ANOTHER CODE ..
>  ... ANOTHER CODE ..
>  ... ANOTHER CODE ..
>
> 
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Interceptor-into-external-file-tp5771400p5771403.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
-- 
Henryk Konsek
http://about.me/hekonsek


Re: what's happening to camel extra?

2015-09-04 Thread Henryk Konsek
IMHO SourceForge is a piece of crap that has never been anywhere near the
"good solution" ;) .

Cheers!

pt., 4.09.2015 o 15:22 użytkownik Victor NOËL <victor.n...@linagora.com>
napisał:

> 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 <hekon...@gmail.com> 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 <ullg...@gmail.com>
> >> 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 <r...@evosent.com> 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 <ullg...@gmail.com>
> >>> 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 <ullg...@gmail.com
> >>>>> wrote:
> >>>>>>> Diging through the community development list shows that it will
> >> be
> >>>>> moved
> >>>>

Re: what's happening to camel extra?

2015-09-04 Thread Henryk Konsek
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 <ullg...@gmail.com>
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 <r...@evosent.com> 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 <ullg...@gmail.com>
> 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 <ullg...@gmail.com>
> > > 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 <ullg...@gmail.com>
> 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: Load Bean Definitions from XML in Camel

2015-08-25 Thread Henryk Konsek
Hi Felix,

This really depends on the Camel registry [1] you are using. For OSGi
registries you can deploy new beans and processors as the OSGi bundles. For
Spring applications you can use the Spring Bean Registry API [2].

In general as soon as given bean will be available for the Camel registry
[1], Camel will be able to find it. However adding the bean at runtime is
something outside the scope of the Camel itself - you have to rely on your
IoC framework to do the heavy-lifting.

Cheers!

[1] http://camel.apache.org/registry.html
[2]
https://gopinathb4u.wordpress.com/2010/12/30/create-dynamic-spring-beans/

wt., 25.08.2015 o 09:12 użytkownik fxthomas felix.tho...@gmail.com
napisał:

 hello Christain,

 Sorry , I was not clear in the question.  I meant the bean tags in XML
 ,
 can it be loaded dynamically  in camel i.e. a java method which will get
 the
 bean definations from a DB rather that hardcoding it in XML.

 I know that using a complex Java reflection I can load the class and bind
 it
 in the registry via the BIND method of the MAIN Class.  I was wondering
 just
 like the loadRoutes method which can accept a XML stream , can I do the
 same
 for the java beans (which are mostly processor  datasoource entries).


 Hope I was clear

 regards,
 Felix T



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Load-Bean-Definitions-from-XML-in-Camel-tp5770892p5770958.html
 Sent from the Camel - Users mailing list archive at Nabble.com.

-- 
Henryk Konsek
http://about.me/hekonsek


Re: Some Stupid Questions

2015-08-02 Thread Henryk Konsek
Hi,

 Is keeping a separate Camelcontext for each route a
 best approach, or only if there a lot of traffic of messages then
 you should consider separation.

The number if the contexts you have doesn't really affects the performance.
The number of contexts is rather related to the architecture of your
application. For example for the OSGi it makes sense to have the context
per bundle (this is what Camel Karaf does) as you would like to deploy new
contexts at runtime without affecting the existing flows. But for fat
jar application, the more natural approach would be to have a single
context (this is what Camel Spring Boot does).

Cheers!

niedz., 2.08.2015 o 14:05 użytkownik Felix Thomas felix.tho...@gmail.com
napisał:

 Hello,

 I had some doubts so I thought the forum is the best way to get some
 answers.

   1) Since I am using XML DSL earlier Java DSL.
 I have a Bean defined like below. Currently the Constructor is passed.
 But How do I make it dynamic i.e. decide based on the route which argument
 to pass. Do I need to make always different bean entry for each argument to
 pass.

bean id=CustomProcessorDB
 class=com.worldline.frida.camel.core.CustomProcessor
  constructor-arg value=DB/
/bean

 In java I could write  process(new CustomProcessor(CustomConstants.CSV))
 Can I do the same in XML.


  2) Threading :- If I have declared a Bean as above and if I use it in a
 SPLIT in Parallel processing mode using a Thread profile. Will Camel also
 create a Pool of the bean and pass it for each thread. i.e. if my Pool size
 is 5 will  camel create 5 instance of the bean class and use it in the
 processing automatically.  I want to know if it will be thread safe for
 each bean object.


 3) Database component :-  If i am getting billions of data from a DB using
 a timer component consumer is there any feature that I can mark some column
 with some flag stating it has been processed .

 I saw in the SQL Component there are some option like consumer.onConsume
 etc. but is there something similar in JDBC component .  Other approach is
 to move some records to a temporary table and use that but still some flag
 has to be done on the Original table which is being updated every moment.

 4) Performance :-  Is keeping a separate Camelcontext for each route a best
 approach, or only if there a lot of traffic of messages then you should
 consider separation.
 How does camel work incase if you host multiple camelcontext on same
 machine and same JVM,

 Rgds
 Felix



Re: Possible bug in JGroupsFilters.dropNonCoordinatorViews?

2015-07-29 Thread Henryk Konsek
Hi Ed,

Oh, you are thinking about the case when only network is down, not the
whole node. That would definitely make sense.

Do you plan to work on such feature? Pull request with such functionality
will be highly appreciated :) .

Cheers!

wt., 28.07.2015 o 16:52 użytkownik Ed Welch e...@edjusted.com napisał:

 Hi Henryk!

 Follow up question, do you think there is a use case for shutting down a
 running route?

 Say the coordinator in the cluster gets disconnected (unplug a network
 cable or something), the remaining members elect a new coordinator and he
 starts his route.

 The first node then reconnects, would it make sense for him to look at the
 incoming View and if he's no longer the coordinator, to call shutdown on
 the route?

 On Tue, 28 Jul 2015 14:15:48 +, Henryk Konsek hekon...@gmail.com
 wrote:

  Hi Ed,
 
  This is bug indeed. I have just fixed it in CAMEL-9029 [1]. The bug was
 not
  detected so far, because channels used for cluster configuration usually
  don't exchange non-view messages.
 
  Thanks for catching this! Cheers!
 
  [1] https://issues.apache.org/jira/browse/CAMEL-9029
 
  wt., 28.07.2015 o 12:45 użytkownik Ed Welch e...@edjusted.com napisał:
 
   Was looking at using the jgroups component to coordinate some
 master/slave
   routes, and was digging into the source for the example to see how it
 works.
  
   Everything seems straight forward to me with one issue:  the
   dropNonCoordinatorViews method in JGroupsFilters looks like it may
 have a
   bug:
  
   public static Predicate dropNonCoordinatorViews() {
   return new Predicate() {
   public boolean matches(Exchange exchange) {
   Object body = exchange.getIn().getBody();
   JGroupsFilters.LOG.debug(Filtering message {}.,
 body);
   if(body instanceof View) {
   View view = (View)body;
   Address coordinatorNodeAddress =
   (Address)view.getMembers().get(0);
   Address channelAddress =
   (Address)exchange.getIn().getHeader(JGROUPS_CHANNEL_ADDRESS,
   Address.class);
   JGroupsFilters.LOG.debug(Comparing endpoint
 channel
   address {} against the coordinator node address {}., channelAddress,
   coordinatorNodeAddress);
   return
 channelAddress.equals(coordinatorNodeAddress);
   } else {
   JGroupsFilters.LOG.debug(Body {} is not an
 instance
   of org.jgroups.View . Skipping filter., body);
   return true;
   }
   }
   };
   }
  
  
   So if the message from the jgroups component is a View, and the
   coordinator address matches this channel address, return true,
 indicating
   we are the coordinator, and we can start the route.
  
   However, if the message which was received on the Channel was not a
 View
   object, this method returns true.
  
   If this is used according to the example:
  
   from(jgroups:clusterName?enableViewMessages=true).
 filter(dropNonCoordinatorViews()).
 threads().delay(delayIfContextNotStarted(SECONDS.toMillis(5))).
 to(controlbus:route?routeId=masterRouteaction=startasync=true);
  
   Wouldn't that mean any non View type message would cause the route to
   start??
  
   Shouldn't that default case for non View type messages return false?
  
   Thanks,
   Ed





Re: Possible bug in JGroupsFilters.dropNonCoordinatorViews?

2015-07-28 Thread Henryk Konsek
Hi Ed,

This is bug indeed. I have just fixed it in CAMEL-9029 [1]. The bug was not
detected so far, because channels used for cluster configuration usually
don't exchange non-view messages.

Thanks for catching this! Cheers!

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

wt., 28.07.2015 o 12:45 użytkownik Ed Welch e...@edjusted.com napisał:

 Was looking at using the jgroups component to coordinate some master/slave
 routes, and was digging into the source for the example to see how it works.

 Everything seems straight forward to me with one issue:  the
 dropNonCoordinatorViews method in JGroupsFilters looks like it may have a
 bug:

 public static Predicate dropNonCoordinatorViews() {
 return new Predicate() {
 public boolean matches(Exchange exchange) {
 Object body = exchange.getIn().getBody();
 JGroupsFilters.LOG.debug(Filtering message {}., body);
 if(body instanceof View) {
 View view = (View)body;
 Address coordinatorNodeAddress =
 (Address)view.getMembers().get(0);
 Address channelAddress =
 (Address)exchange.getIn().getHeader(JGROUPS_CHANNEL_ADDRESS,
 Address.class);
 JGroupsFilters.LOG.debug(Comparing endpoint channel
 address {} against the coordinator node address {}., channelAddress,
 coordinatorNodeAddress);
 return channelAddress.equals(coordinatorNodeAddress);
 } else {
 JGroupsFilters.LOG.debug(Body {} is not an instance
 of org.jgroups.View . Skipping filter., body);
 return true;
 }
 }
 };
 }


 So if the message from the jgroups component is a View, and the
 coordinator address matches this channel address, return true, indicating
 we are the coordinator, and we can start the route.

 However, if the message which was received on the Channel was not a View
 object, this method returns true.

 If this is used according to the example:

 from(jgroups:clusterName?enableViewMessages=true).
   filter(dropNonCoordinatorViews()).
   threads().delay(delayIfContextNotStarted(SECONDS.toMillis(5))).
   to(controlbus:route?routeId=masterRouteaction=startasync=true);

 Wouldn't that mean any non View type message would cause the route to
 start??

 Shouldn't that default case for non View type messages return false?

 Thanks,
 Ed


Re: com.sun.org.apache.xerces.internal.dom.TextImpl cannot be cast to java.lang.String

2015-07-24 Thread Henryk Konsek
Hi Markus,

Can you send us the full stack trace?

Cheers!

pt., 24.07.2015 o 14:31 użytkownik Markus Eisele eisele.mar...@gmail.com
napisał:

 Same ClassCast Exception:

 java.lang.ClassCastException:
 com.sun.org.apache.xerces.internal.dom.TextImpl cannot be cast to
 java.lang.String

 Cheers,
 Markus

 On 24 July 2015 at 14:11, Jakub Korab jakub.korab.li...@gmail.com wrote:
  Try setting the return type from the xpath expression:
 
  .setHeader(isbns, xpath(/order//isbn/text(), List.class))
 
  Jakub
 
 
  On 24/07/15 13:05, Markus Eisele wrote:
 
  Hi,
 
  I was trying to convert a bunch of //text() Nodes selected via XPath
  into a ListString and keep getting a ClassCastException.
 
  My input xml:
 
 isbn9781617290450/isbn
isbn9780132360280/isbn
 
  The route
 
  .setHeader(isbns, xpath(/order//isbn/text()))
  .bean(orderService, handleOrder(${header[isbns]}))
 
  The Bean Method:
 
  public void handleOrder(ListString orders) {
 
   orders.stream().forEach((o) - {
   LOGGER.log(Level.INFO, Order: {0}, o);
   });
 
 
  Thanks for a hint.
 
  Cheers,
  Markus
 
 



Re: Camel access to ROOT log

2015-07-20 Thread Henryk Konsek
You can also consider creating your own logger appender that would send the
log events to the channel that could be understood by Camel. Or maybe use
JMS Topic appender [1] as a bridge between the Logger and Camel.

Cheers!

[1] http://logback.qos.ch/manual/appenders.html#JMSTopicAppender

pon., 20.07.2015 o 12:12 użytkownik Claus Ibsen claus.ib...@gmail.com
napisał:

 Hi

 You can try using paxlogging
 http://camel.apache.org/pax-logging

 But afair it only reads new events.

 If you want to read a log file, you would need to use the file or
 stream component and read the file directly from the file system.


 On Mon, Jul 20, 2015 at 11:49 AM, BURN, James james.b...@oup.com wrote:
  Hi
 
  I wonder if it is possible to use Camel to access the ServiceMix ROOT
 log. We're running Camel 2.13.2 under ServiceMix 5.1.1.
 
  I've tried:
 
  route id=ROOTLogger
  from uri=log:ROOT /
  to uri=file:ROOTlog/
  /route
 
  But get loads of Body is null errors.
 
  I'm ultimately trying to create email alerts based on the ServiceMix
 ROOT log, and manage this with Camel.
 
  Thanks for any advice.
 
  James
 
 
 
 
 
  Oxford University Press (UK) Disclaimer
 
  This message is confidential. You should not copy it or disclose its
 contents to anyone. You may use and apply the information for the intended
 purpose only. OUP does not accept legal responsibility for the contents of
 this message. Any views or opinions presented are those of the author only
 and not of OUP. If this email has come to you in error, please delete it,
 along with any attachments. Please note that OUP may intercept incoming and
 outgoing email communications.



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



Re: Need help in running camel in raspberry pi

2015-07-15 Thread Henryk Konsek
Hi Parul,

I will help you with your example in coming days.

Cheers!

śr., 15.07.2015 o 07:54 użytkownik Parul parulagrawa...@gmail.com napisał:

 Hi All,

 I have uploaded sample  code @ https://github.com/parulagrawal14/Came-Kura
 .
 Please let me know if i have done anything wrong in the project which might
 have caused the issue.

 Thanks and Regards,
 Parul



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Fwd-Need-help-in-running-camel-in-raspberry-pi-tp5768895p5769318.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Need help in running camel in raspberry pi

2015-07-07 Thread Henryk Konsek
Hi Parul,

The LWM2M branch of Kura is known to be currently broken as far as I know.
Can you try to deploy the regular Kura distribution?

Cheers!

pon., 6.07.2015 o 08:23 użytkownik Parul Agrawal parulagrawa...@gmail.com
napisał:


 Hi,

 I am trying to run Camel as OSgi bundle in Kura with raspberry as the
 target device.
 Just to get hands on I followed below mentioned steps.

 1) Downloaded Kura from *https://github.com/eclipse/kura
 https://github.com/eclipse/kura* with lwm2m branch since I wanted
 support for Lwm2m in Kura.

 2) Deployed Kura in raspberry pi as steps mentioned in 
 *https://wiki.eclipse.org/Kura/Getting_Started
 https://wiki.eclipse.org/Kura/Getting_Started*

 3) After that followed steps @ 
 *http://java.dzone.com/articles/apache-camel-iot-world-eclipse
 http://java.dzone.com/articles/apache-camel-iot-world-eclipse* to
 bundle camel in Kura.

 As mentioned I installed all the jar files in raspberry pi and finally
 started my- camel-bundle.jar
 But in osgi console if I run ls command camel bundle is shown as
 unsatisfied.
 *33  Unsatisfied
 org.eclipse.kura.example.camel_osgi
 org.eclipse.kura.example.camel_osgi(bid=75)*.

 I have attached the *error.txt* file with the output of command ls, ss
 and comp.
 Request you to help me in debugging this issue.
 Since I am new to Camel,Kura,Raspberry pi kindly guide me in making this
 up and providing pointers or any kind of help
 with respect to this.

 Thanks in advance.

 Thanks and Regards,
 Parul





Re: nonsense ClassCastException

2015-06-26 Thread Henryk Konsek
Hi,

It looks like you have incompatible Servlet API jars included in your WAR.
So your jars do not match the API used by your Tomcat.

Cheers!

czw., 25.06.2015 o 19:11 użytkownik Tim Dudgeon tdudgeon...@gmail.com
napisał:

 I'm trying to run some routes in tomcat using the servlet component
 (CamelHttpTransportServlet in the web.xml)
 In a simple example I've got it running fine, but when I try this in the
 real example I get a startup exception that makes no sense at all.

 Marking servlet CamelServlet as unavailable
 Servlet [CamelServlet] in web application [/job-services] threw load()
 exception
 java.lang.ClassCastException:
 org.apache.camel.component.servlet.CamelHttpTransportServlet cannot be
 cast to javax.servlet.Servlet
 at

 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
 at

 org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5262)
 at

 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5550)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at

 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
 at

 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at

 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at

 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)


 Clearly CamelHttpTransportServlet can be cast to javax.servlet.Servlet.
 Anyone got any ideas what to look at for this?

 Tim




Re: spring boot, jpa, entitymanagers and Java DSL

2015-06-12 Thread Henryk Konsek
Hi,

We should check how Camel JPA component resolves the entity manager from
the Spring Boot registry. And then adjust that process, so it works more
natural for the Spring Boot applications. Can you raise a Jira ticket for
this issue?

Cheers!

pt., 12.06.2015 o 08:25 użytkownik erik_romson e...@zenior.no napisał:

 I suppose that.
 
 In Camel 2.3 the JpaComponent will auto lookup the EntityManagerFactory
 from
 the Registry which means you do not need to configure this on the
 JpaComponent as shown above. You only need to do so if there is ambiguity,
 in which case Camel will log a WARN.
 
 clearly states that it is the same entitymanager. The used one was just
 wrapped in so many proxy layers that I didn't understand it.




 --
 View this message in context:
 http://camel.465427.n5.nabble.com/spring-boot-jpa-entitymanagers-and-Java-DSL-tp5768055p5768060.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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

2015-06-03 Thread Henryk Konsek
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 ullg...@gmail.com
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

 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.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
 at

 

Re: how to which version of camel is used by fuse-esb?

2015-06-01 Thread Henryk Konsek
Hi,

In general in Karaf calling...

   osgi:list | grep -i camel

...should do the trick.

Cheers!

pon., 1.06.2015 o 17:25 użytkownik nono yan.w...@db-is.com napisał:

 what i used is
 FuseESB:karaf@root features:listUrl
  Loaded   URI
   true
 mvn:org.apache.camel.karaf/apache-camel/2.9.0.fuse-70-084/xml/features
 then i found out
 apache-camel/2.9.0.fuse-70-084 is used

 is there any other way?

 Any hints will be more than welcome!

 Thx



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/how-to-which-version-of-camel-is-used-by-fuse-esb-tp5767738.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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

2015-05-26 Thread Henryk Konsek
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
zolyfar...@yahoo.com.invalid 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


Re: Synchronous one time use of endpoint

2015-05-23 Thread Henryk Konsek
Hi Justin,

Have you tried to use ConsumerTemplate API? It allows you to dynamically
create an endpoint and consume a single message from it.

Cheers!

pt., 22.05.2015 o 19:38 użytkownik Justin Rosenberg 
justin.rosenb...@crlcorp.com napisał:

   I would like to leverage the endpoint abstraction Camel provides, but I
 don't necessarily need a route.  My use case is to simply read a file from
 an FTP server.  Is there a way to leverage Camel either through the API or
 a route to synchronously leverage a Camel consumer endpoint?

 For example, I would like to do something like this:

   Message message = from(sftp://u...@someserver.com/dir/file.txt;);

 I understand that I could do something like:

   from(sftp://u...@someserver.com/dir/file.txt;).to(someBean);

 However, that would be asynchronous, and potentially consume more than one
 file.  I could, in theory, spin up a dynamic route, collect messages, and
 then spin it down, but that would require a lot of management.

 Another way to ask the question would be, can I leverage Camel's URI
 abstraction of the JSCH API without actually creating routes?
 ~Justin


 CONFIDENTIALITY NOTICE:
 The information in this message, and any attachment, is intended for the
 sole use of the individual and entity to whom it is addressed. This
 information may be privileged, confidential, and protected from
 disclosure. If you are not the intended recipient you are hereby notified
 that you have received this communication in error and that any review,
 disclosure, dissemination, distribution or copying of it, or its contents,
 is strictly prohibited. If you think that you have received this message
 in error please notify the sender and destroy all copies of this
 communication and any attachments. Thank you.



Re: camel-parent pom properties

2015-05-22 Thread Henryk Konsek
Hi,

I would advice to keep Camel BOM imported and import also Spring BOM. Keep
in mind that the order is important here - Spring BOM first, Camel BOM
second. This is actually pretty common approach - to import Spring and
Camel BOMs at the same time. Works like a charm - I'm using this approach
myself. :)

In particular this approach is recommended when working with
camel-spring-boot. The end user should choose his/her Spring stack version
of choice and then just add Camel to the mix.

Cheers!

czw., 21.05.2015 o 16:51 użytkownik Ronny Aerts ronny.ae...@intris.be
napisał:

 Hello,

 This works very fine for everything which has to do with camel (as
 groupid) itself but not for dependencies with other groupid like the one
 below:
 dependencies
 dependency
 groupIdorg.springframework.ws/groupId
 artifactIdspring-ws-security/artifactId
  version${spring-ws-version}/version
 /dependency
 /dependencies
 --
 vriendelijke groeten,
 Ronny Aerts – Intris nv – Wapenstilstandlaan 47, 2600 Berchem, België
 RD Integration Architect
 Prince II certified – ITIL certified
 Tel: +32-3-326.50.75

 -Original Message-
 From: Henryk Konsek [mailto:hekon...@gmail.com]
 Sent: vrijdag 15 mei 2015 17:23
 To: users@camel.apache.org
 Subject: Re: camel-parent pom properties

 Hi,

 The better practice is to import Camel parent as BOM:


 dependencyManagement
   dependnecies
 dependency
   groupIdorg.apache.camel/groupId
   artifactIdcamel-parent/artifactId
   version${camel.version}/version
   typepom/type
   scopeimport/scope
 /dependency
   /dependnecies
 /dependencyManagement

 And then simply:

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

 Cheers!

 pt., 15.05.2015 o 15:24 użytkownik Ronny Aerts ronny.ae...@intris.be
 napisał:

 Hello camel community,

 I'm interested in using the maven properties which are defined in the
 camel-parent pom.xml. In order to inherit these maven properties, I need to
 set the parent in my projects to the camel-parent. The point is that my
 projects use other version numbers than those of camel and this results in
 unresolvable camel-core references because the camel-parent uses the
 ${project.version} variable in its dependencies (which is not 2.15.2 in my
 projects).

 dependency
 groupIdorg.apache.camel/groupId
 artifactIdcamel-core/artifactId
 version${project.version}/version
 /dependency

 Is there a workaround for this?

 --
 vriendelijke groeten,
 Ronny Aertsmailto:ronny.ae...@intris.be - Intris nv -
 Wapenstilstandlaan 47, 2600 Berchem, België RD Integration Architect
 Prince IIhttp://nl.wikipedia.org/wiki/PRINCE2 certified - ITIL
 http://nl.wikipedia.org/wiki/Information_Technology_Infrastructure_Library
 
 certified
 Tel: +32-3-326.50.75

 Intris nv
 Wapenstilstandlaan 47
 B-2600 Berchem Tel. +32 3 326 50 75
 Fax +32 3 326 42 23
 www.intris.behttp://www.intris.be/ [
 http://www.intris.be/mail/AEO_Sticker_108pxRGB.jpg] http://www.intris.be

 DISCLAIMER
 This is an e-mail from Intris. The information contained in this
 communication is intended solely for use by the individual or entity to
 whom it is addressed.
 Use of this communication by others is prohibited. If the e-mail message
 was sent to you by mistake, please notify supp...@intris.bemailto:
 supp...@intris.be, destroy it without reading, using, copying or
 disclosing its contents to any other person.
 We accept no liability for damage related to data and/or documents which
 are communicated by electronic mail.
 Intris nv
 Wapenstilstandlaan 47
 B-2600 Berchem  Tel.  +32 3 326 50 75
 Fax  +32 3 326 42 23
 www.intris.behttp://www.intris.be/[
 http://www.intris.be/mail/AEO_Sticker_108pxRGB.jpg] http://www.intris.be

 DISCLAIMER
 This is an e-mail from Intris. The information contained in this
 communication is intended solely for use by the individual or entity to
 whom it is addressed.
 Use of this communication by others is prohibited. If the e-mail message
 was sent to you by mistake, please notify supp...@intris.bemailto:
 supp...@intris.be, destroy it without reading, using, copying or
 disclosing its contents to any other person.
 We accept no liability for damage related to data and/or documents which
 are communicated by electronic mail.



Re: camel-parent pom properties

2015-05-22 Thread Henryk Konsek
To be exact:

dependencyManagement
dependencies
!-- BOMs --
dependency
groupIdorg.springframework.boot/groupId
artifactIdspring-boot-dependencies/artifactId
version${spring-boot.version}/version
typepom/type
scopeimport/scope
/dependency
dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-parent/artifactId
version${camel.version}/version
typepom/type
scopeimport/scope
/dependency
...

Regarding Spring version for Camel - just check which version of Spring is
used with the given version of Camel. Unfortunately we can't just import
Spring BOM into Camel BOM, because for example OSGi deployments might go
crazy.

Cheers.

pt., 22.05.2015 o 16:41 użytkownik Ronny Aerts ronny.ae...@intris.be
napisał:

Hello,

I understand your answer about importing the spring bom. I assume you
import it as follows:
dependency
groupIdorg.springframework/groupId
artifactIdspring-framework-bom/artifactId
version4.1.6.RELEASE/version
/dependency

The point with this is that you have to choose the spring version yourself
while camel also made a choice about the spring version which I would like
to follow.

--
vriendelijke groeten,
Ronny Aerts – Intris nv – Wapenstilstandlaan 47, 2600 Berchem, België
RD Integration Architect
Prince II certified – ITIL certified
Tel: +32-3-326.50.75

-Original Message-
From: Henryk Konsek [mailto:hekon...@gmail.com]
Sent: vrijdag 22 mei 2015 9:56
To: users@camel.apache.org
Subject: Re: camel-parent pom properties

Hi,

I would advice to keep Camel BOM imported and import also Spring BOM. Keep
in mind that the order is important here - Spring BOM first, Camel BOM
second. This is actually pretty common approach - to import Spring and
Camel BOMs at the same time. Works like a charm - I'm using this approach
myself. :)

In particular this approach is recommended when working with
camel-spring-boot. The end user should choose his/her Spring stack version
of choice and then just add Camel to the mix.

Cheers!

czw., 21.05.2015 o 16:51 użytkownik Ronny Aerts ronny.ae...@intris.be
napisał:

 Hello,

 This works very fine for everything which has to do with camel (as
 groupid) itself but not for dependencies with other groupid like the
 one
 below:
 dependencies
 dependency
 groupIdorg.springframework.ws/groupId
 artifactIdspring-ws-security/artifactId
 version${spring-ws-version}/version
 /dependency
 /dependencies
 --
 vriendelijke groeten,
 Ronny Aerts – Intris nv – Wapenstilstandlaan 47, 2600 Berchem, België
 RD Integration Architect Prince II certified – ITIL certified
 Tel: +32-3-326.50.75

 -Original Message-
 From: Henryk Konsek [mailto:hekon...@gmail.com]
 Sent: vrijdag 15 mei 2015 17:23
 To: users@camel.apache.org
 Subject: Re: camel-parent pom properties

 Hi,

 The better practice is to import Camel parent as BOM:


 dependencyManagement
 dependnecies
 dependency
 groupIdorg.apache.camel/groupId
 artifactIdcamel-parent/artifactId
 version${camel.version}/version
 typepom/type
 scopeimport/scope
 /dependency
 /dependnecies
 /dependencyManagement

 And then simply:

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

 Cheers!

 pt., 15.05.2015 o 15:24 użytkownik Ronny Aerts ronny.ae...@intris.be
 napisał:

 Hello camel community,

 I'm interested in using the maven properties which are defined in the
 camel-parent pom.xml. In order to inherit these maven properties, I
 need to set the parent in my projects to the camel-parent. The point
 is that my projects use other version numbers than those of camel and
 this results in unresolvable camel-core references because the
 camel-parent uses the ${project.version} variable in its dependencies
 (which is not 2.15.2 in my projects).

 dependency
 groupIdorg.apache.camel/groupId
 artifactIdcamel-core/artifactId
 version${project.version}/version
 /dependency

 Is there a workaround for this?

 --
 vriendelijke groeten,
 Ronny Aertsmailto:ronny.ae...@intris.be - Intris nv -
 Wapenstilstandlaan 47, 2600 Berchem, België RD Integration Architect
 Prince IIhttp://nl.wikipedia.org/wiki/PRINCE2 certified - ITIL
 http://nl.wikipedia.org/wiki/Information_Technology_Infrastructure_Lib
 rary
 
 certified
 Tel: +32-3-326.50.75

 Intris nv
 Wapenstilstandlaan 47
 B-2600 Berchem Tel. +32 3 326 50 75
 Fax +32 3 326 42 23
 www.intris.behttp://www.intris.be/ [
 http://www.intris.be/mail/AEO_Sticker_108pxRGB.jpg]
 http://www.intris.be

 DISCLAIMER
 This is an e-mail from Intris. The information contained in this
 communication is intended solely for use by the individual or entity
 to whom it is addressed.
 Use of this communication by others is prohibited. If the e-mail
 message was sent to you by mistake, please notify supp...@intris.be
mailto:
 supp...@intris.be, destroy it without reading, using, copying or
 disclosing its contents to any other person.
 We accept no liability for damage related to data and/or documents
 which are communicated by electronic mail.
 Intris nv
 Wapenstilstandlaan 47
 B-2600

Re: Exchange setBody not working with Camel 2.15.2

2015-05-22 Thread Henryk Konsek
Hi,

Maybe a little Maven example demonstrating the issue? That would encourage
us to debug your problem :) .

Cheers!

pt., 22.05.2015 o 13:33 użytkownik geppo geppore...@gmail.com napisał:

 Also the official API doc says using getIn() is fine:

 http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html

 If your Processor is not producing a different Message but only needs to
 slightly modify the in, you can simply update the in Message returned by
 getIn().

 So how comes this is not supported by Camel 2.15.2?



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Exchange-setBody-not-working-with-Camel-2-15-2-tp5767420p5767422.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: camel sql outputType=SelectList is giving errors

2015-05-21 Thread Henryk Konsek
Hi,

Option outputType has SelectList by default. Does it mean that your
endpoint always fail or only when you set outputType=SelectList explictly.


Cheers.

czw., 21.05.2015 o 10:51 użytkownik chaituu yarlagadd...@gmail.com
napisał:

  using 2.14.1 version...

  route id=route1
from uri=sql:select *  from

 Employee?dataSource=empSourceamp;outputType=SelectListamp;outputClass=com.xxx.util.Employeeamp;consumer.useIterator=true/
bean ref=htmlprocess/
 /route


 In the bean..
  final ListTelecast record =
 exchange.getIn().getBody(List.class);
   LOG.info( record size: + record.size());

 failed polling endpoint:

 Endpoint[sql://select%20*%20%20from%20EMPLOYEE?consumer.useIterator=truedataSource=elogDataSourceoutputClass=com.xxx.util.TelecastoutputType=SelectList].
 Will try again at next poll. Caused by:
 [org.springframework.beans.BeanInstantiationException - Could not
 instantiate bean class [com.xxx.util.Telecast]: Is it an abstract class?;
 nested exception is java.lang.InstantiationException:
 com.xxx.util.Telecast]
 org.springframework.beans.BeanInstantiationException: Could not instantiate
 bean class [com.xxx.util.Telecast]: Is it an abstract class?; nested
 exception is java.lang.InstantiationException: com.xxx.util.Telecast
 at
 org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:82)
 at

 org.springframework.jdbc.core.BeanPropertyRowMapper.mapRow(BeanPropertyRowMapper.java:235)
 at

 org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92)
 at

 org.apache.camel.component.sql.SqlEndpoint.queryForList(SqlEndpoint.java:260)
 at

 org.apache.camel.component.sql.SqlConsumer$1.doInPreparedStatement(SqlConsumer.java:102)




 --
 View this message in context:
 http://camel.465427.n5.nabble.com/camel-sql-outputType-SelectList-is-giving-errors-tp5767373.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to wiretap without consuming the original queue

2015-05-20 Thread Henryk Konsek
Hi,

In general Camel can't consume message and not remove it from the queue at
the same time, as it relies on the ActiveMQ client which... consumes the
messages. :)

You can consider using ActiveMQ mirrored queues and use Camel to consume
only the copy of the message flow.

Cheers.

śr., 20.05.2015 o 12:49 użytkownik Jonasty jonas.audena...@gmail.com
napisał:

 If I do that, I wel get an unclosable loop of messages being pumped at the
 same queue.



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/How-to-wiretap-without-consuming-the-original-queue-tp5767253p5767315.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to wiretap without consuming the original queue

2015-05-19 Thread Henryk Konsek
Hi,

You should add some destination after the wireTap. For example:

from(activemq:queue:aap).wireTap(activemq:queue:aapTap).to(...);

Then you will see that the original flow is processed regardless of the
wireTap flow.

Cheers!

wt., 19.05.2015 o 14:57 użytkownik Jonasty jonas.audena...@gmail.com
napisał:

 Hello
 I am monitoring activemq, I use following routebuilder for this:

 @Override
 public void configure() throws Exception {
 from(activemq:queue:aap).wireTap(activemq:queue:aapTap);

 from(activemq:queue:aapTap).process(myProcessor).id(QueueIncoming);
 }

 But when I send manual messages to the queue, they get to the tap queue and
 get consumed on the wireTap, which is ok but also on the original queue,
 which is NOT ok

 How can I solve this?



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/How-to-wiretap-without-consuming-the-original-queue-tp5767253.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to wiretap without consuming the original queue

2015-05-19 Thread Henryk Konsek
Sorry for answering with the question, but what is purpose of sending the
message to the wireTap and then to nowhere? :) I'm trying to understand
what you try to achieve here.

Cheers!

wt., 19.05.2015 o 15:48 użytkownik Jonasty jonas.audena...@gmail.com
napisał:

 How can I send it to nowhere or do nothing?



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/How-to-wiretap-without-consuming-the-original-queue-tp5767253p5767255.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Vramel or modifying Camel

2015-05-18 Thread Henryk Konsek
Hi Anton,

The threading model is in camel-core [1]. But I doubt if it can be easily
replaced with the different implementation.

Cheers!

[1]
https://github.com/apache/camel/tree/master/camel-core/src/main/java/org/apache/camel

pon., 18.05.2015 o 11:44 użytkownik Anton Hughes kurren...@gmail.com
napisał:

 Can anyone direct me to where/how I can abstract the camel thread model so
 that it can work with other async models such as Vertx.

 Thanks

 On Mon, May 11, 2015 at 1:59 PM, Anton Hughes kurren...@gmail.com wrote:

 
  On Mon, May 11, 2015 at 4:55 AM, Willem Jiang willem.ji...@gmail.com
  wrote:
 
  the Vramel way is like reimplement the Camel DSL on base of vert.x API,
  which need to lots of work to reimplement the Camel core functions.
 
 
  Yes, this is what I am interested.
  I am interested in abstracting the Camel threading model, so that it can
  either run on the current design, or be switched to use Vertx.
 
  Can you point me to where the camel async classes are? Where should I
 look?
 
  Thanks
 



Re: ElasticSearch- Best practice for indexing entire JSON Files?

2015-05-15 Thread Henryk Konsek
Hi,

Split the document and use the bulk insert to save documents in the batch
mode. Look for the camel-elasticsearch [1] BULK_INDEX operation.

Cheers!

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

pt., 15.05.2015 o 13:18 użytkownik James Green james.mk.gr...@gmail.com
napisał:

 If widgets.json is effectively a database of products and each product
 should existing as a document in an elasticsearch index you will need to
 split it before sending it onwards. You could use Camel, but also consider
 logstash.

 If widgets.json is one of many source files representing products that you
 want to be able to search and find, you could simply forward it onwards.
 Again consider logstash  in case it offers an advantage.

 Ultimately you need to decide how you want it stored the other end.


 On 14 May 2015 at 20:52, erd evanday...@gmail.com wrote:

  Hello,
 
  What is the best way to index an entire JSON file? Say i have a file
 called
  widgets.json with structure
 
  {widgets: {
  {name:foo,properties:{status:green, type: fooWidget}},
  {name: ayy, properties:{status:lmao}}
  }
  }
 
  I am currently using a splitter, but the actual file is quite large, and
  makes thousands of messages to send to the server. Is there a way where I
  could just send the file or string, and ES will use the default analyzer
 to
  split it?
 
 
 
  --
  View this message in context:
 
 http://camel.465427.n5.nabble.com/ElasticSearch-Best-practice-for-indexing-entire-JSON-Files-tp5767123.html
  Sent from the Camel - Users mailing list archive at Nabble.com.
 



Re: camel-parent pom properties

2015-05-15 Thread Henryk Konsek
Hi,

The better practice is to import Camel parent as BOM:


dependencyManagement
  dependnecies
dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-parent/artifactId
  version${camel.version}/version
  typepom/type
  scopeimport/scope
/dependency
  /dependnecies
/dependencyManagement

And then simply:

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

Cheers!

pt., 15.05.2015 o 15:24 użytkownik Ronny Aerts ronny.ae...@intris.be
napisał:

Hello camel community,

I'm interested in using the maven properties which are defined in the
camel-parent pom.xml. In order to inherit these maven properties, I need to
set the parent in my projects to the camel-parent. The point is that my
projects use other version numbers than those of camel and this results in
unresolvable camel-core references because the camel-parent uses the
${project.version} variable in its dependencies (which is not 2.15.2 in my
projects).

dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-core/artifactId
version${project.version}/version
/dependency

Is there a workaround for this?

--
vriendelijke groeten,
Ronny Aertsmailto:ronny.ae...@intris.be - Intris nv - Wapenstilstandlaan
47, 2600 Berchem, België
RD Integration Architect
Prince IIhttp://nl.wikipedia.org/wiki/PRINCE2 certified - ITIL
http://nl.wikipedia.org/wiki/Information_Technology_Infrastructure_Library
certified
Tel: +32-3-326.50.75

Intris nv
Wapenstilstandlaan 47
B-2600 Berchem Tel. +32 3 326 50 75
Fax +32 3 326 42 23
www.intris.behttp://www.intris.be/ [
http://www.intris.be/mail/AEO_Sticker_108pxRGB.jpg] http://www.intris.be

DISCLAIMER
This is an e-mail from Intris. The information contained in this
communication is intended solely for use by the individual or entity to
whom it is addressed.
Use of this communication by others is prohibited. If the e-mail message
was sent to you by mistake, please notify supp...@intris.bemailto:
supp...@intris.be, destroy it without reading, using, copying or
disclosing its contents to any other person.
We accept no liability for damage related to data and/or documents which
are communicated by electronic mail.


Re: InOut MEP

2015-05-14 Thread Henryk Konsek
Hi,

Set the validation results on the message header instead of the out message
body. For example:

  exchange.getIn().setHeader(VALIDATION_STATUS, Valid);

Cheers!

czw., 14.05.2015 o 00:06 użytkownik Anton Hughes kurren...@gmail.com
napisał:

 Please take a look at http://camel.apache.org/content-based-router.html

 I think this will help.

 On Wed, May 13, 2015 at 9:57 PM, akoufoudakis akoufoudaki...@gmail.com
 wrote:

  Dear all!
 
  I am sure that this questions has been already asked. Apologies that you
  have to look at it again.
 
  I have a very trivial route, which uses InOut MEP:
 
  @Component
  public class InOutRouter extends RouteBuilder {
 
  public void configure() {
  from(jms:incomingOrders)
  .inOut(jms:validate);
 
  from(jms:validate)
  .bean(ValidatorBean.class);
  }
 
  }
 
  The bean is also very trivial:
  public class ValidatorBean {
 
  private static Logger logger =
  Logger.getLogger(ValidatorBean.class);
 
  public void validateSmth(Exchange exchange) {
  logger.info(bean invoked!!!);
  String body = exchange.getIn().getBody(String.class);
  if(body.contains(SOMETHING)) {
  exchange.getOut().setBody(Valid);
  } else {
  exchange.getOut().setBody(Invalid);
  }
  }
 
  }
 
  The bean is invoked and I can see the logging output.
  I can also see that the route works. The number of enqueued/dequeued
  messages grows in both incomingOrders and validate queues.
 
  However, I cannot see any kind of output after the bean execution is
 over.
 
  Please, help me to find out what I am doing wrong or recommend what
 should
  I
  do to process the reply (i.e., how and where can process the
  Valid/Invalid
  bodies).
 
  Thank you in advance.
 
 
 
  --
  View this message in context:
  http://camel.465427.n5.nabble.com/InOut-MEP-tp5767079.html
  Sent from the Camel - Users mailing list archive at Nabble.com.
 



Re: Warning Messages in Logs when camel application running on multiple nodes

2015-05-13 Thread Henryk Konsek
Hi,

You should see in the logs what is the reason for the rename failure. Maybe
problems with IO?

Cheers.

śr., 13.05.2015 o 08:21 użytkownik ravi.4indra ravi.4in...@gmail.com
napisał:

 Hi,

 I have a route using camel file2 to move a file. its working fine with a
 single node but with camel running on three different nodes i am seeing
 below error on 2 nodes and successfully processing in the third server.

 is there a configuration or option on camel to prevent this
 warnings/exception in logs


 org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
 rename file: Generi
 cFile[filename] to: GenericF
 ile[filename]
 at

 org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFil
 e(GenericFileProcessStrategySupport.java:115)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy.begin(Gene
 ricFileDeleteProcessStrategy.java:42)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsu
 mer.java:348)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer
 .java:211)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:17
 5)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)[ca
 mel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)[came
 l-core-2.14.0.jar:2.14.0]
 at

 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_45]
 at
 java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_45]
 at

 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Sche
 duledThreadPoolExecutor.java:178)[:1.7.0_45]
 at

 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledTh
 readPoolExecutor.java:293)[:1.7.0_45]
 at

 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7
 .0_45]
 at

 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7
 .0_45]
 at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]



 from(file://RemoteMountedDirectory?doneFileName=${file:name}.donedelay=10maxMessagesPerPoll=200delete=true)
  .to(file://toLocalDirectory+?doneFileName=${file:name}.done);

 Thanks
 Ravi



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Warning-Messages-in-Logs-when-camel-application-running-on-multiple-nodes-tp5767030.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: how to get the soap body from exchange.

2015-05-13 Thread Henryk Konsek
Hi,

Try the following approach:

   SOAPMessage soapMessage = exchange.getIn(SOAPMessage.class);

The message contains the body. The message is not a body :) .

Cheers.

śr., 13.05.2015 o 09:59 użytkownik jainmcs03 tojayendran.in...@gmail.com
napisał:

 Team,

 I tried additional ways below, but getting SOAPMessage as null.

 //  SOAPMessage soapMessage =
 exchange.getIn().getBody(SOAPMessage.class);
 //  SOAPMessage soapMessage =
 exchange.getIn().getHeader(CxfConstants.CAMEL_CXF_MESSAGE,
 SOAPMessage.class);
 //  SOAPMessage soapMessage = (SOAPMessage)
 exchange.getIn().getBody(List.class).get(0);
 //  System.out.println(Inside RealResFormatProcessor
 :soapMessage :
 +soapMessage);


 Regards
 Jayendran



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/how-to-get-the-soap-body-from-exchange-tp5767050p5767052.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: CamelExceptionCaught not cleared after successful redelivery

2015-05-07 Thread Henryk Konsek
Hi Tom,

Have you got a chance to check if the issue is still valid for the newer
Camel? 2.10 is reeeally old one and it is very likely that the issue has
been already solved.

Cheers!

czw., 7.05.2015 o 09:26 użytkownik PaSik tompa...@poczta.fm napisał:

 Hi,

 Could you guys please help me out with one thing.

 I have a route that has an error handler configured for a specific
 exception with redelivery settings. When this exception is thrown the
 redelivery is attempted and succeeds but before the processing is continued
 only the exception field on the exchange is cleared but not the
 CamelExceptionCaught property (in RedeliveryErrorHandler).
 The processing is then forwarded to another route through seda that copies
 the exchange along with the
 CamelExceptionCaught exchange property and it happens so that on this
 other route a component is used (soap data format, specifically it's the
 Soap11DataFormatAdapter class) that checks the property and throws the
 exception on this other route. This looks really weird as I'm getting an
 exception on a route/thread that never throws one.

 I'm wondering whether this property shouldn't be cleared after successful
 redelivery. Please let me know if I should register a ticket for this
 issue.

 Also what would be the suggested way of handling this problem (I'm using
 version 2.10.7 and don't have the luxury of upgrading to a newer version).
 I'm thinking about clearing this property manually on entry to the seda
 route, but maybe there is a better way to handle this. My suggested
 solution should work because no other component seems to be throwing
 exceptions using CamelExceptionCaught property in the original route.

 On the other hand maybe it's the soap data format that checks the property
 that should be fixed? Maybe it should only be reacting to the exceptions
 set directly on the exchange?

 Or maybe it's me who is doing at all wrong and all the camel components
 are just fine .

 Thanks,
 Tom



Re: @BeanInject ignored in Groovy when called as a script

2015-05-05 Thread Henryk Konsek
Hi,

This is Spring? Can you send us the Maven example reproducing the issue?

Cheers!

wt., 5.05.2015 o 15:01 użytkownik bocamel johnz...@gmail.com napisał:

 Because groovy script called by Camel cannot be debugged under IDE, I
 created
 my script as a hybrid so I can easily switch it between the bean mode and
 script mode:
 //==
 class GroovyProc4 {
 @BeanInject('myConfig')
 MyConfig myConfig

 public void process(Exchange exchange) {
 println(myConfig?.name)
 }
 }

 def GroovyProc4 mybean = new GroovyProc4()
 //mybean.myConfig = MyConfig.getInstanceFromRegistry(exchange.context,
 myConfig)
 mybean.process(exchange)
 //==

 In the following route, I can choose to run the above processor as a script
 or bean.
 camel:route autoStartup=true
 camel:from uri=timer://test?period=10s/
  camel:to uri=bean:groovyProc4 /

 /camel:route

 But when I ran it as a script, the @BeanInject in the class was ignored and
 I would have to explicitly initialize the member property myConfig by
 retrieving the value from Registry (in the commented out statement in the
 script above).  Is this the expected behavior?   Thanks for any help!




 --
 View this message in context:
 http://camel.465427.n5.nabble.com/BeanInject-ignored-in-Groovy-when-called-as-a-script-tp5766708.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: HTTP OPTIONS

2015-04-23 Thread Henryk Konsek
Hi,

I've fixed some OPTIONS/CORS related issues in Netty HTTP component. After
these [1] two [2] changes (scheduled for 2.16 and 2.15.2) you can finally
call Netty HTTP based REST DSL routes from AngularJS without running into
the OPTIONS problems.

If you wait for Camel 2.15.2 and use Netty HTTP as a REST provider, you can
enjoy your favorite JS framework calling your REST API without any issues.

Cheers.

[1] https://issues.apache.org/jira/browse/CAMEL-8685
[2] https://issues.apache.org/jira/browse/CAMEL-8645

czw., 23.04.2015 o 10:57 użytkownik Claus Ibsen claus.ib...@gmail.com
napisał:

 Hi

 What http component do you use? servlet / jetty / or something else?
 And what version of Camel.

 There is a few tickets about rest-dsl and CORS issues still to get
 fixed / improved.

 On Thu, Apr 23, 2015 at 10:18 AM, Ted na...@pritchard.uk.net wrote:
  Hi,
 
  I have a simple REST DSL route that has both a GET and a PUT for a
  particular resource:
 
  rest(/orders)
  .get(/{orderId}).outType(Order.class)
  .to(direct:getOrder)
  .put(/{orderId}).type(Order.class)
  .to(direct:updateOrder);
 
 
  This application is run on a different port to the consuming application
 so
  I have enabled CORS via a servlet filter (I also tried the enable CORS
  option on the configuration of REST DSL).  The consuming application is
  sending a pre-flight HTTP OPTIONS request.  I can see in the class
  ServletRestServletResolveConsumerStrategy that the method
  matchRestMethod(method, restrict) has special provision for the OPTIONS
  method.  The problem for me seems to be that if the consuming application
  sends a method similar to:
 
  /orders/1 OPTIONS
 
  Then the ServletRestServletResolveConsumerStrategy class is not able to
 find
  a unique match because both the GET and the PUT methods are matched and
 the
  consumer sees a 404.
 
  Is there something I'm missing?
 
  Ted
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/HTTP-OPTIONS-tp5766194.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://hawt.io/fabric8: http://fabric8.io/



Re: Closed (removed) StreamCache when doing a Wiretap

2015-04-22 Thread Henryk Konsek
Hi,

You can also use Wiretap's onPrepareRef option and use custom processor to
copy the content of the cached body.

Franz, would you be so kind and create a pull request with your fix?
Somebody will review it and merge. Thanks in advance!

Cheers!

wt., 21.04.2015 o 16:25 użytkownik Franz Paul Forsthofer 
emc2...@googlemail.com napisał:

 Hi Geert,

 it is a bug. You can try as a workaround to set the threshold
 (streamCachingStrategy.setSpoolThreshold(huge_number);) to a huge
 number; then the body will be kept in memory.

 Alternatively, you can modify the code of the Camel class
 org.apache.camel.processor.WireTapProcessor. You have to modifiy the
 method configureCopyExchange in the following way:


private Exchange configureCopyExchange(Exchange exchange) throws
 IOException {


 // must use a copy as we dont want it to cause side effects of
 the original exchange
 Exchange copy = ExchangeHelper.createCorrelatedCopy(exchange,
 false);

 if (copy.getIn().getBody() instanceof FileInputStreamCache) {
 //the file stream must be copied, otherwise you get errors
 because the stream file is removed when the parent route is finished
 FileInputStreamCache streamCache = (FileInputStreamCache)
 exchange.getIn().getBody();
 CachedOutputStream cos = new CachedOutputStream(copy);
 try {
   IOHelper.copy(streamCache, cos);
 } finally {
   IOHelper.close(streamCache, cos);
   streamCache.reset();
 }
 copy.getIn().setBody(cos.newStreamCache());
 }
 // set MEP to InOnly as this wire tap is a fire and forget
 copy.setPattern(ExchangePattern.InOnly);
 return copy;
 }

 The idea behind this is to make a copy of the stream cache file, so
 that you get an additional stream cache file for the second route (in
 your case for the route direct:x). This second stream cache file
 will be deleted when the second route is finished.

 I also hope that this issue will be fixed. I am no committer so I
 cannot say when this issue will be solved; I have made contributions
 which solved a similar problem in the aggregator and splitter.

 I think you can open a Jira ticket with the above solution suggestion.

 Regards Franz

 On Tue, Apr 21, 2015 at 11:13 AM, Geert Vanheusden
 geer...@aviovision.com wrote:
  Hi Franz,
 
  is this something that will be fixed in an upcoming release? Is it a bug
 or
  does it work as designed?
  Can we use a workaround to avoid this behaviour, for example by not
  deleting the temp files?
 
 
  Kind regards,
 
  Geert
 
  On Tue, Apr 21, 2015 at 10:37 AM, Franz Paul Forsthofer 
  emc2...@googlemail.com wrote:
 
  Hello Geert,
 
  there is no solution yet for your problem. Currently the stream cache
  file is removed at the end of the route which created the file. In
  your case the stream cache file is deleted when the direct:start
  route is finished. The wire tap runs in a separate thread and
  therefore it can happen that it tries to read the cached file when it
  is already deleted, especially when you have a delay in the wiretap
  route (direct:x).
 
 
  Regards Franz
 
  On Fri, Apr 17, 2015 at 6:05 PM, Geert Vanheusden
  geer...@aviovision.com wrote:
   Hi,
  
   I noticed a bug where the body (StreamCache) was already removed
 before
  the
   exchange reached the end (in the Wiretap route).
  
   I found the following ticket
   https://issues.apache.org/jira/browse/CAMEL-8386 and code
  
 
 https://fisheye6.atlassian.com/changelog/camel-git?cs=4661cbb94513d6047e58581b23dcd4a6fad166f7
   but I think it still doesn't fix the Wiretap problem.
  
   Here you can find my test (executed on 2.15.1). If you disable the
   StreamCaching or remove the delay it works, enabling it again will
 break
   the test.
  
   
   import org.apache.camel.builder.RouteBuilder;
   import org.apache.camel.component.mock.MockEndpoint;
   import org.apache.camel.impl.DefaultStreamCachingStrategy;
   import org.apache.camel.spi.StreamCachingStrategy;
   import org.apache.camel.test.junit4.CamelTestSupport;
   import org.junit.Before;
   import org.junit.Test;
  
   public class WireTapTest extends CamelTestSupport {
  
   private MockEndpoint y;
   private MockEndpoint z;
  
   @Before
   public void prepareEndpoints() {
   y = getMockEndpoint(mock:file:y);
   z = getMockEndpoint(mock:file:z);
   }
  
   @Test
   public void
  
 
 testSendingAMessageUsingWiretapShouldNotDeleteStreamBeforeWiretappedExcangeIsComplete()
   throws InterruptedException {
   y.expectedMessageCount(1);
   z.expectedMessageCount(1);
  
   // test.txt should contain more than one character
   template.sendBody(direct:start,
   this.getClass().getResourceAsStream(/test.txt));
  
   assertMockEndpointsSatisfied();
   }
  
   @Override
   protected RouteBuilder createRouteBuilder() throws Exception {
   return new RouteBuilder() {
   @Override
   public void 

Re: Comparison of Apache Camel and IBM Integration Bus v9.0

2015-04-22 Thread Henryk Konsek
Thanks Jamie. I'm looking forward to seeing it!

Cheers.

śr., 22.04.2015 o 18:51 użytkownik jamie3 jam...@gmail.com napisał:

 Hello everyone. I'm not sure if this is the right area but I will be
 providing a deep comparison of Apache Camel and Integration Bus v9.0 in a
 series of upcoming blog posts. Just wanted to share this with the
 community.


 http://beertechcode.blogspot.ca/2015/04/a-detailed-and-hopefully-un-biased.html
 
 http://beertechcode.blogspot.ca/2015/04/a-detailed-and-hopefully-un-biased.html
 




 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Comparison-of-Apache-Camel-and-IBM-Integration-Bus-v9-0-tp5766171.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: synchronizing multiple processes in a camel route

2015-04-21 Thread Henryk Konsek
Hi,

Until you explicitly define the message flow as parallel (using for example
Threads DSL [1]) the processing will be sequential. So you don't have to do
anything to achieve what you want :) .

Laters!

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

pon., 20.04.2015 o 19:24 użytkownik Morgan Hautman morgan.haut...@gmail.com
napisał:

 Hi,

 A Processor is synchronous.

 Regards,
 Morgan

 On 20/04/2015 16:35, anish wrote:
  How can we synchronize the processes in a camel route? I want to execute
 all
  the processes defined in a camel route to get executed in a single shot.
 
  In the below camel route, I want to execute the processes
  msgConvertorSingle and smsBO get executed in a single unit of work. I
  dont want a different thread executing the same when one is doing its
 job.
  How can we achieve this?
 
camel:route id=SinglelineRouteConvertor
   camel:from uri=direct:msgConvertorSingle /
   camel:process ref=msgConvertorSingle /
   camel:process ref=smsBO /
   camel:log message=Saved Message Order is${body} /
   /camel:route
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/synchronizing-multiple-processes-in-a-camel-route-tp5766068.html
  Sent from the Camel - Users mailing list archive at Nabble.com.




Re: Spring Boot component is missing CamelSpringBootApplicationController

2015-04-16 Thread Henryk Konsek
Hi,

Regardless of the ease of providing the workaround  for this issue, I have
backported CAMEL-8532 to 2.15.2.

Cheers!

śr., 15 kwi 2015 o 21:10 użytkownik Henryk Konsek hekon...@gmail.com
napisał:

 Hi,

 Just add spring-boot-starter-web to your project. It will block the main
 thread. Or camel-boot-starter-remote-shell. I didn't backported CAMEL-8532
 https://issues.apache.org/jira/browse/CAMEL-8532 because it is as easy
 to block the main thread. I personally always add spring-boot-starter-web
 to the app to have a Jolokia endpoint exposed.

 Cheers.

 wt., 7 kwi 2015 o 08:23 użytkownik Claus Ibsen claus.ib...@gmail.com
 napisał:

 Hi

 Yeah wonder if we can backport this to 2.15.2.

 Henryk any thoughts on this?

 On Tue, Apr 7, 2015 at 1:51 AM, ccampo cca...@gmail.com wrote:
  Just a follow up - it appears that CamelSpringBootApplicationController
 won't
  be available until 2.16.0, per
  https://issues.apache.org/jira/browse/CAMEL-8532. Unfortunately, this
  renders the Camel Spring Boot component effectively broken until then.
 
  A work-around for anybody encountering this issue is just to write the
 code
  yourself. Create a the class CamelSpringBootApplicationController.java
  somewhere in your codebase using the code
 
 https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
  (and of course, follow the license and give credit where it's due).
 Then in
  your main method, just use the code:
 
  final ApplicationContext applicationContext = new
  SpringApplication(MainClass.class).run(args);
  final CamelSpringBootApplicationController
 applicationController =
 
  applicationContext.getBean(CamelSpringBootApplicationController.class);
  applicationController.blockMainThread();
 
  ... similar to what's shown in
 
 https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/FatJarRouter.java
  (again, follow the license).
 
  Finally declare a bean of type CamelSpringBootApplicationController,
 like
  so:
 
  @Bean
  public CamelSpringBootApplicationController
 applicationController(final
  ApplicationContext applicationContext,
  final CamelContext camelContext) {
  return new
 CamelSpringBootApplicationController(applicationContext,
  camelContext);
  }
 
  Everything should be OK then.
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/Spring-Boot-component-is-missing-CamelSpringBootApplicationController-tp5765405p5765406.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://hawt.io/fabric8: http://fabric8.io/




Re: RSS Feed consumer

2015-04-16 Thread Henryk Konsek
Hi,

Please show us your route :) . It would be helpful.

Cheers.

czw., 16 kwi 2015 o 11:46 użytkownik majid mohamed.elgabbo...@peerius.com
napisał:

 Hi all,

 I have a scheduler task that is supposed to download a rss feeds file
 locally and I want pull all these feeds and extract some data from them,
 but
 I want to delete this file at the end of the process.

 But it looks like the route keeps polling from the same file indefinitely.
 Is there any option to stop processing the file once I reach the last feed
 ?

 Cheers
 Majid



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



Re: The Camel Kafka component crashes with a NoClassDefFoundError exception.

2015-04-16 Thread Henryk Konsek
If we are talking about camel-scala, then I believe that scala dependency
should be provided. We integrate Camel with Scala, but it is up to end-user
to provide the version of Scala s(he) wants to use in the project.

Laters!

czw., 16 kwi 2015 o 19:10 użytkownik Claus Ibsen claus.ib...@gmail.com
napisał:

 Hi

 Yeah I am not sure why the scala dependency was set to scope=provided.
 Maybe git blame can tell.

 But sure you are welcome to log a ticket and provide a patch / PR
 http://camel.apache.org/support

 On Wed, Apr 15, 2015 at 5:50 PM, ccampo cca...@gmail.com wrote:
  The Camel Kafka component crashes with a NoClassDefFoundError exception.
 
  If you define a Camel route which uses the Camel Kafka component, it will
  crash when running with a NoClassDefFoundError. I've tracked this down to
  the project that uses camel-kafka 2.15.1 also requires an explicit
  dependency on scala-library 2.10.2. This dependency is not mentioned
  anywhere in the documentation. Here's the error that occurs when the
 Scala
  dependency is missing:
 
 
 
  Here's the route I'm using:
 
 
 
  My project is using Spring Boot 1.2.3 and Camel 2.15.1.
 
  Would you like me to open a JIRA ticket for this to be resolved?
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/The-Camel-Kafka-component-crashes-with-a-NoClassDefFoundError-exception-tp5765829.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://hawt.io/fabric8: http://fabric8.io/



Re: Spring Boot component is missing CamelSpringBootApplicationController

2015-04-15 Thread Henryk Konsek
Hi,

Just add spring-boot-starter-web to your project. It will block the main
thread. Or camel-boot-starter-remote-shell. I didn't backported CAMEL-8532
https://issues.apache.org/jira/browse/CAMEL-8532 because it is as easy to
block the main thread. I personally always add spring-boot-starter-web to
the app to have a Jolokia endpoint exposed.

Cheers.

wt., 7 kwi 2015 o 08:23 użytkownik Claus Ibsen claus.ib...@gmail.com
napisał:

 Hi

 Yeah wonder if we can backport this to 2.15.2.

 Henryk any thoughts on this?

 On Tue, Apr 7, 2015 at 1:51 AM, ccampo cca...@gmail.com wrote:
  Just a follow up - it appears that CamelSpringBootApplicationController
 won't
  be available until 2.16.0, per
  https://issues.apache.org/jira/browse/CAMEL-8532. Unfortunately, this
  renders the Camel Spring Boot component effectively broken until then.
 
  A work-around for anybody encountering this issue is just to write the
 code
  yourself. Create a the class CamelSpringBootApplicationController.java
  somewhere in your codebase using the code
 
 https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
  (and of course, follow the license and give credit where it's due). Then
 in
  your main method, just use the code:
 
  final ApplicationContext applicationContext = new
  SpringApplication(MainClass.class).run(args);
  final CamelSpringBootApplicationController applicationController
 =
 
  applicationContext.getBean(CamelSpringBootApplicationController.class);
  applicationController.blockMainThread();
 
  ... similar to what's shown in
 
 https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/FatJarRouter.java
  (again, follow the license).
 
  Finally declare a bean of type CamelSpringBootApplicationController, like
  so:
 
  @Bean
  public CamelSpringBootApplicationController
 applicationController(final
  ApplicationContext applicationContext,
  final CamelContext camelContext) {
  return new
 CamelSpringBootApplicationController(applicationContext,
  camelContext);
  }
 
  Everything should be OK then.
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/Spring-Boot-component-is-missing-CamelSpringBootApplicationController-tp5765405p5765406.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://hawt.io/fabric8: http://fabric8.io/



Re: Camel M2M gateway project

2015-03-09 Thread Henryk Konsek
Hi,

 Maybe add a link to your project from the Camel user stories /
 articles or somewhere relevant?
 http://camel.apache.org/user-stories.html

Good point! Added to user stories.

Cheers.

-- 
Henryk Konsek
http://about.me/hekonsek


Re: Duplicate route id detection and Spring Boot integration

2015-03-04 Thread Henryk Konsek
I sneaked the fixed into 2.15.0 release. :) Thanks for reporting!

Laters!

On Wed, Mar 4, 2015 at 4:10 PM, Henryk Konsek hekon...@gmail.com wrote:
 Hi,

 Indeed, RoutesCollector was invoked after CamelContext is started.
 This is a bug. I will push fix to Camel 2.15.1.

 Thanks for catching this!

 Cheers.

 On Sun, Feb 15, 2015 at 10:26 PM, Henryk Konsek hekon...@gmail.com wrote:
 Hi guys,

 I'm back from the short holidays. I will take a look at this issue
 soon. Stay tuned!

 Laters!

 On Mon, Feb 9, 2015 at 9:28 AM, Christian Bauer
 m...@christianbauer.name wrote:
 https://issues.apache.org/jira/browse/CAMEL-8325

 On February 8, 2015 7:35:56 PM GMT+01:00, Claus Ibsen 
 claus.ib...@gmail.com wrote:
On Fri, Feb 6, 2015 at 10:43 AM, Christian Bauer
m...@christianbauer.name wrote:
 Hi everyone,

 recently we had a typo in one of our route definitions that resulted
in a duplicate route ID but no error message and unexpected replacement
of an existing route. This is the bootstrap order found in some Camel
examples:

 CamelContext context = new DefaultCamelContext();

 context.addRoutes(new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(direct:foo).routeId(foo).stop();
 }
 });

 context.addRoutes(new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(direct:bar).routeId(foo).stop();
 }
 });

 context.start();

 You'll get a duplicate route ID exception.

 If instead you start the context before you add the routes, you won't
get an exception and the direct:bar route will simply replace the
direct:foo route, as they have the same ID. This is consistent with
the Javadoc of the API and probably a useful feature.

 However if like in our case you use camel-spring-boot, the
RouteCollector will add routes after the Camel context has started. You
won't detect duplicate route IDs but instead any later discovered
RouteBuilder will override existing routes with the same ID.


Ah yeah I guess maybe camel-spring-boot calls start on CamelContext to
soon.

As currently you can add your own duplication route id detection and
fail.



 I'm no Spring expert but it seems the CamelContext start should be
deferred in the Spring Boot integration code: The
CamelBeanPostProcessor factory method triggers CamelContext creation
(due to injection in the factory method) and starts SpringCamelContext
during the BeanPostProcessor initialization phase in Spring
(InitializingBean). Any necessary transitive bean creation will
therefore also happen in that phase. We see a lot of Spring warnings
(actually INFO, but it probably should be WARN) that some
BeanPostProcessors had to be skipped, because we are starting inside a
BeanPostProcessor call.


Yeah I think it should start later. In camel-spring we only start
camel at the end when we receive an event from spring itself about the
context created/refresh.

Maybe if Henryk got some time he could dive in and look as well.

But anyone is of course welcome to help. We love contributions.
And you are welcome to log a JIRA ticket, it does indeed appear as the
start() is invoked too soon, which can also cause other side-effects.

eg start should only be called after all the configuration has been
done.


 One of those is for example our custom BeanPostProcessor which adds
discovered EventNotifiers to the CamelContext, something the Spring
Boot integration doesn't provide yet. We think this has to be done
before the CamelContext is started, after looking at the
ManagementStrategy code. Hence you can't do this with the
CamelConfiguration interface of camel-spring-boot, the context has
already been started at that point.

 Our solution was a simple integration class for Spring Boot that
starts the context later, after configuration. Would be great to know
if we are missing something, although we'll probably stay on 2.14
anyway for this project due end of March.

 Cheers,
 Christian








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



 --
 Henryk Konsek
 http://henryk-konsek.blogspot.com



 --
 Henryk Konsek
 http://about.me/hekonsek



-- 
Henryk Konsek
http://about.me/hekonsek


Re: Duplicate route id detection and Spring Boot integration

2015-03-04 Thread Henryk Konsek
Hi,

Indeed, RoutesCollector was invoked after CamelContext is started.
This is a bug. I will push fix to Camel 2.15.1.

Thanks for catching this!

Cheers.

On Sun, Feb 15, 2015 at 10:26 PM, Henryk Konsek hekon...@gmail.com wrote:
 Hi guys,

 I'm back from the short holidays. I will take a look at this issue
 soon. Stay tuned!

 Laters!

 On Mon, Feb 9, 2015 at 9:28 AM, Christian Bauer
 m...@christianbauer.name wrote:
 https://issues.apache.org/jira/browse/CAMEL-8325

 On February 8, 2015 7:35:56 PM GMT+01:00, Claus Ibsen 
 claus.ib...@gmail.com wrote:
On Fri, Feb 6, 2015 at 10:43 AM, Christian Bauer
m...@christianbauer.name wrote:
 Hi everyone,

 recently we had a typo in one of our route definitions that resulted
in a duplicate route ID but no error message and unexpected replacement
of an existing route. This is the bootstrap order found in some Camel
examples:

 CamelContext context = new DefaultCamelContext();

 context.addRoutes(new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(direct:foo).routeId(foo).stop();
 }
 });

 context.addRoutes(new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(direct:bar).routeId(foo).stop();
 }
 });

 context.start();

 You'll get a duplicate route ID exception.

 If instead you start the context before you add the routes, you won't
get an exception and the direct:bar route will simply replace the
direct:foo route, as they have the same ID. This is consistent with
the Javadoc of the API and probably a useful feature.

 However if like in our case you use camel-spring-boot, the
RouteCollector will add routes after the Camel context has started. You
won't detect duplicate route IDs but instead any later discovered
RouteBuilder will override existing routes with the same ID.


Ah yeah I guess maybe camel-spring-boot calls start on CamelContext to
soon.

As currently you can add your own duplication route id detection and
fail.



 I'm no Spring expert but it seems the CamelContext start should be
deferred in the Spring Boot integration code: The
CamelBeanPostProcessor factory method triggers CamelContext creation
(due to injection in the factory method) and starts SpringCamelContext
during the BeanPostProcessor initialization phase in Spring
(InitializingBean). Any necessary transitive bean creation will
therefore also happen in that phase. We see a lot of Spring warnings
(actually INFO, but it probably should be WARN) that some
BeanPostProcessors had to be skipped, because we are starting inside a
BeanPostProcessor call.


Yeah I think it should start later. In camel-spring we only start
camel at the end when we receive an event from spring itself about the
context created/refresh.

Maybe if Henryk got some time he could dive in and look as well.

But anyone is of course welcome to help. We love contributions.
And you are welcome to log a JIRA ticket, it does indeed appear as the
start() is invoked too soon, which can also cause other side-effects.

eg start should only be called after all the configuration has been
done.


 One of those is for example our custom BeanPostProcessor which adds
discovered EventNotifiers to the CamelContext, something the Spring
Boot integration doesn't provide yet. We think this has to be done
before the CamelContext is started, after looking at the
ManagementStrategy code. Hence you can't do this with the
CamelConfiguration interface of camel-spring-boot, the context has
already been started at that point.

 Our solution was a simple integration class for Spring Boot that
starts the context later, after configuration. Would be great to know
if we are missing something, although we'll probably stay on 2.14
anyway for this project due end of March.

 Cheers,
 Christian








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



 --
 Henryk Konsek
 http://henryk-konsek.blogspot.com



-- 
Henryk Konsek
http://about.me/hekonsek


Camel M2M gateway project

2015-03-03 Thread Henryk Konsek
Hi,

For those interested in the Internet Of Things and M2M - I started a
small project called Camel M2M gateway [1]. I want it to be the
landing page for the Camel enthusiast interesting in putting Camel
into small-medium processing devices like Raspberry Pi, BeagleBone
Black and so forth.

This is also a place where I plan to put my benchmarks code and
results (starting by the end of this week).

You're more then welcome to participate! :)

Cheers.

[1] https://github.com/hekonsek/camel-m2m-gateway

-- 
Henryk Konsek
http://about.me/hekonsek


Re: Camel Spring Boot Joda DateTime serialization support with Jackson JSON

2015-02-18 Thread Henryk Konsek
Hi,

I will also update camel-spring-boot, so in Spring Boot applications
Boot Jackson config is reused by Camel.

Cheers.

On Wed, Feb 18, 2015 at 8:07 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi

 Yes CAMEL-8176 in next release makes this easier. Just set the module
 on the json data format.

 On Wed, Feb 18, 2015 at 1:14 AM, benjf benjamin.fa...@tagga.com wrote:
 How do I configure Jackson JSON marshal/unmarshal to have global support for
 the Joda DateTime type?

 Spring Boot now supports this:
 https://spring.io/blog/2014/12/02/latest-jackson-integration-improvements-in-spring

 If I include this:

 https://github.com/FasterXML/jackson-datatype-joda

 dependency
   groupIdcom.fasterxml.jackson.datatype/groupId
   artifactIdjackson-datatype-joda/artifactId
   version2.4.0/version
 /dependency

 How can I customize the global ObjectMapper used by the marshal/unmarshal
 commands?

 ObjectMapper mapper = new ObjectMapper();
 mapper.registerModule(new JodaModule());

 This might be related: https://issues.apache.org/jira/browse/CAMEL-8176





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-Spring-Boot-Joda-DateTime-serialization-support-with-Jackson-JSON-tp5762854.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/



-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel Spring Boot Joda DateTime serialization support with Jackson JSON

2015-02-18 Thread Henryk Konsek
Hi Benjamin,

Camel Spring Boot will be out in a month or so, together with the
Camel 2.15. I will try to include this enhancement in that release,
but I can't promise anything, as there not much time. :)

BTW Many thanks for your feedback regarding Camel Spring Boot!

Cheers.

On Wed, Feb 18, 2015 at 10:09 AM, benjf benjamin.fa...@tagga.com wrote:
 Woo hoo. I'm looking forward to the release of Spring Boot Camel.

 On Wed, Feb 18, 2015 at 1:04 AM, hekonsek [via Camel] 
 ml-node+s465427n5762882...@n5.nabble.com wrote:

 Hi,

 I will also update camel-spring-boot, so in Spring Boot applications
 Boot Jackson config is reused by Camel.

 Cheers.

 On Wed, Feb 18, 2015 at 8:07 AM, Claus Ibsen [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=5762882i=0 wrote:

  Hi
 
  Yes CAMEL-8176 in next release makes this easier. Just set the module
  on the json data format.
 
  On Wed, Feb 18, 2015 at 1:14 AM, benjf [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=5762882i=1 wrote:
  How do I configure Jackson JSON marshal/unmarshal to have global
 support for
  the Joda DateTime type?
 
  Spring Boot now supports this:
 
 https://spring.io/blog/2014/12/02/latest-jackson-integration-improvements-in-spring
 
  If I include this:
 
  https://github.com/FasterXML/jackson-datatype-joda
 
  dependency
groupIdcom.fasterxml.jackson.datatype/groupId
artifactIdjackson-datatype-joda/artifactId
version2.4.0/version
  /dependency
 
  How can I customize the global ObjectMapper used by the
 marshal/unmarshal
  commands?
 
  ObjectMapper mapper = new ObjectMapper();
  mapper.registerModule(new JodaModule());
 
  This might be related: https://issues.apache.org/jira/browse/CAMEL-8176
 
 
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/Camel-Spring-Boot-Joda-DateTime-serialization-support-with-Jackson-JSON-tp5762854.html
  Sent from the Camel - Users mailing list archive at Nabble.com.
 
 
 
  --
  Claus Ibsen
  -
  Red Hat, Inc.
  Email: [hidden email]
 http:///user/SendEmail.jtp?type=nodenode=5762882i=2
  Twitter: davsclaus
  Blog: http://davsclaus.com
  Author of Camel in Action: http://www.manning.com/ibsen
  hawtio: http://hawt.io/
  fabric8: http://fabric8.io/



 --
 Henryk Konsek
 http://henryk-konsek.blogspot.com


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

 http://camel.465427.n5.nabble.com/Camel-Spring-Boot-Joda-DateTime-serialization-support-with-Jackson-JSON-tp5762854p5762882.html
  To unsubscribe from Camel Spring Boot Joda DateTime serialization support
 with Jackson JSON, click here
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5762854code=YmVuamFtaW4uZmF5bGVAdGFnZ2EuY29tfDU3NjI4NTR8LTIxMTkwODk3OTY=
 .
 NAML
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




 --

 Benjamin Fayle

 CTO

 *tagga*
 Connect. Profile. Engage c: 604-224-9393
 t: @tagga https://twitter.com/tagga




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-Spring-Boot-Joda-DateTime-serialization-support-with-Jackson-JSON-tp5762854p5762883.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: CamelBlueprintTest randomly failing tests

2015-02-17 Thread Henryk Konsek
)
   at
 

   
  
 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
   at
 

   
  
 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
   at
  org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
   at
   org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
   at
  org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
   at
  org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
   at
 

   
  
 
 org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
   at
 

   
  
 
 org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
   at
 

   
  
 
 org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
   at
 

   
  
 
 org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
   at
 

   
  
 
 org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
   at
 

   
  
 
 org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
   at
 

   
  
 
 org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
   at
 
   
 
 org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
  
 
 

   
  
 






-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Duplicate route id detection and Spring Boot integration

2015-02-15 Thread Henryk Konsek
Hi guys,

I'm back from the short holidays. I will take a look at this issue
soon. Stay tuned!

Laters!

On Mon, Feb 9, 2015 at 9:28 AM, Christian Bauer
m...@christianbauer.name wrote:
 https://issues.apache.org/jira/browse/CAMEL-8325

 On February 8, 2015 7:35:56 PM GMT+01:00, Claus Ibsen claus.ib...@gmail.com 
 wrote:
On Fri, Feb 6, 2015 at 10:43 AM, Christian Bauer
m...@christianbauer.name wrote:
 Hi everyone,

 recently we had a typo in one of our route definitions that resulted
in a duplicate route ID but no error message and unexpected replacement
of an existing route. This is the bootstrap order found in some Camel
examples:

 CamelContext context = new DefaultCamelContext();

 context.addRoutes(new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(direct:foo).routeId(foo).stop();
 }
 });

 context.addRoutes(new RouteBuilder() {
 @Override
 public void configure() throws Exception {
 from(direct:bar).routeId(foo).stop();
 }
 });

 context.start();

 You'll get a duplicate route ID exception.

 If instead you start the context before you add the routes, you won't
get an exception and the direct:bar route will simply replace the
direct:foo route, as they have the same ID. This is consistent with
the Javadoc of the API and probably a useful feature.

 However if like in our case you use camel-spring-boot, the
RouteCollector will add routes after the Camel context has started. You
won't detect duplicate route IDs but instead any later discovered
RouteBuilder will override existing routes with the same ID.


Ah yeah I guess maybe camel-spring-boot calls start on CamelContext to
soon.

As currently you can add your own duplication route id detection and
fail.



 I'm no Spring expert but it seems the CamelContext start should be
deferred in the Spring Boot integration code: The
CamelBeanPostProcessor factory method triggers CamelContext creation
(due to injection in the factory method) and starts SpringCamelContext
during the BeanPostProcessor initialization phase in Spring
(InitializingBean). Any necessary transitive bean creation will
therefore also happen in that phase. We see a lot of Spring warnings
(actually INFO, but it probably should be WARN) that some
BeanPostProcessors had to be skipped, because we are starting inside a
BeanPostProcessor call.


Yeah I think it should start later. In camel-spring we only start
camel at the end when we receive an event from spring itself about the
context created/refresh.

Maybe if Henryk got some time he could dive in and look as well.

But anyone is of course welcome to help. We love contributions.
And you are welcome to log a JIRA ticket, it does indeed appear as the
start() is invoked too soon, which can also cause other side-effects.

eg start should only be called after all the configuration has been
done.


 One of those is for example our custom BeanPostProcessor which adds
discovered EventNotifiers to the CamelContext, something the Spring
Boot integration doesn't provide yet. We think this has to be done
before the CamelContext is started, after looking at the
ManagementStrategy code. Hence you can't do this with the
CamelConfiguration interface of camel-spring-boot, the context has
already been started at that point.

 Our solution was a simple integration class for Spring Boot that
starts the context later, after configuration. Would be great to know
if we are missing something, although we'll probably stay on 2.14
anyway for this project due end of March.

 Cheers,
 Christian








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



-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Production deploy options - standalone jvm vs war multi-homed jetty

2015-01-07 Thread Henryk Konsek
Hi Chris,

1. Who here has experience and advice with each of the above three
solutions?

Putting many WARs into the same Tomcat tends to leak class loaders
during hot redeploys (leading to memory leaks sooner or later). I
would rather recommend deploying standalone jars instead. The really
cool option is Spring Boot fat war. This is regular war file that can
be executed using java -jar or deployed into the servlet container.
So you can start with standalone wars (executed via java -jar) and in
case of devOps issues, migrate to Tomcat/FildFly-hosted WARs without
any problems. Fat wars are my favorite unit of deployment due to its
flexibility.

2. The threading model is what concerns me most with running jetty vs
standalone.  With PollingConsumes Threads are being created to manage each
consume, does the thread model differ between standalone vs running inside
jetty.

Well, you end up with a HTTP connection pool anyway, no matter where
you deploy to. :) The really nice option to consider is fat war [1]
with Netty HTTP [2] component. It is fast, scales like hell and is
extremely easy to set up.

3. New rest functionality.  Since I am running inside of jetty, do we
need to use the netty component, or can we leverage the containers servlet
functionality?

You can do both. However I would recommend to base your REST API on
the embedded Netty HTTP instead [2]. You got extra performance for
free. Camel REST works really well with Netty.

4. I have also had some trouble with shading jars in the past, any pros
or cons with this that can be shared?

You mentioned that you're looking at Spring Boot. If so, then use
Spring Boot Maven plugin to perform the shading for you. Works like a
charm.

 I am really not interested in the difference between tomcat, jetty, or
 jvm.
 Am I just getting the functionality of the container, or does
 it the route actually run differently.

Route will work the same until you configure it to take advantage of
the servlet container you deploy to. However I personally prefer to
use embedded HTTP connectors. They are much easier to deploy and test
for end-to-end scenarios.

Cheers.

[1] 
http://spring.io/blog/2014/03/07/deploying-spring-boot-applications#what-about-the-java-ee-application-server
[2] http://camel.apache.org/netty-http.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: streaming results using rest dsl

2015-01-03 Thread Henryk Konsek
Hi Tim,

 Is there a way to stream output using the Rest DSL?

I used the following to download stream of bytes from the REST API:

rest(/api).

get(/download).bindingMode(RestBindingMode.off).produces('application/octet-stream').route().
setBody().constant(new ByteArrayOutputStream(foo.getBytes()));.

So I guess that setting OutputStream as the response body should do the trick.

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Update mongoDb objects from blueprint xml routes

2014-11-12 Thread Henryk Konsek
Hi,

 Is it possibile to update MongoDb Objects from a route defined in a
 blueprint XML file?

Sure it is :) .

 I cannot find an example of creating a ListDBObject
 without java code.

Yeah, the route itself can be defined in XML, but the body you send
into that route may require something more expressive than XML :) . If
you would like to set some non-trivial body in the route (like
DbObject instance), you can consider using Groovy component [1] for
that:

setBody
  groovynew DbObject(...)/groovy
/setBody

However in most cases you would like to create the body outside the
route and send it to the consumer starting that route.

Cheers.

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

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel-boot autowiring issue

2014-11-07 Thread Henryk Konsek
 Oops, my bad,  the issue is that spring-boot-autoconfigure dependency is only
 available for test scope

Everything's OK then? :)

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel-boot autowiring issue

2014-11-07 Thread Henryk Konsek
 Looks like for the main, optional flag makes some classpath magic not
 working :)
 dependency
 groupIdorg.springframework.boot/groupId
 artifactIdspring-boot-starter/artifactId
 version${spring-boot.version}/version
 *optionaltrue/optional*

Have you got any concrete example demonstrating this issue? I'd like
to keep this dependency optional, as it should be up to the developer
to pick the Spring Boot version of his/her choice.

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel-boot autowiring issue

2014-11-06 Thread Henryk Konsek
Hi,

 OK, I can see possible improvement for camel-spring-boot, as well as
 small misconfiguration in your project. I'll send more details later
 today. Stay tuned :)

I tuned the camel-spring-boot code to postpone the moment of injecting
routes until all beans are initialized. This will help to deal with
the situations when you inject CamelContext into the configuration
creating RoutesBuilder. To be honest this kind of injection
(CamelContext into the RoutesBuilder or its config file) is rather the
anti-pattern IMHO as routes builders shouldn't be aware of  the
CamelContext, but after my improvement it is possible.

All you need to change in your example now is to swap config files order:

@SpringApplicationConfiguration(classes =
{CamelConfigurationTest.class, CamelConfiguration.class})
... instead of ...
@SpringApplicationConfiguration(classes = {CamelConfiguration.class,
CamelConfigurationTest.class})

You need to load test config before the regular configuration. This is
general rule for Spring Java configurations.

Let me know if it works for you with new snapshot and swapped configs.
Works like a charm on my machine [1] :) . Ping me in case of any
additional problems.

Cheers.

PS Give a moment for our CI server to deploy new snapshots or build it
locally from the master branch.

[1] http://sd.keepcalm-o-matic.co.uk/i/keep-calm-it-works-on-my-machine-8.png

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Configuring hibernate with blueprint in karaf

2014-11-06 Thread Henryk Konsek
Hi,

 We are trying to deploy a hibernate based jpa application in karaf. But we
 are facing issue for no suitable provider class.

Here [1] is the complete working example of Hibernate 4.2 with
Blueprint and Aries transaction management. Backed by Pax Exam tests,
so you can verify it works indeed by executing 'mvn install' :) . We
use similar configuration of Hibernate in Fuse 6.1.

Laters!

[1] 
https://github.com/hekonsek/fuse-pocs/tree/master/fuse-pocs-blueprint-hibernate42

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel-boot autowiring issue

2014-11-05 Thread Henryk Konsek
Hi,

 Here is sample project I prepared to demonstrate the issue:

I will take a look it shortly. Thanks for reporting :) .

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel-boot autowiring issue

2014-11-05 Thread Henryk Konsek
OK, I can see possible improvement for camel-spring-boot, as well as
small misconfiguration in your project. I'll send more details later
today. Stay tuned :)


Cheers.

On Wed, Nov 5, 2014 at 3:53 PM, Henryk Konsek hekon...@gmail.com wrote:
 Hi,

 Here is sample project I prepared to demonstrate the issue:

 I will take a look it shortly. Thanks for reporting :) .

 Cheers.

 --
 Henryk Konsek
 http://henryk-konsek.blogspot.com



-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Ack by the end of WS chain (client WS - [WS - Camel - client WS] - WS) *image inside

2014-11-05 Thread Henryk Konsek
Hi,

 In other words, I'm wondering if the following is feasable:

Sending status code after endpoint call is common practice. Looks fair
for me :) .

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: EIP Icons for Cacoo

2014-11-04 Thread Henryk Konsek
Yay. Cool :) . Thanks!

On Tue, Nov 4, 2014 at 2:28 PM, Willem Jiang willem.ji...@gmail.com wrote:
 Thanks for sharing it with us :)


 --
 Willem Jiang

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



 On November 4, 2014 at 7:18:10 PM, sothach (phillips@gmail.com) wrote:
 If anyone is using Cacoo, I've just published a stencil containing the EIP
 icons to Cacoo Store (free)



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/EIP-Icons-for-Cacoo-tp5758493.html
 Sent from the Camel - Users mailing list archive at Nabble.com.





-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel-Cache 2.14.0 with MyBatis

2014-10-31 Thread Henryk Konsek
Hi,

 I'm looking at something that
 would automatically flush the cache for the key, run the mybatis query and
 cache its result again?

No such thing out of the box. You need to control the cache by
explicit calls to camel-cache operations. You can however consider
using interceptors [1] to partially automate such calls in the AOP
manner.

Cheers.

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

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel-Cache 2.14.0 with MyBatis

2014-10-31 Thread Henryk Konsek
Hi,

 Having a trigger seems to be a  simple solution, but does *camel provide a
 way to listen to a DB trigger*?

You can use trigger to invoke Camel endpoint. For example in Postgres
you can write modules in PL/Python [1] and invoke HTTP Netty endpoint
exposed by Camel. Messages from that endpoint can be routed to
invalidate the cache.

Cheers.

[1] http://www.postgresql.org/docs/9.1/static/plpython-trigger.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Zookeeper component RoutePolicy

2014-10-30 Thread Henryk Konsek
 What I want is to know if it is possible to when message 1 arrives
 the consumer A consumes it, when message 2 arrives the consumer B consumes
 it, when message 3 arrives the consumer A consumes it, and so on.

What about load balancer [1] then?

Laters!

[1] http://camel.apache.org/load-balancer.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Aggregate up to N ASAP

2014-10-30 Thread Henryk Konsek
 Henryk, that sounds like a limitation in the design of aggregators in Camel,
 rather than a necessarily desirable end goal.

Your aggregation predicate would make sense only for consumers which
can pull messages in the batch. If your consumer can do it, then you
should create custom aggregation completion predicate that is aware of
the fact that message received from consumer is in fact a batch of the
messages. Then your predicate could decide to complete aggregation if
received batch is big enough or continue to aggregate otherwise.

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Using named query parameters

2014-10-29 Thread Henryk Konsek
Hi,

 I'm still not sure if the way I'm trying to access the java.util.Map
 resultset with :#Position is the right way. It seems that nobody is using
 this feature at all (at least I cannot find any other samples on the
 internet).

If it is documented, then it is supposed to work. :) If you can
reproduce the issue, then it is a good candidate to bug report.

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: MQTT Request/Reply

2014-10-29 Thread Henryk Konsek
Hi,

 My current understanding is that every client must publish to a topic (e.g.
 TargetTopic) configured in my broker.

Yeah, I believe that exclusive reply topic is the best (only?) option
for MQTT to achieve In/Out communication.

 Due to the fact that I don't know how many clients will be there in future,
 I'm afraid to maintain thousands of response topics in my broker.

This is really a better question for the ActiveMQ mailing list, as
this is broker specific issue. In AMQ for example you can control the
eviction policy [1] of the topics, so you don't have to worry about
leaking topics.

Cheers.

[1] http://activemq.apache.org/delete-inactive-destinations.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Problems configuring FileIdempotentRepository

2014-10-29 Thread Henryk Konsek
 The underlying problem is that if the idempotent repository file doesn't
 exist Camel doesn't seem to create it.

If you can reproduce the issue with the Maven example, you could
create a Jira issue with bug report.

Cheers.


-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: I cant throw the correct HTTP status codes from camel.

2014-10-29 Thread Henryk Konsek
Hi,

  from(direct:channel2).onException(Exception.class).process(new
 LogError(HubConstants.CHANNEL2.getValue())).end().recipientList()
 .method(Util.class, getEndpoint);

Can you share the consumer part of the route with us? :)

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Aggregate up to N ASAP

2014-10-29 Thread Henryk Konsek
 Any waiting is redundant here, and only wastes capacity. I'd find
 it surprising if nobody else has a requirement to just process whatever has
 arrived and not wait for any more.

Time frames or message count (or the other predicate) are required to
define whatever in whatever has arrived :) .

Messages are collected one by one. It indicates that your completion
predicate would complete as soon as aggregator collected one message.
That's why it makes no sense.

Laters!

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: can camel throttle messages based a dynamic message key?

2014-10-28 Thread Henryk Konsek
Hi Niels,

 I would like to throttle all queries for foo/@id=A12, foo/@id=30 and
 foo/@id=A10 separately.

What about the content-base routing followed by the different
throttler definition for each choice path?

from(direct:a)
  .choice()
.when(...)
   .throttle(3).to(direct:b)
 .when(...)
   .throttle(30).to(direct:c)
 .otherwise()
   .to(direct:noThrottle);

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Consuming from an External WS given only the External WS WSDL definition

2014-10-28 Thread Henryk Konsek
Hi David,

 I am looking for either a java DSL example or an explanation as to how this
 can be done.

GroovyWS [1] can be used to dynamically call WSDL-based web services.
You can call it from Camel Groovy [2] component.

Laters!

[1] http://groovy.codehaus.org/GroovyWS
[2] http://camel.apache.org/groovy.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel use case with Akka

2014-10-28 Thread Henryk Konsek
Hi Gordon,

 Subscribe to websocket queue and retrieve json from the queue
 process each json thru Camel routes (atomically)
 assume large amount of data

You can achieve it with Camel alone or with Camel as the endpoint
point [1] delegating processing to the Akka.

 What would the appropriate design as far as fail over/
 dristributed/threading is concerned?

This is pretty wide question ;) Both Akka and Camel offers solutions
in this area.

 I am concerned that since Camel is single threaded(?) that we will not be
 able to process a huge amount of data in a timely fashion.

Camel can be multi-threaded and asynchronous [2] and will definitely
deal with the high message load :) .

 What have your experiences been?
 Is Akka a good choice? Any other options?

Have you considered using Vert.x?

Cheers.

[1] http://doc.akka.io/docs/akka/snapshot/scala/camel.html
[2] http://camel.apache.org/async.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Zookeeper component RoutePolicy

2014-10-27 Thread Henryk Konsek
Hi Marco,

 Though I would like to configur it to have
 more than one master running and to do something similar to a load balancer
 through the nodes. Is there any way to do it?

The ZooKeeperRoutePolicy constructor takes enabledCount as a second argument:

int enabledCount = 2;
new ZooKeeperRoutePolicy(zookeeper:localhost:39913/someapp/somepolicy, 2);

It allows you to control how many masters should be there.

Laters!

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Difference between bean(MyObject.class) and bean(new MyObject())

2014-10-27 Thread Henryk Konsek
Hi Jonathan,

 But if I simple replace the bean line with bean(new ComicBuilder(),  )
 then it works without putting the log command before.

No real difference between bean(Foo.class, method) and bean(new
Foo(), method) I'm aware of. Small Maven example reproducing the
issue will be useful - this might be a bug.

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Aggregate up to N ASAP

2014-10-27 Thread Henryk Konsek
Hi Baris,

 Is there a way to aggregate the first 100 messages from a seda if =100 are
 available, but just take however many are available if there are fewer?

As aggregating messages is a process, not a moment in time, you need
to specify some completion timeout duration. Too short timeout doesn't
really make sense, as router won't be able to collect anything in such
sort time.

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: ReportIncident tutorial - Logging Issue..

2014-10-25 Thread Henryk Konsek
Hi Jon,

Could you describe what was your original issue? Stacktrace will be useful :) .

Cheers.

On Sat, Oct 25, 2014 at 11:43 PM, Jonathan Jenkins j...@java2go.com wrote:
 Using version 2.14.0 - First time i've used Camel, so excuse if this is 
 obvious - but I'm having some difficulties getting the first step of the 
 ReportIncident tutorial working. Seems there have been some recent changes to 
 the LogEndpoint (see CAMEL-7599) - might have affected this example :-

 http://camel.apache.org/tutorial-example-reportincident-part2.html

 I had to modify sendToCamelLog as per below to get it working - call 
 endpoint.setProvidedLogger(..) as well as endpoint.start() ..

 Does this point to a bug or does the example require updating ?

 Thx Jon
 
private void sendToCamelLog(String name) {
 try {
 // get the log component
 Component component = camel.getComponent(log);

 // create an endpoint and configure it.
 // Notice the URI parameters this is a common pratice in Camel to 
 configure
 // endpoints based on URI.
 // com.mycompany.part2 = the log category used. Will log at INFO 
 level as default
 LogEndpoint endpoint = (LogEndpoint) 
 component.createEndpoint(log:org.apache.camel.example?level=DEBUG);
 //endpoint.setCamelContext(camel);
 
 endpoint.setProvidedLogger(LoggerFactory.getLogger(ReportIncidentEndpointImpl.class));
 endpoint.start();
 // create an Exchange that we want to send to the endpoint
 Exchange exchange = endpoint.createExchange();
 // set the in message payload (=body) with the name parameter
 exchange.getIn().setBody(name);

 // now we want to send the exchange to this endpoint and we then 
 need a producer
 // for this, so we create and start the producer.
 Producer producer = endpoint.createProducer();
 producer.start();
 // process the exchange will send the exchange to the log 
 component, that will process
 // the exchange and yes log the payload
 producer.process(exchange);

 // Exception was being generated during processing, but not 
 thrown.
 Exception exc = exchange.getException();
 if (exc != null) throw exc;

 // stop the producer, we want to be nice and cleanup
 producer.stop();


 } catch (Exception e) {
 // we ignore any exceptions and just rethrow as runtime
 throw new RuntimeException(e);

 }
 }




 Jonathan Jenkins
 +44 7789 847427
 j...@java2go.com mailto:jon.jenk...@tradingscreen.com



-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel with ActiveMQ

2014-04-14 Thread Henryk Konsek
 Do people normally run ActiveMQ within Karaf or outside of the container?

Usually you would like to put broker as a separated container for many
reasons - scalability, high availability and so forth. Having embedded
broker means also that the systems communicating via that broker are
tightly coupled - you won't be able to enqueue the messages while your
application is down (as the broker will be down at the same time).

My opinionated recommendation is to have a standalone broker by
default and stick to embedded one only if you really got a reason to
do so.

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: OutOfMemoryError when handling large file

2014-04-14 Thread Henryk Konsek
Hi Max,

 How can I prevent this?

What about storing only a path to the file (File#absolutePath()) in
the header instead of the java.io.File instance?

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: camel-dropbox

2014-04-11 Thread Henryk Konsek
Hi,

 last commit added a features.xml -- camel-feature

I've committed the Dropbox component to the master.

We need to polish it a little bit (move feature from component
src/resources directory to our common Camel feature, create Karaf
integration tests and so forth). I'll perform the clean during the
coming days.

Many thanks Giovanni for all your hard work. Would you consider
creating a documentation page for the component?

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel with ActiveMQ

2014-04-10 Thread Henryk Konsek
 But ActiveMQ alone can send/receive JMS message. What specific camel will do
 in this case ?

Provide EIP goodness. Plus easy integration with the other endpoints [1].

Cheers.

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

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: camel-dropbox

2014-03-12 Thread Henryk Konsek
Hi Giovani,

Tests in your camel-dropbox modules are failing with the following error:

org.apache.camel.component.dropbox.util.DropboxException: /XXX does
not exist or can't obtain metadata

Keep in mind that we should be able to 'mvn install' your component
without prior configuration of the Dropbox account coordinates. Can
you change your code so it doesn't require Dropbox account to
successfully build? If you want to include some integration tests in
the module, use Maven profile to enable/disable them (should be
disabled by default).

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: AW: Aggregator - complete when newExchange.header('x) != oldExchange.header(x)

2014-03-10 Thread Henryk Konsek
Hi Andrew,

 This does not work
 I've tried adding .eagerCheckCompletion() but with this i get NPE. It
 happens when each message is different (like A B C  E insread of A A B B C
 C).

Can you create the Jira ticket describing the NPE you mentioned?

How do you complete your aggregation? Have you tried using custom
predicate and .completionPredicate() DSL element?

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: camel-dropbox

2014-03-07 Thread Henryk Konsek
 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: camel-dropbox

2014-03-07 Thread Henryk Konsek
 If so, I would like to vote for a direct inclusion to the ASF branch.

The SDK is distributed on the Copyright (c) 2013 Dropbox Inc.
license. In POM there is MIT license element. On the other hand the
source code doesn't have license headers at all...

Are you sure we can include this component in ASF Camel?

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


  1   2   3   >