Re: Camel mock:end

2014-01-23 Thread Claus Ibsen
Yes mock keeps a copy of the exchange in memory. Though you can use
retainFirst/retainLast option to only keep X number of copies. Read
more about the mock at its website.


On Thu, Jan 23, 2014 at 3:36 AM, contactreji  wrote:
> Hi All
>
> I was using mock component as a sink element in one of the stubs i had
> created representing a destination system.
>
> Once pushed to mock:end, it is not used by any assertions statements /
> logic.
>
> *I wanted to know if the exchanges pushed to mock:end component will stay in
> memory or is the exchange destroyed by Garbage collector.
> *
> I am pushing about 50 xml data to mock:end every second. Would that over a
> period of time, fill up the jvm?
>
> Regards
> Reji Mathews
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-mock-end-tp5746370.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
Make your Camel applications look hawt, try: http://hawt.io


Re: I got weird problem with aggregator

2014-01-23 Thread Claus Ibsen
For JDBC you need to store serializable objects in the message as they
need to be able to be written to a database.

See at section what is preserved when persisting:
http://camel.apache.org/sql-component.html


On Wed, Jan 22, 2014 at 10:20 PM, nono  wrote:
> I got weird problem with jdbc aggregator   , could it be my aggregate method
> problem?
> I mean should i use Object instead of Map ?
> The problem does not happen often
>
>  public Exchange aggregate(Exchange oldEx, Exchange newEx) {
> Map newBody = newEx.getIn().getBody(Map.class);
> ArrayList list = null;
> if (oldEx == null) {
> list = new ArrayList();
> list.add(newBody);
> newEx.getIn().setBody(list);
> return newEx;
> } else {
> list = oldEx.getIn().getBody(ArrayList.class);
> list.add(newBody);
> return oldEx;
> }
> }
>
> below is error log
>  at
> org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:203)[141:org.apache.camel.camel-core:2.9.0.fuse-70-084]
>
> at
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.purge(AggregateProcessor.java:671)[141:org.apache.camel.camel-core:2.
>
> 9.0.fuse-70-084]
>
> at
> org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:159)[141:org.apache.camel.camel-core:2.9.0.fuse-70-084]
>
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_24]
>
> at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)[:1.6.0_24]
>
> at
> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)[:1.6.0_24]
>
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)[:1.6.0_24]
>
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)[:1.6.0_24]
>
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)[:1.6.0_24]
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_24]
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_24]
>
> at java.lang.Thread.run(Thread.java:662)[:1.6.0_24]
>
> Caused by: java.lang.ClassNotFoundException: null class
>
> at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)[:1.6.0_24]
>
> at
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)[:1.6.0_24]
>
> at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)[:1.6.0_24]
>
> at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)[:1.6.0_24]
>
> at
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)[:1.6.0_24]
>
> at java.util.HashMap.readObject(HashMap.java:1030)[:1.6.0_24]
>
> at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_24]
>
> at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_24]
>
> at
> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)[:1.6.0_24]
>
> at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)[:1.6.0_24]
>
> at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)[:1.6.0_24]
>
> at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)[:1.6.0_24]
>
> at
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)[:1.6.0_24]
>
> at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)[:1.6.0_24]
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/I-got-weird-problem-with-aggregator-tp5746367.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
Make your Camel applications look hawt, try: http://hawt.io


Re: Split and Aggregate - Old Exchange is null everytime in AggregationStrategy

2014-01-23 Thread Claus Ibsen
Looks like its your correlation expression that is a new group for
each message, eg each xpath result is different.

If you want to split and join the same messages then see this eip
http://camel.apache.org/composed-message-processor.html

And see the example using only splitter. That is much easier to do.

On Wed, Jan 22, 2014 at 9:36 PM, dinesh19aug  wrote:
> Hi,
>   I see that this question has been asked a number of times but none of post
> helped or had a conclusive solution. I am splitting a message and then
> aggregating it using Aggregator2. The code was throwing exception because
> oldExchange was always null. So to test I designed a small code.
>
> I read an orders,xml file which looks like this
> http://some/schema/Order";>
> 
> 1
> 
> 
> 2
> 
> 
> 3
> 
> 
> 5
> 
> 
> 6
> 
> 
>
> My camel Context Looks like this
> http://camel.apache.org/schema/spring";
> xmlns:te="http://acn/schema/Order";>
>
> 
> 
> 
> 
> //te:Orders/*
> 
>  
> 
>
> 
>
> 
> 
> 
> 
>
>  
> 
> 
> 
> //te:Order
> 
>   uri="file:src/data/catask/output?fileName=output.xml"/>
>
> 
> 
>
>   
>
> My Aggregation Strategy class looks like this
> public Exchange aggregate(Exchange oldExchange, Exchange 
> newExchange) {
> if (oldExchange == null) {
> System.out.println("Returning new exchange");
> return newExchange;
> }
>
> String oldBody = oldExchange.getIn().getBody(String.class);
> String newBody = newExchange.getIn().getBody(String.class);
> oldExchange.getIn().setBody(oldBody + "+" + newBody);
> return oldExchange;
> }
>
>
> The problem is that when the aggregated result is saved in output.xml file
> it contains only the last record it read from Orders.xml.
>
> i.e.
> http://some/schema/Order";>
> 6
> 
>
>
>
> I looked into it further and found that this was happening because after the
> first call oldExchange should have some value but it turns out it is always
> null. I think that because it is reading everything from a single file and
> splitting it, there is only exchange.
>
> Any suggestions??
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Split-and-Aggregate-Old-Exchange-is-null-everytime-in-AggregationStrategy-tp5746365.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
Make your Camel applications look hawt, try: http://hawt.io


Re: Dead letter queue and onException

2014-01-23 Thread Claus Ibsen
What Camel version do you use?

On Wed, Jan 22, 2014 at 8:19 PM, bocamel  wrote:
> It seems that whenever an error is caught by onException, regardless whether
> handled is set to true or false, the failed message would not be written to
> the dead letter queue.  Here is a sample project to demonstrate this:
>
> http://www.springframework.org/schema/beans";
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>xmlns:camel="http://camel.apache.org/schema/spring";
>xsi:schemaLocation="
>http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd";>
>
>class="com.pci.FileDeadChannel.ThrowExceptionProcessor" />
>
>   http://camel.apache.org/schema/spring";
> trace="true" handleFault="true" errorHandlerRef="dlc">
>
>  deadLetterUri="file:log/dead">
>  redeliveryDelay="5000"
> retryAttemptedLogLevel="WARN"
> logHandled="true"/>
> 
>
> 
> 
> java.lang.RuntimeException
>  redeliveryDelay="1"
> />
> 
> false
> 
> 
>
> 
>   
>   
> 
>   
>
> 
>
> Is this correct?  Is there a way to add some configuration in the
> onException to still use the dead letter queue?
>
> Thanks!
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Dead-letter-queue-and-onException-tp5746362.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
Make your Camel applications look hawt, try: http://hawt.io


