camel.component.activemq.broker-url doesnt seem to work with camel-activemq-starter:3.11.1

2021-08-24 Thread Ranabroto Ghosh
*#build.gradle*

dependencies {

   implementation 'org.springframework.boot:spring-boot-starter-web'
   implementation 'org.apache.camel.springboot:camel-activemq-starter:3.11.1'
   implementation 'org.apache.camel.springboot:camel-spring-boot-starter:3.11.1'
   implementation 'org.apache.camel:camel-servlet:3.11.1'
   testImplementation 'org.springframework.boot:spring-boot-starter-test'

   compileOnly 'org.projectlombok:lombok'
   annotationProcessor 'org.projectlombok:lombok'
}

*# application.properties*

spring.application.name= amq-load
#spring.activemq.broker-url=
tcp://someip:61616?jms.prefetchPolicy.queuePrefetch=30 "COMMENT:
WORKS"
camel.component.activemq.broker-url=
tcp://someip:61616?jms.prefetchPolicy.queuePrefetch=30 "COMMENT:
DOESNT WORK"
camel.component.activemq.concurrent-consumers= 5 "COMMENT: ALWAYS WORKS"
queue-name= test


Application Starting log: With properties 'camel.component.activemq.broker-url'


21-08-24 20:05:51.553  INFO 25358 --- [   main]
o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s):
8080 (http) with context path ''
2021-08-24 20:05:51.568  INFO 25358 --- [   main]
org.apache.camel.main.RoutesConfigurer   : Loaded 1 additional
RoutesBuilder from:
classpath:camel/*,classpath:camel-template/*,classpath:camel-rest/*
(took 13ms)
2021-08-24 20:05:52.191  INFO 25358 --- [   main]
o.apache.activemq.broker.BrokerService   : Using Persistence Adapter:
MemoryPersistenceAdapter
2021-08-24 20:05:52.343  INFO 25358 --- [   main]
o.apache.activemq.broker.BrokerService   : Apache ActiveMQ 5.16.3
(localhost, ID:ranaub-XPS-15-9570-38327-1629831952194-0:1) is starting
2021-08-24 20:05:52.348  INFO 25358 --- [   main]
o.apache.activemq.broker.BrokerService   : Apache ActiveMQ 5.16.3
(localhost, ID:ranaub-XPS-15-9570-38327-1629831952194-0:1) started
2021-08-24 20:05:52.348  INFO 25358 --- [   main]
o.apache.activemq.broker.BrokerService   : For help or more
information please see: http://activemq.apache.org
2021-08-24 20:05:52.371  INFO 25358 --- [   main]
o.a.activemq.broker.TransportConnector   : Connector vm://localhost
started
2021-08-24 20:05:52.397  INFO 25358 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Routes startup summary
(total:3 started:3)
2021-08-24 20:05:52.397  INFO 25358 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Started
route-with-delay (direct://with-delay)
2021-08-24 20:05:52.398  INFO 25358 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Started route-no-delay
(direct://no-delay)
2021-08-24 20:05:52.398  INFO 25358 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Started
route-from-queue (activemq://queue:test)
2021-08-24 20:05:52.398  INFO 25358 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.11.1
(camel-1) started in 459ms (build:38ms init:139ms start:282ms)
2021-08-24 20:05:52.404  INFO 25358 --- [   main]
c.g.amq.load.amqload.AmqLoadApplication  : Started AmqLoadApplication
in 2.706 seconds (JVM running for 2.956)


Application Starting log: With properties 'spring.activemq.broker-url'

2021-08-24 20:14:30.610  INFO 26120 --- [   main]
o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s):
8080 (http) with context path ''
2021-08-24 20:14:30.626  INFO 26120 --- [   main]
org.apache.camel.main.RoutesConfigurer   : Loaded 1 additional
RoutesBuilder from:
classpath:camel/*,classpath:camel-template/*,classpath:camel-rest/*
(took 13ms)
2021-08-24 20:14:31.419  INFO 26120 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Routes startup summary
(total:3 started:3)
2021-08-24 20:14:31.420  INFO 26120 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Started
route-with-delay (direct://with-delay)
2021-08-24 20:14:31.420  INFO 26120 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Started route-no-delay
(direct://no-delay)
2021-08-24 20:14:31.420  INFO 26120 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Started
route-from-queue (activemq://queue:test)
2021-08-24 20:14:31.421  INFO 26120 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.11.1
(camel-1) started in 422ms (build:36ms init:143ms start:243ms)
2021-08-24 20:14:31.435  INFO 26120 --- [   main]
c.g.amq.load.amqload.AmqLoadApplication  : Started AmqLoadApplication
in 2.741 seconds (JVM running for 2.998)


With properties 'camel.component.activemq.broker-url', not
understanding why it printed below line

"Apache ActiveMQ 5.16.3 (localhost,
ID:ranaub-XPS-15-9570-38327-1629831952194-0:1) is starting"

and not connected to the amq but if I use 'spring.activemq.broker-url'
then all works fine. 'camel.component.activemq.concurrent-consumers'
works regardless.

In camel's documentation 'camel.component.activemq.broker-url' is
recommended to use. Any suggestions please ?


Camel sftp starter 3.8.0 move on completion not working

2021-02-19 Thread Ranabroto Ghosh
http://camel.apache.org/schema/spring";>

  








${body}






its print all the logs  with name and address but after printing all Its
throwing below exception

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
rename file from: test.txt to: home/gcfonix/processed/test.txt
at
org.apache.camel.component.file.remote.SftpOperations.renameFile(SftpOperations.java:508)
at
org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:147)
at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:121)
at
org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:133)
at
org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:85)
at
org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:59)
at
org.apache.camel.support.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:91)
at
org.apache.camel.impl.engine.DefaultUnitOfWork.done(DefaultUnitOfWork.java:218)
at
org.apache.camel.support.UnitOfWorkHelper.doneUow(UnitOfWorkHelper.java:54)
at
org.apache.camel.impl.engine.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:680)
at
org.apache.camel.impl.engine.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:623)
at
org.apache.camel.impl.engine.CamelInternalProcessor$AsyncAfterTask.done(CamelInternalProcessor.java:199)
at org.apache.camel.AsyncCallback.run(AsyncCallback.java:44)
at
org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
at
org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
at
org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312)
at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:486)
at
org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:147)
at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:240)
at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:201)
at
org.apache.camel.support.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:190)
at
org.apache.camel.support.ScheduledPollConsumer.run(ScheduledPollConsumer.java:107)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at
java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.jcraft.jsch.SftpException: No such file
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873)
at com.jcraft.jsch.ChannelSftp.rename(ChannelSftp.java:1950)
at
org.apache.camel.component.file.remote.SftpOperations.renameFile(SftpOperations.java:504)
... 28 common frames omitted

its although successfully creates the directory but doesn't move the file


Re: Camel 3.0.0 Failed to start route route because of Multiple consumers for the same endpoint is not allowed

2020-03-24 Thread Ranabroto Ghosh
Hi Aymen,

For me issue was with using multiple camel context. Define your rest end
points using rest dsl in the same camel context where you have your camel
routes. So this is not a bug thus womt be resolved.

On Tue, 24 Mar 2020, 20:04 Aymen Furter,  wrote:

> Hi,
>
> I am having this exact behavior on Camel 3.1.0.
>
> @Ranabroto Ghosh: Did moving to 3.1.0 fix this issue for you?
>
> Cheers
> Aymen
>
> Am Do., 12. März 2020 um 14:52 Uhr schrieb Claus Ibsen <
> claus.ib...@gmail.com>:
>
>> Try with Camel 3.1.0
>>
>> On Thu, Mar 12, 2020 at 2:25 PM Ranabroto Ghosh
>>  wrote:
>> >
>> > Hi I am having this clueless problem
>> > *pom.xml: *
>> > 
>> > org.springframework.boot
>> > spring-boot-starter-web
>> > 
>> > 
>> >org.apache.camel.springboot
>> > camel-spring-boot-starter
>> >3.0.0
>> > 
>> > 
>> > org.apache.camel
>> > camel-jetty
>> > 3.0.0
>> > 
>> >
>> > *REST XML : *
>> > http://camel.apache.org/schema/spring";>
>> > 
>> > 
>> > 
>> > 
>> > 
>> > 
>> >
>> > *CAMEL ROUTE:*
>> > 
>> > 
>> >
>> >
>> >
>> >
>> > 200
>> > 
>> >  
>> >
>> > *EXCEPTION:*
>> > 2020-03-12 13:17:12,623 spring-ec2 INFO [main] SpringCamelContext:
>> Route:
>> > route1 started and consuming from: jetty:
>> > http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST
>> > 2020-03-12 13:17:12,625 spring-ec2 INFO [main] SpringCamelContext:
>> Route:
>> > route-test started and consuming from: direct://test
>> > 2020-03-12 13:17:12,627 spring-ec2 INFO [main] SpringCamelContext:
>> Apache
>> > Camel 3.0.0 (CamelContext: charge-process-fonix-context) is shutting
>> down
>> > 2020-03-12 13:17:12,628 spring-ec2 INFO [main] DefaultShutdownStrategy:
>> > Starting to graceful shutdown 2 routes (timeout 300 seconds)
>> > 2020-03-12 13:17:12,634 spring-ec2 INFO [Camel
>> > (charge-process-fonix-context) thread #1 - ShutdownTask]
>> > DefaultShutdownStrategy: Route: route-test shutdown complete, was
>> consuming
>> > from: direct://test
>> > 2020-03-12 13:17:12,639 spring-ec2 INFO [Camel
>> > (charge-process-fonix-context) thread #1 - ShutdownTask]
>> AbstractConnector:
>> > Stopped ServerConnector@26275b46{HTTP/1.1,[http/1.1]}{0.0.0.0:8081}
>> > 2020-03-12 13:17:12,642 spring-ec2 INFO [Camel
>> > (charge-process-fonix-context) thread #1 - ShutdownTask] ContextHandler:
>> > Stopped o.e.j.s.ServletContextHandler@274fdea6{/,null,UNAVAILABLE}
>> > 2020-03-12 13:17:12,644 spring-ec2 INFO [Camel
>> > (charge-process-fonix-context) thread #1 - ShutdownTask]
>> > DefaultShutdownStrategy: Route: route1 shutdown complete, was consuming
>> > from: jetty:
>> http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST
>> > 2020-03-12 13:17:12,644 spring-ec2 INFO [main] DefaultShutdownStrategy:
>> > Graceful shutdown of 2 routes completed in 0 seconds
>> > 2020-03-12 13:17:12,656 spring-ec2 INFO [main] SpringCamelContext:
>> Apache
>> > Camel 3.0.0 (CamelContext: charge-process-fonix-context) uptime 0.484
>> > seconds
>> > 2020-03-12 13:17:12,656 spring-ec2 INFO [main] SpringCamelContext:
>> Apache
>> > Camel 3.0.0 (CamelContext: charge-process-fonix-context) is shutdown in
>> > 0.029 seconds
>> > 2020-03-12 13:17:12,658 spring-ec2 ERROR [main] SpringCamelContext:
>> Error
>> > starting CamelContext (charge-process-fonix-context) due to exception
>> > thrown: Failed to start route route2 because of Multiple consumers for
>> the
>> > same endpoint is not allowed: jetty:
>> > http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST
>> >
>> > org.apache.camel.FailedToStartRouteException: Failed to start route
>> route2
>> > because of Multiple consumers for the same endpoint is not allowed:
>> jetty:
>> > http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST
>> >
>> >
>> > Not having this problem using camel version less than 3.0.0 is there a
>> bug
>> > in version 3 or above ?
>> >
>> >
>> >
>> > --
>> > Kind Regards
>> > Rana
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>


Camel 3.0.0 Failed to start route route because of Multiple consumers for the same endpoint is not allowed

2020-03-12 Thread Ranabroto Ghosh
Hi I am having this clueless problem
*pom.xml: *

org.springframework.boot
spring-boot-starter-web


   org.apache.camel.springboot
camel-spring-boot-starter
   3.0.0


org.apache.camel
camel-jetty
3.0.0


*REST XML : *
http://camel.apache.org/schema/spring";>







*CAMEL ROUTE:*


   
   
   
   
200

 

*EXCEPTION:*
2020-03-12 13:17:12,623 spring-ec2 INFO [main] SpringCamelContext: Route:
route1 started and consuming from: jetty:
http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST
2020-03-12 13:17:12,625 spring-ec2 INFO [main] SpringCamelContext: Route:
route-test started and consuming from: direct://test
2020-03-12 13:17:12,627 spring-ec2 INFO [main] SpringCamelContext: Apache
Camel 3.0.0 (CamelContext: charge-process-fonix-context) is shutting down
2020-03-12 13:17:12,628 spring-ec2 INFO [main] DefaultShutdownStrategy:
Starting to graceful shutdown 2 routes (timeout 300 seconds)
2020-03-12 13:17:12,634 spring-ec2 INFO [Camel
(charge-process-fonix-context) thread #1 - ShutdownTask]
DefaultShutdownStrategy: Route: route-test shutdown complete, was consuming
from: direct://test
2020-03-12 13:17:12,639 spring-ec2 INFO [Camel
(charge-process-fonix-context) thread #1 - ShutdownTask] AbstractConnector:
Stopped ServerConnector@26275b46{HTTP/1.1,[http/1.1]}{0.0.0.0:8081}
2020-03-12 13:17:12,642 spring-ec2 INFO [Camel
(charge-process-fonix-context) thread #1 - ShutdownTask] ContextHandler:
Stopped o.e.j.s.ServletContextHandler@274fdea6{/,null,UNAVAILABLE}
2020-03-12 13:17:12,644 spring-ec2 INFO [Camel
(charge-process-fonix-context) thread #1 - ShutdownTask]
DefaultShutdownStrategy: Route: route1 shutdown complete, was consuming
from: jetty:http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST
2020-03-12 13:17:12,644 spring-ec2 INFO [main] DefaultShutdownStrategy:
Graceful shutdown of 2 routes completed in 0 seconds
2020-03-12 13:17:12,656 spring-ec2 INFO [main] SpringCamelContext: Apache
Camel 3.0.0 (CamelContext: charge-process-fonix-context) uptime 0.484
seconds
2020-03-12 13:17:12,656 spring-ec2 INFO [main] SpringCamelContext: Apache
Camel 3.0.0 (CamelContext: charge-process-fonix-context) is shutdown in
0.029 seconds
2020-03-12 13:17:12,658 spring-ec2 ERROR [main] SpringCamelContext: Error
starting CamelContext (charge-process-fonix-context) due to exception
thrown: Failed to start route route2 because of Multiple consumers for the
same endpoint is not allowed: jetty:
http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST

org.apache.camel.FailedToStartRouteException: Failed to start route route2
because of Multiple consumers for the same endpoint is not allowed: jetty:
http://0.0.0.0:8081/api/notification?httpMethodRestrict=POST


Not having this problem using camel version less than 3.0.0 is there a bug
in version 3 or above ?



-- 
Kind Regards
Rana


serviceCall EIP not working with consul

2019-05-24 Thread Ranabroto Ghosh
I am using below in applicaiton.yml

camel:
   cloud:
  consul:
 service-discovery:
url: http://localhost:8500

then call another service which is registered in consul service discovery
like below



but always receiving this error :

java.util.concurrent.RejectedExecutionException: No active services with
name camel-consul-second

 Where am I going wrong here ?

-- 
Kind Regards
Rana


configure serviceCall eip with consul

2019-05-23 Thread Ranabroto Ghosh
I am using below in applicaiton.yml

camel:
   cloud:
  consul:
 service-discovery:
url: http://localhost:8500

then call another service which is registered in consul service discovery
like below


but always receiving this error

java.util.concurrent.RejectedExecutionException: No active services with
name camel-consul-second
 Where am I going wrong here ?
-- 
Kind Regards
Rana


camel consul; java.util.concurrent.RejectedExecutionException: No active services with name

2019-04-03 Thread Ranabroto Ghosh
Hi

I am having a weird problem, please read below

I have two simple came-spring-boot application exposing couple of REST
endpoints. I have a consul server running and I am using that as a service
discovery engine.

*Application 1: *

*bootstrap.yml*
spring:
   cloud:
  consul:
 host: localhost
 port: 8500
 discovery:
instanceId: camel-consul-first
healthCheckUrl: http://192.168.11.89:8081/api/my_camel_health
healthCheckInterval: 30s
 config:
enabled: true
 connect:
enabled:true
*application.yml*
camel:
   springboot:
  xmlRoutes: classpath:xml-route/*.xml
  main-run-controller: true
  xmlRests: classpath:xml-rest/*.xml
   cloud:
  consul:
 service-discovery:
url: http://localhost:8500

spring:
   application:
  name: camel-consul-first
server:
   port: 8080

*Route*



POST



${body}



*Application 2: *

*bootstrap.yml*
spring:
   cloud:
  consul:
 host: localhost
 port: 8500
 discovery:
instanceId: camel-consul-second
healthCheckUrl: http://192.168.11.89:8082/api/my_camel_health
healthCheckInterval: 30s

*application.yml*
camel:
   springboot:
  xmlRoutes: classpath:xml-route/*.xml
  main-run-controller: true
  xmlRests: classpath:xml-rest/*.xml

spring:
   application:
  name: camel-consul-second
server:
   port: 8083



So simply I am using serviceCall EIP from application 1 to call a REST api
from application 2. I can confirm both applications are registered
successfully with consul as when I browse
http://localhost:8500/ui/dc1/services I can see both service listed with
correct service name. But unfortunately I am receiving  below error

java.util.concurrent.RejectedExecutionException: No active services
with name camel-consul-second
at 
org.apache.camel.impl.cloud.DefaultServiceLoadBalancer.process(DefaultServiceLoadBalancer.java:134)
at 
org.apache.camel.impl.cloud.DefaultServiceCallProcessor.process(DefaultServiceCallProcessor.java:173)
at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
at 
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:76)
at 
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148)
at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)
at 
org.apache.camel.component.restlet.RestletConsumer$1.handle(RestletConsumer.java:68)
at 
org.apache.camel.component.restlet.MethodBasedRouter.handle(MethodBasedRouter.java:63)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.routing.Router.doHandle(Router.java:422)
at org.restlet.routing.Router.handle(Router.java:641)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.routing.Router.doHandle(Router.java:422)
at org.restlet.routing.Router.handle(Router.java:641)
at org.restlet.routing.Filter.doHandle(Filter.java:150)
at 
org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140)
at org.restlet.routing.Filter.handle(Filter.java:197)
at org.restlet.routing.Filter.doHandle(Filter.java:150)


Please help
-- 
Kind Regards
Rana


Re: can Eureka be used as service registry/discovery tool with Apache camel?

2018-08-20 Thread Ranabroto Ghosh
Thank you @Iburgazzoli, I tried as you said and its working.


Caller Microservice pom.xml, i just pasted related part



org.springframework.cloud
spring-cloud-starter-netflix-eureka-client



  org.apache.camel
  camel-spring-cloud-starter
  ${camel.version}


 
org.apache.camel
camel-http4
${camel.version}




Caller Camel route:
  










On 17 August 2018 at 14:30, lburgazzoli [via Camel] <
ml+s465427n5822314...@n5.nabble.com> wrote:

> Yes it is possible if you use spring-boot +
> spring-cloud-eureka-discovery + camel-spring-cloud.
> i.e. in camel-example-spring-cloud-servicecall we use consul but if
> you swap consul by eureka, it should work too as camle uses the
> generic DiscoveryClient implementation provided by spring-cloud.
>
> If it does not work, please raise a jira.
>
> ---
> Luca Burgazzoli
>
> On Fri, Aug 17, 2018 at 3:19 PM Ranabroto Ghosh
> <[hidden email] <http:///user/SendEmail.jtp?type=node&node=5822314&i=0>>
> wrote:
>
> >
> >  I wanted something like below,
> >
> > 
> >
> >
> > Can camel not use some component to discover the service URL from eureka
> > for this service?
> >
> > On 17 August 2018 at 13:41, Ranabroto Ghosh <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5822314&i=1>>
> wrote:
> >
> > > I want two simple camel micro-service application and they
> communicating
> > > using Eureka service discovery, is this possible? I found couple of
> > > examples camel using Consul but nowhere with Eureka. I would very
> thankful
> > > if anybody can help with a sample code example.
> > >
> > > --
> > > Kind Regards
> > > Rana
> > >
> >
> >
> >
> > --
> > Kind Regards
> > Rana
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/RE-can-Eureka-be-used-as-s
> ervice-registry-discovery-tool-with-Apache-camel-tp5822311p5822314.html
> To unsubscribe from Camel, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465427&code=cmFuYWJyb3RvLmdob3NoQGdsb2JhbGNoYXJnZS5jb218NDY1NDI3fC0xNDE1NjM5OTY5>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Kind Regards
Rana


Re: can Eureka be used as service registry/discovery tool with Apache camel?

2018-08-17 Thread Ranabroto Ghosh
 I wanted something like below,




Can camel not use some component to discover the service URL from eureka
for this service?

On 17 August 2018 at 13:41, Ranabroto Ghosh <
ranabroto.gh...@globalcharge.com> wrote:

> I want two simple camel micro-service application and they communicating
> using Eureka service discovery, is this possible? I found couple of
> examples camel using Consul but nowhere with Eureka. I would very thankful
> if anybody can help with a sample code example.
>
> --
> Kind Regards
> Rana
>



-- 
Kind Regards
Rana


can Eureka be used as service registry/discovery tool with Apache camel?

2018-08-17 Thread Ranabroto Ghosh
I want two simple camel micro-service application and they communicating
using Eureka service discovery, is this possible? I found couple of
examples camel using Consul but nowhere with Eureka. I would very thankful
if anybody can help with a sample code example.

-- 
Kind Regards
Rana


Problem writing camel logs with log4j in a spring-boot application

2018-08-06 Thread Ranabroto Ghosh
Hi
I have a Spring-boot application with Apache Camel. All I am trying to
achieve here writing all logs(java log and also camel route level logs
using camel 'log' EIP) in a log file using log4j.



*My POM: *

  
org.springframework.boot
spring-boot-starter-web
 

org.springframework.boot
spring-boot-starter-logging





org.apache.camel
camel-spring-boot
${camel.version}



   commons-logging
   commons-logging
   1.2


log4j
log4j
1.2.16
   


*LOG4J properties file: *
log4j.rootLogger=info, rollinglog, rollingerrorlog

log4j.logger.org.apache.camel=INFO

# File output configuration
log4j.appender.rollinglog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.rollinglog.File=C://logs/testgateway.log
log4j.appender.rollinglog.Threshold=INFO

# roll over the file at the end of each day and append the date to the end
of the file
log4j.appender.rollinglog.DatePattern='.'-MM-dd

# Configure the layout for the log file
log4j.appender.rollinglog.layout=org.apache.log4j.PatternLayout
log4j.appender.rollinglog.layout.ConversionPattern=(%d) %p %t %c - %m%n

# File output configuration
log4j.appender.rollingerrorlog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.rollingerrorlog.File=C://logs/ testgateway.log
log4j.appender.rollingerrorlog.Threshold=ERROR

# roll over the file at the end of each day and append the date to the end
of the file
log4j.appender.rollingerrorlog.DatePattern='.'-MM-dd

# Configure the layout for the log file
log4j.appender.rollingerrorlog.layout=org.apache.log4j.PatternLayout
log4j.appender.rollingerrorlog.layout.ConversionPattern=(%d) %p %t %c - %m%n


*My Camel route: *












So I am confused why camel log not getting printed from camel contexts
wjere java logs are working fine, could you please guide me what I am
missing here

-- 
Kind Regards
Rana


Re: can not locate rest api

2018-05-28 Thread Ranabroto Ghosh
My rest route if requires

http://camel.apache.org/schema/spring";>







On 28 May 2018 at 12:43, Ranabroto Ghosh 
wrote:

> Hi I am using springboot with Camel, my routes are getting started
> correctly but ca not trigger rest apis as i ca not locate them.
>
> *pom.xml *
> 
> http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
> 4.0.0
> com.camel
> spring-camel
> 0.0.1-SNAPSHOT
> jar
>
> spring-camel
> Demo project for Spring Boot
> 
> UTF-8
> UTF-8
> 1.8
> 2.21.0
> 
>
> 
> 
> org.apache.camel
> camel-spring-boot-starter
> ${camel.version}
> 
> 
> org.apache.camel
> camel-restlet
> ${camel.version}
> 
> 
>
> 
> 
> 
> org.springframework.boot
> spring-boot-maven-plugin
> 
> 
> 
> 
>
>
> *application.xml*
> camel.springboot.xmlRoutes = true
> camel.springboot.xmlRoutes = classpath:xml-route/*.xml
> camel.springboot.main-run-controller=true
> camel.springboot.xmlRests = true
> camel.springboot.xmlRests = classpath:xml-rest/*.xml
> server.port = 8084
> spring.application.name = spring-camel
>
> *Springboot Main class:*
>
> @SpringBootApplication
> @EnableAutoConfiguration
> public class SpringCamelApplication {
>
> public static void main(String[] args) {
> SpringApplication.run(SpringCamelApplication.class, args);
> }
> }
>
>
> *LOG after application started:*
>
> 2018-05-28 12:34:46.178  INFO 4852 --- [   main] 
> o.a.camel.spring.SpringCamelContext
> : StreamCaching is not in use. If using streams then its recommended to
> enable stream caching. See more details at http://camel.apache.org/
> stream-caching.html
> 2018-05-28 12:34:46.211  INFO 4852 --- [   main]
> o.a.camel.component.file.FileEndpoint: Endpoint is configured with
> noop=true so forcing endpoint to be idempotent as well
> 2018-05-28 12:34:46.211  INFO 4852 --- [   main]
> o.a.camel.component.file.FileEndpoint: Using default memory based
> idempotent repository with cache max size: 1000
> 2018-05-28 12:34:46.357  INFO 4852 --- [   main]
> o.a.camel.spring.boot.RoutesCollector: Starting
> CamelMainRunController to ensure the main thread keeps running
> 2018-05-28 12:34:46.361  INFO 4852 --- [   main] 
> o.a.camel.spring.SpringCamelContext
> : Route: first-route started and consuming from: direct://test
> 2018-05-28 12:34:46.374  INFO 4852 --- [   main] 
> o.a.camel.spring.SpringCamelContext
> : Route: second-route started and consuming from:
> file://E://inputFolder?noop=true
> 2018-05-28 12:34:46.384  INFO 4852 --- [   main] 
> o.a.camel.spring.SpringCamelContext
> : Route: route1 started and consuming from: restlet:///test?
> restletMethods=GET
> 2018-05-28 12:34:46.385  INFO 4852 --- [   main] 
> o.a.camel.spring.SpringCamelContext
> : Total 3 routes, of which 3 are started
> 2018-05-28 12:34:46.388  INFO 4852 --- [   main] 
> o.a.camel.spring.SpringCamelContext
> : Apache Camel 2.21.0 (CamelContext: camel-1) started in 0.471 seconds
> 2018-05-28 12:34:46.395  INFO 4852 --- [   main] 
> c.c.springcamel.SpringCamelApplication
>  : Started SpringCamelApplication in 3.543 seconds (JVM running for 3.878)
> 2018-05-28 12:34:47.389  INFO 4852 --- [E://inputFolder] second-route
>: ROUTE STARTED
>
>
>
> So clearly it says ' route1 started and consuming from: 
> restlet:///test?restletMethods=GET'
> but when i call http:localhost:8084/test its says unreachable.
>
>
> Badly need help, thanks in advance.
> --
> Kind Regards
> Rana
>



-- 
Kind Regards
Rana


can not locate rest api

2018-05-28 Thread Ranabroto Ghosh
Hi I am using springboot with Camel, my routes are getting started
correctly but ca not trigger rest apis as i ca not locate them.

*pom.xml *

http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
4.0.0
com.camel
spring-camel
0.0.1-SNAPSHOT
jar

spring-camel
Demo project for Spring Boot

UTF-8
UTF-8
1.8
2.21.0




org.apache.camel
camel-spring-boot-starter
${camel.version}


org.apache.camel
camel-restlet
${camel.version}






org.springframework.boot
spring-boot-maven-plugin






*application.xml*
camel.springboot.xmlRoutes = true
camel.springboot.xmlRoutes = classpath:xml-route/*.xml
camel.springboot.main-run-controller=true
camel.springboot.xmlRests = true
camel.springboot.xmlRests = classpath:xml-rest/*.xml
server.port = 8084
spring.application.name = spring-camel

*Springboot Main class:*

@SpringBootApplication
@EnableAutoConfiguration
public class SpringCamelApplication {

public static void main(String[] args) {
SpringApplication.run(SpringCamelApplication.class, args);
}
}


*LOG after application started:*

2018-05-28 12:34:46.178  INFO 4852 --- [   main]
o.a.camel.spring.SpringCamelContext  : StreamCaching is not in use. If
using streams then its recommended to enable stream caching. See more
details at http://camel.apache.org/stream-caching.html
2018-05-28 12:34:46.211  INFO 4852 --- [   main]
o.a.camel.component.file.FileEndpoint: Endpoint is configured with
noop=true so forcing endpoint to be idempotent as well
2018-05-28 12:34:46.211  INFO 4852 --- [   main]
o.a.camel.component.file.FileEndpoint: Using default memory based
idempotent repository with cache max size: 1000
2018-05-28 12:34:46.357  INFO 4852 --- [   main]
o.a.camel.spring.boot.RoutesCollector: Starting CamelMainRunController
to ensure the main thread keeps running
2018-05-28 12:34:46.361  INFO 4852 --- [   main]
o.a.camel.spring.SpringCamelContext  : Route: first-route started and
consuming from: direct://test
2018-05-28 12:34:46.374  INFO 4852 --- [   main]
o.a.camel.spring.SpringCamelContext  : Route: second-route started and
consuming from: file://E://inputFolder?noop=true
2018-05-28 12:34:46.384  INFO 4852 --- [   main]
o.a.camel.spring.SpringCamelContext  : Route: route1 started and
consuming from: restlet:///test?restletMethods=GET
2018-05-28 12:34:46.385  INFO 4852 --- [   main]
o.a.camel.spring.SpringCamelContext  : Total 3 routes, of which 3 are
started
2018-05-28 12:34:46.388  INFO 4852 --- [   main]
o.a.camel.spring.SpringCamelContext  : Apache Camel 2.21.0
(CamelContext: camel-1) started in 0.471 seconds
2018-05-28 12:34:46.395  INFO 4852 --- [   main]
c.c.springcamel.SpringCamelApplication   : Started SpringCamelApplication
in 3.543 seconds (JVM running for 3.878)
2018-05-28 12:34:47.389  INFO 4852 --- [E://inputFolder] second-route
   : ROUTE STARTED



So clearly it says ' route1 started and consuming from:
restlet:///test?restletMethods=GET' but when i call
http:localhost:8084/test its says unreachable.


Badly need help, thanks in advance.
-- 
Kind Regards
Rana


Re: Having problem with creating producer from camel route for Kafka

2018-03-07 Thread Ranabroto Ghosh
 I am sorry, yes i created another post and got solution already. Many
thanks.

On 7 March 2018 at 15:11, Ranabroto Ghosh 
wrote:

> I am sorry, yes i created another post and got solution already. Many
> thanks.
>
> On 7 March 2018 at 15:08, Claus Ibsen-2 [via Camel] <
> ml+s465427n5818244...@n5.nabble.com> wrote:
>
>> Hi
>>
>> We cannot se HTML emails with screenshots etc. Can you please post plain
>> text emails.
>>
>> On Wed, Mar 7, 2018 at 3:18 PM, Ranabroto Ghosh <
>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5818244&i=0>>
>> wrote:
>>
>> > Hi I have simple route triggered by REST api and want to put a message
>> to
>> > kafka
>> >
>> > pom.xml: using camel 2.20.0
>> >
>> >  Camel route:
>> >
>> >
>> >
>> > Error I get
>> >
>> >
>> > I have tried removing all unknown parameters, and tried simple
>> >
>> > 
>> >
>> > Then i get below erro
>> >
>> >
>> > I can confirm my kafka server is working fine, as i can put message and
>> > retried using kafka console create producer and consumer terminal.
>> >
>> >
>> >
>> > --
>> > Kind Regards
>> > Rana
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>>
>> --
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://camel.465427.n5.nabble.com/Having-problem-with-creati
>> ng-producer-from-camel-route-for-Kafka-tp5818237p5818244.html
>> To unsubscribe from Camel, click here
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465427&code=cmFuYWJyb3RvLmdob3NoQGdsb2JhbGNoYXJnZS5jb218NDY1NDI3fC0xNDE1NjM5OTY5>
>> .
>> NAML
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
> --
> Kind Regards
> Rana
>



-- 
Kind Regards
Rana


Re: Having problem while creating producer from camel route for Kafka

2018-03-07 Thread Ranabroto Ghosh
 Many thanks, it worked.

On 7 March 2018 at 14:52, Ranabroto Ghosh 
wrote:

> Many thanks, it worked.
>
> On 7 March 2018 at 14:35, Andrea Cosentino-2 [via Camel] <
> ml+s465427n581824...@n5.nabble.com> wrote:
>
>> The options you're trying to use are wrong:
>>
>> you need to use requestRequiredAcks instead of acks in the uri and
>> brokers instead of bootstrapServers.
>>
>> You can find the option here for 2.20.x
>>
>> https://github.com/apache/camel/blob/camel-2.20.x/components
>> /camel-kafka/src/main/docs/kafka-component.adoc
>>
>> --
>> Andrea Cosentino
>> --
>> Apache Camel PMC Member
>> Apache Karaf Committer
>> Apache Servicemix PMC Member
>> Email: [hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5818242&i=0>
>> Twitter: @oscerd2
>> Github: oscerd
>>
>>
>>
>>
>>
>>
>> On Wednesday, March 7, 2018, 3:30:55 PM GMT+1, Ranabroto Ghosh <[hidden
>> email] <http:///user/SendEmail.jtp?type=node&node=5818242&i=1>> wrote:
>>
>>
>>
>>
>>
>> Hello
>>
>> I have simple route triggered by REST api and want to put a message to
>> kafka
>>
>>
>> *pom.xml*
>>
>> 
>> org.apache.camel
>> camel-kafka
>> 2.20.0
>> 
>> 
>> org.apache.kafka
>> kafka-clients
>> 
>> 
>> 
>> 
>> org.apache.kafka
>> kafka-clients
>> 1.0.1
>> 
>>
>>
>> Camle Route:
>>
>> 
>> 
>> 
>> ${header.id}
>> 
>> 
>>
>> ${header.id}
>> 
>>
>>
>> I get below error:
>>
>> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
>> resolve endpoint: kafka://
>> rgdev8.globalcharge.com:9092?acks=0&bootstrapServers=rgdev8.
>> globalcharge.com%3A9092&clientId=test&groupId=test&
>> retries=0&serializerClass=org.apache.kafka.common.
>> serialization.ByteArraySerializer&topic=test_topic_rana
>> due to: There are 2 parameters that couldn't be set on the endpoint.
>> Check
>> the uri if the parameters are spelt correctly and that they are
>> properties
>> of the endpoint. Unknown parameters=[{acks=0, bootstrapServers=
>> rgdev8.globalcharge.com:9092}]
>> at
>> org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:215)
>>
>> at
>> org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:139)
>>
>> at
>> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:703)
>>
>> ... 86 more
>>
>>
>> I have tried removing all unknown parameters, and tried simple
>>
>> http://rgdev8.globalcharge.com:9092/?topic=test_topic_rana>"/>
>>
>> Then I get below error:
>>
>> Caused by: java.lang.NullPointerException
>> at java.util.Hashtable.put(Hashtable.java:460)
>> at
>> org.apache.camel.component.kafka.KafkaProducer.getProps(KafkaProducer.java:63)
>>
>> at
>> org.apache.camel.component.kafka.KafkaProducer.doStart(KafkaProducer.java:89)
>>
>> at
>> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
>> at
>> org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
>> at
>> org.apache.camel.impl.DeferServiceStartupListener.onCamelCon
>> textStarted(DeferServiceStartupListener.java:49)
>> at
>> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteSe
>> rvices(DefaultCamelContext.java:3846)
>> at
>> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRou
>> tes(DefaultCamelContext.java:3625)
>> at
>> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3477)
>>
>> at
>> org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:208)
>>
>> at
>> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3236)
>>
>> at
>> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3232)
>>
>> at
>> org.apache.camel.impl.DefaultCamelContext.doWithDefinedClass
>> Loader(DefaultCamelContext.java:3255)
>> at
>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3232)
>>
>> at

Having problem while creating producer from camel route for Kafka

2018-03-07 Thread Ranabroto Ghosh
 Hello

I have simple route triggered by REST api and want to put a message to kafka


*pom.xml*

 
org.apache.camel
camel-kafka
2.20.0


org.apache.kafka
kafka-clients




org.apache.kafka
kafka-clients
1.0.1



Camle Route:




${header.id}


${header.id}



I get below error:

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: kafka://
rgdev8.globalcharge.com:9092?acks=0&bootstrapServers=rgdev8.globalcharge.com%3A9092&clientId=test&groupId=test&retries=0&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer&topic=test_topic_rana
due to: There are 2 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown parameters=[{acks=0, bootstrapServers=
rgdev8.globalcharge.com:9092}]
at
org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:215)
at
org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:139)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:703)
... 86 more


I have tried removing all unknown parameters, and tried simple

http://rgdev8.globalcharge.com:9092/?topic=test_topic_rana>"/>

Then I get below error:

Caused by: java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:460)
at
org.apache.camel.component.kafka.KafkaProducer.getProps(KafkaProducer.java:63)
at
org.apache.camel.component.kafka.KafkaProducer.doStart(KafkaProducer.java:89)
at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
at
org.apache.camel.impl.DeferServiceStartupListener.onCamelContextStarted(DeferServiceStartupListener.java:49)
at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3846)
at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3625)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3477)
at
org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:208)
at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3236)
at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3232)
at
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3255)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3232)
at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3155)
at
org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:133)
... 64 more

I can confirm my kafka server is working fine, as i can put message and
retried using kafka console create producer and consumer terminal.  Please
help

-- 
Kind Regards
Rana


Having problem with creating producer from camel route for Kafka

2018-03-07 Thread Ranabroto Ghosh
Hi I have simple route triggered by REST api and want to put a message to
kafka

pom.xml: using camel 2.20.0

 Camel route:



Error I get


I have tried removing all unknown parameters, and tried simple



Then i get below erro


I can confirm my kafka server is working fine, as i can put message and
retried using kafka console create producer and consumer terminal.



-- 
Kind Regards
Rana