Re: Apache Camel and Jboss FUSE IDE

2014-01-23 Thread Claus Ibsen
Fuse IDE is just an Eclipse based editor. You can use it for any kind
of Java development. It just has a graphical UI for editing Camel
routes as well.

To run Java applications you can use maven to start the JVM, which you
eg can do for unit testing etc. Or use maven goals that can startup
Camel / ActiveMQ etc. And Eclipse has built-in Maven support out of
the box, so you can do the same from within Eclipse itself.

To create new Camel projects you can use Maven archetypes
http://camel.apache.org/camel-maven-archetypes.html

For example there is an archetype to create a sample project with
Camel + ActiveMQ.

And Camel has some Maven goals to run Camel.
http://camel.apache.org/camel-maven-plugin.html



On Thu, Jan 23, 2014 at 8:13 AM, gadido30  wrote:
> Thank You,
>
> sorry about my newbie question , I still don't know what to do:
>
> Do I need to run ActiveMQ with Camel Core and then add Maven Project with
> camel and activemq project?
>
> I will be glad to know what should I run for using Fuse IDE + Camel +
> ActiveMQ
>
> Gadi
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Apache-Camel-and-Jboss-FUSE-IDE-tp5746328p5746379.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
Make your Camel applications look hawt, try: http://hawt.io


Bean cannot be instantiated

2014-01-23 Thread Muhzin
Hi all,
I'm trying to run a camel application on karaf 3.0.0 using blueprint

*Blueprint.xml *


http://www.osgi.org/xmlns/blueprint/v1.0.0";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xmlns:camel="http://camel.apache.org/schema/blueprint";
   xsi:schemaLocation="
   http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
   http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd";>














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






*profileSync Class*

public class ProfileSync extends RouteBuilder {

@Override
public void configure() throws Exception {
from("?amazonSQSClient=#sqsClient")
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception
{

String rawMessage =
exchange.getIn().getBody(String.class);
Gson gson = new GsonBuilder().create();
Message message = gson.fromJson(rawMessage,
Message.class);
System.out.println(message.toString());
}
});
}
}


When trying to start my container, it fails and following error is produced.

2014-01-23 12:15:03,902 | INFO  | Local user karaf | VersionInfoUtils
  | 115 - org.apache.servicemix.bundles.aws-java-sdk - 1.6.7.1 |
Unable to load version information for the running SDK:
com/amazonaws/sdk/versionInfo.properties not found on classpath
2014-01-23 12:15:07,492 | INFO  | Local user karaf | BlueprintCamelContext
   | 85 - org.apache.camel.camel-core - 2.12.1 | Apache Camel
2.12.1 (CamelContext: blueprintContext) is starting
2014-01-23 12:15:07,492 | INFO  | Local user karaf |
ManagedManagementStrategy| 85 - org.apache.camel.camel-core -
2.12.1 | JMX is enabled
2014-01-23 12:15:07,735 | INFO  | Local user karaf | BlueprintCamelContext
   | 85 - org.apache.camel.camel-core - 2.12.1 | Apache Camel
2.12.1 (CamelContext: blueprintContext) is shutting down
2014-01-23 12:15:07,737 | INFO  | Local user karaf | BlueprintCamelContext
   | 85 - org.apache.camel.camel-core - 2.12.1 | Apache Camel
2.12.1 (CamelContext: blueprintContext) uptime 0.245 seconds
2014-01-23 12:15:07,737 | INFO  | Local user karaf | BlueprintCamelContext
   | 85 - org.apache.camel.camel-core - 2.12.1 | Apache Camel
2.12.1 (CamelContext: blueprintContext) is shutdown in 0.002 seconds
2014-01-23 12:15:07,738 | ERROR | Local user karaf | BlueprintCamelContext
   | 87 - org.apache.camel.camel-blueprint - 2.12.1 | Error
occurred during starting Camel: CamelContext(blueprintContext) due Failed
to create route route4:
Route(route4)[[From[aws-sqs://sqs.ap-southeast-1.amazonaws.c... because of
Failed to resolve endpoint:
aws-sqs://?amazonSQSClient=%23sqsClient due to: Cannot lookup:
sqsClient from registry:
org.apache.camel.blueprint.BlueprintContainerRegistry@2dae66c6 with
expected type: interface com.amazonaws.services.sqs.AmazonSQS due: Error
when instantiating bean sqsClient of class class
com.amazonaws.services.sqs.AmazonSQSClient
org.apache.camel.FailedToCreateRouteException: Failed to create route
route4: Route(route4)[[From[aws-sqs://sqs.ap-southeast-1.amazonaws.c...
because of Failed to resolve endpoint:
aws-sqs://?amazonSQSClient=%23sqsClient due to: Cannot lookup:
sqsClient from registry:
org.apache.camel.blueprint.BlueprintContainerRegistry@2dae66c6 with
expected type: interface com.amazonaws.services.sqs.AmazonSQS due: Error
when instantiating bean sqsClient of class class
com.amazonaws.services.sqs.AmazonSQSClient
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:182)
at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:770)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1670)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
at
org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:177)
at
org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:209)
at
org.apache.camel.blueprint.BlueprintCamelContext.serviceChanged(BlueprintCamelContext.java:147)
at
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932)
at
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
at
org.apache.felix.framework.util.EventDispatcher.fireServic

Re: I got weird problem with aggregator

2014-01-23 Thread nono
Then it should work,

Because  Map is HashMap, key and value are string , which stored in Map. 

More  exception information  like below. the problem happened when i update
my bundle.
i guess what stored in jdbc aggreator table is only Exchange 

05:28:40,083 | WARN  | teTimeoutChecker | eProcessor$AggregationTimeoutMap |
141 - org.apache.camel.camel-core - 2.9.0.fuse-70-084 | Exception occurred
during purge task. This exception will be ignored.
java.lang.RuntimeException: java.lang.ClassNotFoundException: null class
at
org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$2.doInTransaction(JdbcAggregationRepository.java:180)[260:org.apache.camel.camel-sql:2.9.0.fuse-70-084]
at
org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$2.doInTransaction(JdbcAggregationRepository.java:166)[260:org.apache.camel.camel-sql:2.9.0.fuse-70-084]
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)[143:org.springframework.transaction:3.0.7.RELEASE]
at
org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:166)[260:org.apache.camel.camel-sql:2.9.0.fuse-70-084]
at
org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:158)[260:org.apache.camel.camel-sql:2.9.0.fuse-70-084]
at
org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.onEviction(AggregateProcessor.java:688)[141:org.apache.camel.camel-core:2.9.0.fuse-70-084]
at
org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.onEviction(AggregateProcessor.java:659)[141:org.apache.camel.camel-core:2.9.0.fuse-70-084]
at
org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:203)[141:org.apache.camel.camel-core:2.9.0.fuse-70-084]
at org.apache.camel.process



--
View this message in context: 
http://camel.465427.n5.nabble.com/I-got-weird-problem-with-aggregator-tp5746367p5746387.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Bean cannot be instantiated

2014-01-23 Thread Muhzin
Hi all,

Resolved the issue. I had multiple aws-sdk version installed in my ESB. I
removed one of it and it fixed up the issue.

Sorry for any troubles caused.


On Thu, Jan 23, 2014 at 2:09 PM, Muhzin  wrote:

> Hi all,
> I'm trying to run a camel application on karaf 3.0.0 using blueprint
>
> *Blueprint.xml *
>
> 
> http://www.osgi.org/xmlns/blueprint/v1.0.0";
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>xmlns:camel="http://camel.apache.org/schema/blueprint";
>xsi:schemaLocation="
>http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
>http://camel.apache.org/schema/blueprint
> http://camel.apache.org/schema/blueprint/camel-blueprint.xsd";>
>
>
>  class="com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider"/>
>  factory-method="getRegion" >
> 
> 
>
>  class="com.amazonaws.services.sqs.AmazonSQSClient">
> 
> 
> 
>
> 
> 
> http://camel.apache.org/schema/blueprint";>
> 
> 
>
> 
>
>
> *profileSync Class*
>
> public class ProfileSync extends RouteBuilder {
>
> @Override
> public void configure() throws Exception {
> from("?amazonSQSClient=#sqsClient")
> .process(new Processor() {
> @Override
> public void process(Exchange exchange) throws
> Exception {
>
> String rawMessage =
> exchange.getIn().getBody(String.class);
> Gson gson = new GsonBuilder().create();
> Message message = gson.fromJson(rawMessage,
> Message.class);
> System.out.println(message.toString());
> }
> });
> }
> }
>
>
> When trying to start my container, it fails and following error is
> produced.
>
> 2014-01-23 12:15:03,902 | INFO  | Local user karaf | VersionInfoUtils
> | 115 - org.apache.servicemix.bundles.aws-java-sdk - 1.6.7.1 |
> Unable to load version information for the running SDK:
> com/amazonaws/sdk/versionInfo.properties not found on classpath
> 2014-01-23 12:15:07,492 | INFO  | Local user karaf | BlueprintCamelContext
>| 85 - org.apache.camel.camel-core - 2.12.1 | Apache Camel
> 2.12.1 (CamelContext: blueprintContext) is starting
> 2014-01-23 12:15:07,492 | INFO  | Local user karaf |
> ManagedManagementStrategy| 85 - org.apache.camel.camel-core -
> 2.12.1 | JMX is enabled
> 2014-01-23 12:15:07,735 | INFO  | Local user karaf | BlueprintCamelContext
>| 85 - org.apache.camel.camel-core - 2.12.1 | Apache Camel
> 2.12.1 (CamelContext: blueprintContext) is shutting down
> 2014-01-23 12:15:07,737 | INFO  | Local user karaf | BlueprintCamelContext
>| 85 - org.apache.camel.camel-core - 2.12.1 | Apache Camel
> 2.12.1 (CamelContext: blueprintContext) uptime 0.245 seconds
> 2014-01-23 12:15:07,737 | INFO  | Local user karaf | BlueprintCamelContext
>| 85 - org.apache.camel.camel-core - 2.12.1 | Apache Camel
> 2.12.1 (CamelContext: blueprintContext) is shutdown in 0.002 seconds
> 2014-01-23 12:15:07,738 | ERROR | Local user karaf | BlueprintCamelContext
>| 87 - org.apache.camel.camel-blueprint - 2.12.1 | Error
> occurred during starting Camel: CamelContext(blueprintContext) due Failed
> to create route route4:
> Route(route4)[[From[aws-sqs://sqs.ap-southeast-1.amazonaws.c... because of
> Failed to resolve endpoint:
> aws-sqs://?amazonSQSClient=%23sqsClient due to: Cannot lookup:
> sqsClient from registry:
> org.apache.camel.blueprint.BlueprintContainerRegistry@2dae66c6 with
> expected type: interface com.amazonaws.services.sqs.AmazonSQS due: Error
> when instantiating bean sqsClient of class class
> com.amazonaws.services.sqs.AmazonSQSClient
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> route4: Route(route4)[[From[aws-sqs://sqs.ap-southeast-1.amazonaws.c...
> because of Failed to resolve endpoint:
> aws-sqs://?amazonSQSClient=%23sqsClient due to: Cannot lookup:
> sqsClient from registry:
> org.apache.camel.blueprint.BlueprintContainerRegistry@2dae66c6 with
> expected type: interface com.amazonaws.services.sqs.AmazonSQS due: Error
> when instantiating bean sqsClient of class class
> com.amazonaws.services.sqs.AmazonSQSClient
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:182)
> at
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:770)
> at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1670)
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
> at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.ja

Re: Bindy component: more than one model object per package

2014-01-23 Thread MohamedAli
Hello All,
I am using Camel 2.12.2 version, facing the same problem.

Is this feature available in Camel 3.0 now? 

Please tell me when this could be ready?

Thanks in advance



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bindy-component-more-than-one-model-object-per-package-tp4793295p5746390.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel v2.12 | CXF Component | Basic Authentication | Web Service

2014-01-23 Thread manchandap
Thanks Willem,

>> As the CxfProducer is created during the camel context start the route,
>> the cxfEndpoint’s property is not updated. 
That was my hunch, however i was not able to prove it concretely. I will try
your suggestion of updating the property in Route Builder's configure
method.

Thanks and Regards
Prince Manchanda



--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-v2-12-CXF-Component-Basic-Authentication-Web-Service-tp5746233p5746392.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Questions about cxfrs

2014-01-23 Thread Sergey Beryozkin

Hi,

I haven't had a chance to look into it yet, will do asap
What about this alternative (assuming you'd like to do it the JAX-RS way):
Create a CXF jaxrs:server entry endpoint with the address like 
"camel://myservice", and link to it from Camel Servlet. This endpoint 
service implementation will be a regular JAX-RS server (there will be no 
null returns, etc) which will do a couple of HTTP invocations using 
whatever Http API is preferred, example, you can try CXF WebClient or 
proxy support.
Not sure if it will fir the purpose, suggesting it as a possible 
workaround.


Sergey

On 22/01/14 22:13, David wrote:

I tried using org.apache.cxf.jaxrs.provider.json.JSONProvider as the JSON
provider instead of JacksonJsonProvider, and that results in an exception
being thrown, telling me that no message body reader was found for my
class. I'm using the same test case that's attached to the JIRA, just with
a different JSON provider, and adding @XmlRootElement(name="container") to
the domain class.



On Wed, Jan 22, 2014 at 5:23 AM, Sergey Beryozkin wrote:


Hi, sure, I only referenced Jettison as a possible alternative.
I think Jackson is picked up, Jettison only works, as you mentioned, with
JAXB sending the write events to it, and as I understand you've no
XMLRootElement/etc added to the data beans

Sergey

On 21/01/14 21:14, David wrote:


Comments in-line.


On Tue, Jan 21, 2014 at 12:34 PM, Sergey Beryozkin 
wrote:


  Hi

Please see comments below,

On 21/01/14 17:01, David wrote:

  I think this is more of a Camel question than a CXF question, but let me

know if that's not the case (would it have been bad form to cross-post
this
to cxf-user?).

I have questions regarding use of Jackson with CXF, as well as how to
get
CXFRS not to wrap the root value of a JSON payload.

I am trying to use Camel and CXF as part of a service orchestration
using
JSON over REST. My biggest question is how to configure cxfrs to use
Jackson for all JSON marshal/unmarshal operations.

So far, I've configured a cxf:rsServer and added a cxf:providers element
with a reference to a org.codehaus.jackson.jaxrs.JacksonJsonProvider
bean.
I've also added the following to my route, although I haven't found
anywhere to reference it yet:

   
   
   

I'm basically exposing the configured cxf:rsServer service as an
external
entry-point:

http://localhost:8182";
serviceClass="org.my.Service"
loggingFeatureEnabled="true">






I'm then using a couple cxfrs producer endpoints to invoke external
REST/JSON services implemented using RESTEasy:

   
   POST
   
   
   /service1/operation1
   
   
   application/json
   
   http://localhost:8080?exchangePattern=InOut"/>
   
   POST
   
   
   /service2/operation2
   
   
   application/json
   
   http://localhost:8080?exchangePattern=InOut"/>


The idea is that each of those services will modify the payload, and the
resulting object will be passed back to the caller.

The services themselves are pretty standard. Class annotated with @Path,
along with a single method annotated with @POST, @Consumes and @Produces
(both types are set to MediaType.APPLICATION_JSON). The methods expect
and
return a single container class with id and a couple string values.

When I call my service, however, an exception is thrown by the code
that's
attempting to call the cxfrs producer endpoint, saying there's no
message
body writer for my container class and applicaiton/json. At one point I
had
it working (not sure what was different back then) and I was running
into
issues where the CXF client code was wrapping the JSON payload (I.e.
{"classname": {"id": 1, ...}}), which the RESTEasy services didn't
like. I
got around it by registering a custom ContextResolver for the RESTEasy
services that sets the WRAP_ROOT_VALUE feature on the Jackson object
mapper, and adding a @JsonRootName annotation to my container class, but
would prefer to solve the problem by telling the CXFRS client not to
wrap
the root value. From looking at
http://camel.apache.org/schema/blueprint/cxf/camel-cxf-2.9.0.xsd, I see
that both rsServer and rsClient have a "features" element that I think
might allow me to do this, .but I can't find any documentation or
examples
for using it.

I hope the above made sense, and thanks in advance for your help.

   The client-side wrapper is added by the active JSON provider which is


Jackson in this case.




I might be doing something wrong, but that doesn't seem to be the case. It
seems to be using Jackson for the service I'm exposing using cxf:rsServer.
However, the cxfrs client endpoint (I.e. http://etc.../>)
seems to still be using Jettison. I also tried configuring a cxf:rsClient
to access one of my external services, but the paths from my configured
cxf:rsServer bean keep getting appended to the end of my U

Queries on jetty server

2014-01-23 Thread bijoy
I'm currently using Tomcat server to deploy web applications and REST
webservices. The applications and services are deployed on tomcat on need
basis but putting the necessary war file into tomcat's webapp folder.

I want to realize the similar working model using camel's jetty component. I
would like to know, using jetty...

1) If we'll be losing any important features that tomcat provides.
2) Would I gain some features that is exclusively provided by jetty server.
3) How to proceed with dynamic deployment of REST web services in jetty
server using camel:jetty components. Also how to configure jetty's
configuration parameter if needed (e.g. managing thread pool size. Through
URI options we can control some server configurations but how to do that
dynamically at runtime. Using Spring DSL, if the config xml file is updated
then will the configurations be refreshed?

Thanks for your reply!

Regards,
Bijoy



--
View this message in context: 
http://camel.465427.n5.nabble.com/Queries-on-jetty-server-tp5746394.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: convert attachment to base64

2014-01-23 Thread Ronny Aerts
Hello,

I was able to solve my base64 problems as:
ContentType contentType = new ContentType (dh.getContentType());
if (contentType.match("image/*")) { // convert to base64 and add 
Content-Transfer-Encoding attribute
byte[] attachmentData = 
exchange.getContext().getTypeConverter().convertTo(byte[].class, 
dh.getInputStream());
theAttachmentInXml.appendChild(theParentNode.getOwnerDocument().createCDATASection(javax.xml.bind.DatatypeConverter.printBase64Binary(attachmentData)));
theAttachmentInXml.setAttribute("Content-Transfer-Encoding", "base64");
} else {
String attachmentData = 
exchange.getContext().getTypeConverter().convertTo(String.class, 
dh.getInputStream());
theAttachmentInXml.appendChild(theParentNode.getOwnerDocument().createCDATASection(attachmentData));
}

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

-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com]
Sent: woensdag 22 januari 2014 19:58
To: users@camel.apache.org
Subject: Re: convert attachment to base64

Hi

The data format works on the message body content only.

If you want to encode some attachments only. I suggest to write a piece of java 
code that does that.
You can use commons-codec for the base64. But I think in some of the newer JDKs 
its out of the box.

On Wed, Jan 22, 2014 at 5:34 PM, Ronny Aerts  wrote:
> Hello,
>
> I have a camel component written in java. At a certain point, I need to 
> convert the content of an attachment (or body) to a base64 encoding string. 
> Can this be done with the camel base64 dataformat? And if yes, how do I do 
> this in java?
>
> --
> Kind regards,
> Ronny Aerts - Intris nv -
> Wapenstilstandlaan 47, 2600 Berchem, Belgium R&D Integration Architect
> Prince II 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.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, 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.



--
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 Make your Camel 
applications look hawt, try: http://hawt.io
Intris nv
Wapenstilstandlaan 47
B-2600 Berchem
Tel.  +32 3 326 50 75
Fax  +32 3 326 42 23
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, 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: Questions about cxfrs

2014-01-23 Thread David
Thanks for the suggestion, I'll look into it as a temporary workaround.


On Thu, Jan 23, 2014 at 5:17 AM, Sergey Beryozkin wrote:

> Hi,
>
> I haven't had a chance to look into it yet, will do asap
> What about this alternative (assuming you'd like to do it the JAX-RS way):
> Create a CXF jaxrs:server entry endpoint with the address like
> "camel://myservice", and link to it from Camel Servlet. This endpoint
> service implementation will be a regular JAX-RS server (there will be no
> null returns, etc) which will do a couple of HTTP invocations using
> whatever Http API is preferred, example, you can try CXF WebClient or proxy
> support.
> Not sure if it will fir the purpose, suggesting it as a possible
> workaround.
>
> Sergey
>
>
> On 22/01/14 22:13, David wrote:
>
>> I tried using org.apache.cxf.jaxrs.provider.json.JSONProvider as the JSON
>> provider instead of JacksonJsonProvider, and that results in an exception
>> being thrown, telling me that no message body reader was found for my
>> class. I'm using the same test case that's attached to the JIRA, just with
>> a different JSON provider, and adding @XmlRootElement(name="container")
>> to
>> the domain class.
>>
>>
>>
>> On Wed, Jan 22, 2014 at 5:23 AM, Sergey Beryozkin > >wrote:
>>
>>  Hi, sure, I only referenced Jettison as a possible alternative.
>>> I think Jackson is picked up, Jettison only works, as you mentioned, with
>>> JAXB sending the write events to it, and as I understand you've no
>>> XMLRootElement/etc added to the data beans
>>>
>>> Sergey
>>>
>>> On 21/01/14 21:14, David wrote:
>>>
>>>  Comments in-line.


 On Tue, Jan 21, 2014 at 12:34 PM, Sergey Beryozkin <
 sberyoz...@gmail.com

> wrote:
>

   Hi

> Please see comments below,
>
> On 21/01/14 17:01, David wrote:
>
>   I think this is more of a Camel question than a CXF question, but
> let me
>
>> know if that's not the case (would it have been bad form to cross-post
>> this
>> to cxf-user?).
>>
>> I have questions regarding use of Jackson with CXF, as well as how to
>> get
>> CXFRS not to wrap the root value of a JSON payload.
>>
>> I am trying to use Camel and CXF as part of a service orchestration
>> using
>> JSON over REST. My biggest question is how to configure cxfrs to use
>> Jackson for all JSON marshal/unmarshal operations.
>>
>> So far, I've configured a cxf:rsServer and added a cxf:providers
>> element
>> with a reference to a org.codehaus.jackson.jaxrs.JacksonJsonProvider
>> bean.
>> I've also added the following to my route, although I haven't found
>> anywhere to reference it yet:
>>
>>
>>
>>
>>
>> I'm basically exposing the configured cxf:rsServer service as an
>> external
>> entry-point:
>>
>> http://localhost:8182";
>> serviceClass="org.my.Service"
>> loggingFeatureEnabled="true">
>> 
>> 
>> 
>> 
>> > class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
>>
>> I'm then using a couple cxfrs producer endpoints to invoke external
>> REST/JSON services implemented using RESTEasy:
>>
>>
>>POST
>>
>>
>>/service1/operation1
>>
>>
>>application/json
>>
>>http://localhost:8080?exchangePattern=InOut
>> "/>
>>
>>POST
>>
>>
>>/service2/operation2
>>
>>
>>application/json
>>
>>http://localhost:8080?exchangePattern=InOut
>> "/>
>>
>>
>> The idea is that each of those services will modify the payload, and
>> the
>> resulting object will be passed back to the caller.
>>
>> The services themselves are pretty standard. Class annotated with
>> @Path,
>> along with a single method annotated with @POST, @Consumes and
>> @Produces
>> (both types are set to MediaType.APPLICATION_JSON). The methods expect
>> and
>> return a single container class with id and a couple string values.
>>
>> When I call my service, however, an exception is thrown by the code
>> that's
>> attempting to call the cxfrs producer endpoint, saying there's no
>> message
>> body writer for my container class and applicaiton/json. At one point
>> I
>> had
>> it working (not sure what was different back then) and I was running
>> into
>> issues where the CXF client code was wrapping the JSON payload (I.e.
>> {"classname": {"id": 1, ...}}), which the RESTEasy services didn't
>> like. I
>> got around it by registering a custom ContextResolver for the RESTEasy
>> services that sets the WRAP_ROOT_VALUE feat

Mail attachment, zip files goes to message body

2014-01-23 Thread kalber
Hi,

i try to send a zip file as an attachment in a mail, but it finished in the
message body, see below.

In a bean i  attach the zip file to the message with this code :

exchange.getIn().addAttachment(filename,new DataHandler(new
FileDataSource(pathname)));

and then i try to set the content type for the mail endpoint with  a
ContentTypeResolve :

MailEndpoint sendMail = (MailEndpoint) exchange.getContext()
.getEndpoint(ReceiveRoute.sendMail);
sendMail.setContentTypeResolver(new AttachmentContentType(
"multipart/form-data"));


Nothing to do, the zip file is still in body message.

Some body has an idea what's wrong?

Thanks 
kh



--=_Part_0_1225759642.1390484383704
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Sasa, received file orarioSASA_20131215.zip
--=_Part_0_1225759642.1390484383704
Content-Type: text/plain; name=orarioSASA_20131215.zip
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=orarioSASA_20131215.zip

UEsDBBQIAER5hUOtuR1tW2QJAJkGLwAbb3JhcmlQYXNzYWdnaW9fMjAxMzEyMTUuY3N2
dJ1JkiO6rmTnZfb3wr55d//7qowQ4SAOFZMc0FMKORsQRJv/myn913Pu/+X/8vpfn/9L6f/+X7bh
8V/5HV5xeP5Xvw2v/9rv8I7D+79/3/4zFobT/m/8Dud7OJX63/wdLvdw7fm/9Ttc4/8e/+1vw//+
b/odb/Fv/vt9+Xe8x/F/LMvv+Ijj//5z/R0P85L2vz/afsdXHP/30/u38X+DH7I7jv/78l+2OcXx
fz/+l27+TE4Jy9T+V2cc/l2mf8MrDv8u0zv8u0z/hncc/l2m9r+WwvBnmf4Nh19ylunfcLmHzzL9
G67xf/8u0zv8WaZ/4y3+zc8y/RvvcfyzTP/GRxz/LNO/8TAvtkz/xlcc/yzTO/5Zpn/jO45/lqn9
r6c4/lmmf+Ofyan/DY3/Y2b/XcP5Z5ne4fKzTOn5kvazTO/w+Fmmf8MlDq+fZfo3XO/h/O+f+Tvc



-
kh
--
View this message in context: 
http://camel.465427.n5.nabble.com/Mail-attachment-zip-files-goes-to-message-body-tp5746400.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dead letter queue and onException

2014-01-23 Thread bocamel
Hi Charles,  thank you very much for the response.  I assume what you meant
was to reference the DLC in  because the Spring DSL does not allow
 definition within .  I tried to move the
errorHandlerRef in the .  It did not help.  The failed message was
only written to the dead queue if the error was not caught by the
onException.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Dead-letter-queue-and-onException-tp5746362p5746401.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dead letter queue and onException

2014-01-23 Thread bocamel
Hi Claus,  Thank you for your response.  The version being tested is 2.12.2.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dead-letter-queue-and-onException-tp5746362p5746402.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Split and Aggregate - Old Exchange is null everytime in AggregationStrategy

2014-01-23 Thread dinesh19aug
Claus,
  I tested the Xpath expression using a Xpath Evaluator tool and also
printed out the coorelation expression results and all my messages are same.
Ex-
Group 1:
 
 1 
 

Group 2:
 
 2 
 

I am trying to keep things clean and hence thought that Aggregator2 would be
a good way to keep the code in small chunks.
Step 1 Split
Step 2 Aggregate


I will try it using splitter only example but is there a way I can create a
oldExchnage (when it is null) in my Aggregation strategy, is that a good
idea?




--
View this message in context: 
http://camel.465427.n5.nabble.com/Split-and-Aggregate-Old-Exchange-is-null-everytime-in-AggregationStrategy-tp5746365p5746403.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Split and Aggregate - Old Exchange is null everytime in AggregationStrategy

2014-01-23 Thread dinesh19aug
Claus,
I tried to add the Aggregation strategy in the Splitter itself and that
works and I get aggregated xmls messages. However I am still looking for a
way to use Aggregator2. Is there no way I can implement it using Aggregator
component?

BTW .. if anyone is following this post here's how I did it using Splitter.
All othere code remains the same.




 
//te:Orders/*

  <

 




 






--
View this message in context: 
http://camel.465427.n5.nabble.com/Split-and-Aggregate-Old-Exchange-is-null-everytime-in-AggregationStrategy-tp5746365p5746404.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Split and Aggregate - Old Exchange is null everytime in AggregationStrategy

2014-01-23 Thread dinesh19aug
Claus,
   I think I figured it out how to aggregate the messages using Aggregator.
I added a headerName called id and use it as my correlation id.

 



//te:Orders/*

  

 





order

 


  



header.id




  


This aggregates my messages. However I am still not sure that despite using
correct XPATH why does Camel thinks that it is different type of message?




--
View this message in context: 
http://camel.465427.n5.nabble.com/Split-and-Aggregate-Old-Exchange-is-null-everytime-in-AggregationStrategy-tp5746365p5746405.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel JCR examples?

2014-01-23 Thread hardikdesai81
Hi All,

I have a need to use Camel JCR to communicate with a Jackrabbit repository
for 3 operations: fetch a particular file, update a particular file, get a
list of files in a particular node.

Can someone please provide me some examples that can help in achieving this?

Camel website does not contain sufficient examples.

Thanks & Regards,
Hardik



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JCR-examples-tp5746406.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Logback used with Apache Camel throws so many irrelevant Exceptions

2014-01-23 Thread amrut
Why is it asking for so many dependencies - though I am not using any of the
feature in my program.

below is the logback configuration: 


public static void programmaticConfiguration() {
ResourceBundle rb = 
ResourceBundle.getBundle("com.logProperties");
Enumeration keys = rb.getKeys();
String dir = keys.nextElement();
String date = new SimpleDateFormat("/MM/dd").format(new 
Date());
Logger camel = getLogger("MyRoute", dir + date + "/camel.log");
dir = null;
dir = keys.nextElement();
final Logger services = getLogger("webservices", dir + date
+ "/Service.log");
}

private static Logger getLogger(String string, String file) {

LoggerContext lc = (LoggerContext) 
LoggerFactory.getILoggerFactory();
PatternLayoutEncoder ple = new PatternLayoutEncoder();

ple.setPattern("%date %level [%thread] %logger{10} 
[%file:%line] %msg%n");
ple.setContext(lc);
ple.start();
FileAppender fileAppender = new
FileAppender();
fileAppender.setFile(file);
fileAppender.setEncoder(ple);
fileAppender.setContext(lc);
fileAppender.start();

Logger logger = (Logger) LoggerFactory.getLogger(string);
logger.addAppender(fileAppender);
logger.setLevel(Level.INFO);
logger.setAdditive(false); /* set to true if root should log 
too */

return logger;

}
}



-
Thanks
Amrut Malaji
malaji.am...@gmail.com
--
View this message in context: 
http://camel.465427.n5.nabble.com/Logback-used-with-Apache-Camel-tp5746335p5746407.html
Sent from the Camel - Users mailing list archive at Nabble.com.


documentation fix - cannot update wiki page

2014-01-23 Thread MichaelAtSAG
All,

I believe this documentation wiki page is incorrect. The example shows
"features", but this word is not recognized by Karaf.

http://camel.apache.org/twitter-websocket-blueprint-example.html

"features:chooseurl camel 2.12.0"

I believe the commands should be "feature".

"feature:chooseurl camel 2.12.0"

I tried to update the page or add a comment, but it states I do not have
permission.

1. Is this command fix correct?
2. How do I gain access to modify directly?

Cheers,
Michael



--
View this message in context: 
http://camel.465427.n5.nabble.com/documentation-fix-cannot-update-wiki-page-tp5746411.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: documentation fix - cannot update wiki page

2014-01-23 Thread MichaelAtSAG
This command from the example is also unknown:

osgi:install -s
mvn:org.apache.camel/camel-example-twitter-websocket-blueprint/2.12.0

Do I need to use a specific version of Karaf to follow this example? Will
this work with camel 2.12.2?



--
View this message in context: 
http://camel.465427.n5.nabble.com/documentation-fix-cannot-update-wiki-page-tp5746411p5746413.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel JCR examples?

2014-01-23 Thread Bilgin Ibryam
I have a blog post and github example here
http://www.ofbizian.com/search/label/JCR

Also you might consider using CMIS component that can talk also to
Jackrabbit. Here is another example using cmis
http://www.ofbizian.com/2012/07/content-migration-with-camel-cmis.html

Cheers,



On 23 January 2014 15:47, hardikdesai81  wrote:

> Hi All,
>
> I have a need to use Camel JCR to communicate with a Jackrabbit repository
> for 3 operations: fetch a particular file, update a particular file, get a
> list of files in a particular node.
>
> Can someone please provide me some examples that can help in achieving
> this?
>
> Camel website does not contain sufficient examples.
>
> Thanks & Regards,
> Hardik
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-JCR-examples-tp5746406.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Bilgin Ibryam

Apache Camel & Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam 

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475


Simple bean invocation with '.' throwing NoSuchBeanException

2014-01-23 Thread bhcohen
I'm using Camel 2.11.0 with Spring XML and am getting a NoSuchBeanException
when I invoke a bean through Simple with a String argument that contains a
period '.'

I have a Map defined as follows:



I then have a setHeader element that looks like:



When setHeader is called I get:



If I change the call to get() to use a string that doesn't contain a dot
everything works fine


What am I missing here?  Any suggested workaround?

Thanks in advance,
   Bruce




--
View this message in context: 
http://camel.465427.n5.nabble.com/Simple-bean-invocation-with-throwing-NoSuchBeanException-tp5746417.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel 2.5.0 for Cygwin/UNIX

2014-01-23 Thread rjarchuleta
I am on a Windows laptop with no admin rights, but use Cygwin to have a
UNIX-like environment.  I downloaded the tar file many times.

- Rich -


On Thu, Jan 23, 2014 at 12:45 AM, Claus Ibsen-2 [via Camel] <
ml-node+s465427n574638...@n5.nabble.com> wrote:

> On Wed, Jan 22, 2014 at 8:13 PM, rjarchuleta <[hidden 
> email]>
> wrote:
> > Thank you very much for your response, Klaus.  I did just that and have
> the
> > exact same problem.
> >
>
> If you are on windows then download the .zip file.
>
> If you are on unix or mac then you should download the .tar instead.
>
> Are you sure you download the right file?
>
> > Suggestions?
> >
> > - Rich -
> >
> >
> > On Wed, Jan 22, 2014 at 11:52 AM, Claus Ibsen-2 [via Camel] <
> > [hidden email] >
> wrote:
> >
> >> Hi
> >>
> >> Camel 2.5.0 was the latest Camel release when the book was published.
> >> We have since keep the source code for the book up to date with all
> >> the Camel releases.
> >>
> >> So I suggest to download the latest 2.12.2 and the book source code
> >> for that version
> >> https://code.google.com/p/camelinaction/
> >> http://camel.apache.org/download
> >>
> >>
> >>
> >> On Wed, Jan 22, 2014 at 7:41 PM, rjarchuleta <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5746357&i=0>>
> >> wrote:
> >>
> >> > Hello.
> >> >
> >> > I am wanting to learn how to use Camel.  I got a copy of "Camel in
> >> Action",
> >> > which directed me to download Camel 2.5.0 for Cygwin/UNIX.
> >> >
> >> > I downloaded the compressed file (apache*.tar.gz) and decompressed
> the
> >> file
> >> > using 7Zip and then gzip (upon trying, again).  Using "tar -xvf"
> after
> >> that
> >> > results in an error message saying that the file does not appear to
> be a
> >> tar
> >> > file.  Using "file apache*.tar" gets "HTML document, ASCII text, with
> >> very
> >> > long lines".
> >> >
> >> > Will someone pleas help me extract the files?
> >> >
> >> > Regards,
> >> >
> >> > - rjarchuleta -
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Camel-2-5-0-for-Cygwin-UNIX-tp5746356.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=node&node=5746357&i=1>
> >> Twitter: davsclaus
> >> Blog: http://davsclaus.com
> >> Author of Camel in Action: http://www.manning.com/ibsen
> >> Make your Camel applications look hawt, try: http://hawt.io
> >>
> >>
> >> --
> >>  If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://camel.465427.n5.nabble.com/Camel-2-5-0-for-Cygwin-UNIX-tp5746356p5746357.html
> >>  To unsubscribe from Camel 2.5.0 for Cygwin/UNIX, click here<
>
> >> .
> >> NAML<
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Camel-2-5-0-for-Cygwin-UNIX-tp5746356p5746361.html
>
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: [hidden email]
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> Make your Camel applications look hawt, try: http://hawt.io
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Camel-2-5-0-for-Cygwin-UNIX-tp5746356p5746380.html
>  To unsubscribe from Camel 2.5.0 for Cygwin/UNIX, click 
> here
> .
> NAML
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-5-0-for-Cygwin-UNIX-tp5746356p5746416.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Http4 Set Header Content-Type not passing through to the HTTP Request

2014-01-23 Thread E. A. English
Hi,

setting the Content-type header for Http4 Camel Route - Message headers from
the IN message are not being copied to the OUT message 

Using Camel Version 2.12.2

example  http4 route code:

from("timer://foo?fixedRate=true&delay=0&period=1")
.setHeader(Exchange.CONTENT_TYPE, constant("application/json"))
.setHeader(Exchange.HTTP_CHARACTER_ENCODING, constant("UTF-8"))
   
.to("log:httpbefore.SYSTEM.COM?level=DEBUG&ShowHeaders=true&ShowBody=true")
.to("http4://SERVER-remote.com/services/status/54024")
   
.to("log:httpafter.SYSTEM.COM?level=DEBUG&ShowHeaders=true&ShowBody=true");
 
The Content Type and Character Encoding message headers are apparently being
filtered out.

Excerpt from Log with JSON Content Type IN message:

[  main] RouteService   DEBUG
Starting child service on route: route1 ->

Pipeline[[Channel[setHeader(Content-Type, application/json)], 
 
Channel[setHeader(CamelHttpCharacterEncoding, UTF-8)], 
 
Channel[sendTo(Endpoint[log://httpbefore.SYSTEM.COM?ShowBody=true&ShowHeaders=true&level=DEBUG])],
 
 
Channel[sendTo(Endpoint[http4://server.remote.com/services/status/54024])], 
 
Channel[sendTo(Endpoint[log://httpafter.SYSTEM.COM?ShowBody=true&ShowHeaders=true&level=DEBUG])]]]


if you look at the outgoing >>  wire and headers lines you could see the
Content-Type is missing:

[mel-1) thread #0 - timer://foo] DefaultClientConnectionDEBUG
Sending request: GET /services/status/54024 HTTP/1.1
[mel-1) thread #0 - timer://foo] wire   DEBUG >>
"GET /services/status/54024 HTTP/1.1[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG >>
"firedTime: Thu Jan 23 14:05:49 EST 2014[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG >>
"breadcrumbId: ID-com-43559- 1390503945739-0-1[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG >>
"Host: SERVER-remote.com:443[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG >>
"Connection: Keep-Alive[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG >>
"[\r][\n]"
[mel-1) thread #0 - timer://foo] headersDEBUG >> GET
/services/status/54024 HTTP/1.1
[mel-1) thread #0 - timer://foo] headersDEBUG >>
firedTime: Thu Jan 23 14:05:49 EST 2014
[mel-1) thread #0 - timer://foo] headersDEBUG >>
breadcrumbId: ID-com-43559-  1390503945739-0-1
[mel-1) thread #0 - timer://foo] headersDEBUG >>
Host: SERVER-remote.com:443
[mel-1) thread #0 - timer://foo] headersDEBUG >>
Connection: Keep-Alive
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"HTTP/1.1 200 OK[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"Cache-Control: private[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"Content-Type: text/html[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"Server: Microsoft-IIS/8.0[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"X-Powered-By: ServiceStack/3.962 Win32NT/. NET[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"Access-Control-Allow-Origin: *[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"Access-Control-Allow-Methods: GET, POST, PUT,  DELETE, OPTIONS[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"X-AspNet-Version: 4.0.30319[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"X-Powered-By: ASP.NET[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"Access-Control-Allow-Origin: *[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"Access-Control-Allow-Headers: Content- Type[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"Access-Control-Allow-Methods: GET, POST, PUT,  DELETE, OPTIONS[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"Date: Thu, 23 Jan 2014 19:05:51 GMT[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"Content-Length: 9750[\r][\n]"
[mel-1) thread #0 - timer://foo] wire   DEBUG <<
"[\r][\n]"
[mel-1) thread #0 - timer://foo] DefaultClientConnectionDEBUG
Receiving response: HTTP/1.1 200 OK
[mel-1) thread #0 - timer://foo] headers  

any suggestion for completionTimeout value ?

2014-01-23 Thread nono

Any suggestion for completionTimeout value? should I use it in my case? if
yes. what should be the proper value? 

My scenario 
 JdbcAggregationRepository

 aggregated message size will not bigger than 30KB

 shutdownRoute="Defer" with timeout=5000 , should be long enough for
completing aggregating message  before gracefully shutdown route






  





${header.myeventId}.${header.mysystem}







--
View this message in context: 
http://camel.465427.n5.nabble.com/any-suggestion-for-completionTimeout-value-tp5746408.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel v2.12 | CXF Component | Basic Authentication | Web Service

2014-01-23 Thread manchandap
Looking at the   CXF Component Documentation
  , I notice that two new options
(username and password) for Basic Authentication have been added in 2.12.3. 

 

However, from the download, I am not able to find any link or info to
download 2.12.3. Also, the download links for 2.13 are broken.

So, my queries:

# From where i can download 2.12.3 and/or 2.13
# if these versions are still WIP, then how similar effect can be achieved
in version 2.12.0

Thanks and Regards
P Manchanda 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-v2-12-CXF-Component-Basic-Authentication-Web-Service-tp5746233p5746426.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: zip file best practices

2014-01-23 Thread alexey-s
ZipSplitter uses the input stream from the archive file (message body). Sends
output stream for each attached file. 
One should not expect from him GenericFile
Nothing complicated.



--
View this message in context: 
http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5746434.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel v2.12 | CXF Component | Basic Authentication | Web Service

2014-01-23 Thread manchandap
Was able to get this working by adding the following code to the Route
Builder. I am using Java DSL:

Map properties = new HashMap(); 

AuthorizationPolicy authPolicy = new AuthorizationPolicy(); 

authPolicy.setAuthorizationType(HttpAuthHeader.AUTH_TYPE_BASIC); 
authPolicy.setUserName(USERNAME); 
authPolicy.setPassword(PWD); 
authPolicy.setAuthorization("true");

//properties.put(AuthorizationPolicy.class.getName(), 
authPolicy);

properties.put("org.apache.cxf.configuration.security.AuthorizationPolicy",
authPolicy);

CxfEndpoint myCxfEp = 
(CxfEndpoint)getContext().getEndpoint("cxf://");
myCxfEp.setProperties(properties);

Thanks and Regards
P Manchanda




--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-v2-12-CXF-Component-Basic-Authentication-Web-Service-tp5746233p5746435.html
Sent from the Camel - Users mailing list archive at Nabble.com.