Re: camel 2.5 recipientList aggregationStrategy timeout

2010-08-09 Thread Marco Crivellaro

I am still receiving the FTP connection timeout error after a while the
aggregation is runned in timeout.
I still don't understand why it runs in connection timeout after the
specified timeout though (I've already opened a discussion for this).

2010-08-09 09:02:36,221 [pool-1-thread-2] DEBUG
org.apache.camel.component.file.remote.RemoteFileProducer  - Could not
connect to:
Endpoint[ftp://usern...@192.168.1.1/FOLDER?eagerDeleteTargetFile=falsefileName=test.txtftpClient.connectTimeout=12ftpClient.dataTimeout=15000ftpClient.defaultTimeout=15000password=OPT2%24%24d2t2%23888soTimeout=6tempFileName=%24%7Bfile%3Aname.noext%7D.tmp].
Will try to recover.
org.apache.camel.component.file.GenericFileOperationFailedException: File
operation failed: null Connection timed out: connect. Code: 0
at
org.apache.camel.component.file.remote.FtpOperations.connect(FtpOperations.java:107)

-- 
View this message in context: 
http://camel.465427.n5.nabble.com/camel-2-5-recipientList-aggregationStrategy-timeout-tp2265144p2268527.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SAXParseException while doing CBR

2010-08-09 Thread Claus Ibsen
Hi

Check the actual message you send to the XPath. For example debug or
log it out etc.
Maybe the data you send over MINA turns out to invalid somehow.

You can try adding a .convertBodyTo(String.class, utf-8)  to ensure
the message payload is String and in utf-8 format as denoted in your
XML.


On Sun, Aug 8, 2010 at 8:28 PM, M.Ismail mohammed.h...@gmail.com wrote:


 I'm using Camel 2.4 and I receive Caused by: org.xml.sax.SAXParseException:
 Premature end of file when I try to publish a mina TCP endpoint and route
 the requests to a file. Although this exception is raised, the message is
 routed correctly to the destination. It's only the exception that doesn't
 make sense.

 I public void configure() {


 from(mina:tcp://0.0.0.0:9004?sync=truelazySessionCreation=trueminaLogger=truetextline=trueencoderMaxLineLength=2decoderMaxLineLength=2textlineDelimiter=AUTO)
        //from(file:src/data?noop=true).
        .choice()

 .when(xpath(/itsns:a...@dtc=\NSNEMERALD\]).namespace(itsns,
 http://www.its.ws;))
            .to(file:target/messages/emerald).
                otherwise().to(file:target/messages/others);

    }

 Also, if I comment the from(mina  ) endpoint and use
 from(file:src/data?noop=true) the message will be routed successfully but
 this time without that exception.

 and here is the log plus the exception stack trace:
 [WARNING] Invalid POM for
 org.codehaus.plexus:plexus-classworlds:jar:1.2-alpha-13, transitive
 dependencies (if any) will not be available, enable debug logging for more
 details
 [WARNING] Invalid POM for org.apache.xbean:xbean-reflect:jar:3.4, transitive
 dependencies (if any) will not be available, enable debug logging for more
 details
 [INFO] Classpath = [file:/C:/Documents and
 Settings/moismailgalileo/workspace/testXPath/target/classes/,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/apache/camel/camel-core/2.4.0/camel-core-2.4.0.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/fusesource/commonman/commons-management/1.0/commons-management-1.0.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.12/jaxb-impl-2.1.12.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/apache/camel/camel-spring/2.4.0/camel-spring-2.4.0.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/springframework/spring-context/3.0.3.RELEASE/spring-context-3.0.3.RELEASE.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/springframework/spring-aop/3.0.3.RELEASE/spring-aop-3.0.3.RELEASE.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/springframework/spring-asm/3.0.3.RELEASE/spring-asm-3.0.3.RELEASE.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/springframework/spring-beans/3.0.3.RELEASE/spring-beans-3.0.3.RELEASE.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/springframework/spring-core/3.0.3.RELEASE/spring-core-3.0.3.RELEASE.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/springframework/spring-expression/3.0.3.RELEASE/spring-expression-3.0.3.RELEASE.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/springframework/spring-tx/3.0.3.RELEASE/spring-tx-3.0.3.RELEASE.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/apache/camel/camel-mina/2.4.0/camel-mina-2.4.0.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/apache/mina/mina-core/1.1.7/mina-core-1.1.7.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/slf4j/slf4j-api/1.6.0/slf4j-api-1.6.0.jar,
 file:/C:/Documents and
 Settings/moismail/.m2/repository/org/slf4j/slf4j-log4j12/1.6.0/slf4j-log4j12-1.6.0.jar]
 [pache.camel.spring.Main.main()] MainSupport                    INFO  Apache
 Camel 2.4.0 starting
 [pache.camel.spring.Main.main()] CamelNamespaceHandler          INFO
 camel-osgi.jar/camel-spring-osgi.jar not detected in classpath
 [pache.camel.spring.Main.main()] DefaultCamelContext            DEBUG Adding
 routes from builder: Routes: []
 [pache.camel.spring.Main.main()] DefaultCamelContext            INFO  Apache
 Camel 2.4.0 (CamelContext: camelContext) is starting
 [pache.camel.spring.Main.main()] 

Re: Camel 2.4.0 NoClassDefFoundError org/springframework/context/SmartLifecycle / appears in camel in action too.

2010-08-09 Thread Willem Jiang
In Camel 2.4.0 we switch to Spring 3.0.0RELEASE, and ActiveMQ-core is 
using spring context 2.5.6.
So you need to add dependency of spring-context 3.0.3 into to pom, not 
the camel-maven-plugin to override it.


Willem
--
Apache Camel, Apache CXF committer
Open Source Integration http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang

Mark wrote:

To reproduce:

mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes \
-DarchetypeArtifactId=camel-archetype-activemq -DarchetypeVersion=2.4.0 \
-DgroupId=myGroupId -DartifactId=myArtifactId

mvn clean camel:run
...
Failed properties: Property 'brokerURL' threw exception; nested
exception is java.lang.NoClassDefFoundError:
org/springframework/context/SmartLifecycle
...

If you change the camel version property to 2.3.0 in pom then run:

mvn clean camel:run

It works.

What;s strange is that org/springframework/context/SmartLifecycle is
on the classpath, as it's provided by

I tried to explicitly provide the class:

plugin
groupIdorg.apache.camel/groupId
artifactIdcamel-maven-plugin/artifactId
version${camel-version}/version
dependencies
dependency

groupIdorg.springframework/groupId

artifactIdspring-context/artifactId
version3.0.3.RELEASE/version
/dependency
/dependencies
/plugin


Still no joy;

I have also seen this issues with the examples for camel in action.

Any ideas / can someone else confirm?

Kind Regards

Mark





Re: Camel 2.4.0 NoClassDefFoundError org/springframework/context/SmartLifecycle / appears in camel in action too.

2010-08-09 Thread Mark
That fixed it:

I didn't think of that since
org.springframework:spring-context:jar:3.0.3.RELEASE

Maybe the archetype needs fixing :(

-DarchetypeArtifactId=camel-archetype-activemq -DarchetypeVersion=2.4.0

I was trying to work arround this problem this moring, by running the
main class:

org.apache.camel.spring.Main

However this ended up giving me:

Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory

Again strange since the JAXB Api and Impl are both on the classpath

Any ideas on this one?

Bellow is the dependecy tree(s) for both the before and after fix:

[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] 
[INFO] Building Unnamed - com.js.ex:camel-spring-ex05:jar:0.0.1-SNAPSHOT
[INFO]task-segment: [dependency:tree]
[INFO] 
[INFO] [dependency:tree {execution: default-cli}]
[INFO] com.js.ex:camel-spring-ex05:jar:0.0.1-SNAPSHOT
[INFO] +- org.apache.activemq:activemq-core:jar:5.3.2:compile
[INFO] |  +- commons-logging:commons-logging-api:jar:1.1:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
[INFO] |  +- org.apache.activemq:activeio-core:jar:3.1.2:compile
[INFO] |  |  \-
org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1:compile
[INFO] |  +- org.apache.activemq:kahadb:jar:5.3.2:compile
[INFO] |  +- org.apache.activemq.protobuf:activemq-protobuf:jar:1.0:compile
[INFO] |  +- org.osgi:org.osgi.core:jar:4.1.0:compile
[INFO] |  +- org.springframework.osgi:spring-osgi-core:jar:1.2.1:compile
[INFO] |  |  \- org.springframework.osgi:spring-osgi-io:jar:1.2.1:compile
[INFO] |  +- 
org.apache.geronimo.specs:geronimo-j2ee-management_1.0_spec:jar:1.0:compile
[INFO] |  +- org.springframework:spring-context:jar:2.5.6:compile
[INFO] |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  \- commons-net:commons-net:jar:2.0:compile
[INFO] +- org.apache.activemq:activemq-camel:jar:5.3.2:compile
[INFO] |  \- org.apache.activemq:activemq-pool:jar:5.3.2:compile
[INFO] | +-
org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0.1:compile
[INFO] | \- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] +- org.apache.camel:camel-core:jar:2.4.0:compile
[INFO] |  +- org.fusesource.commonman:commons-management:jar:1.0:compile
[INFO] |  \- com.sun:tools:jar:1.5.0:system
[INFO] +- org.apache.camel:camel-jms:jar:2.4.0:compile
[INFO] |  +- org.springframework:spring-jms:jar:3.0.3.RELEASE:compile
[INFO] |  +- org.springframework:spring-core:jar:3.0.3.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-asm:jar:3.0.3.RELEASE:compile
[INFO] |  +- org.springframework:spring-tx:jar:3.0.3.RELEASE:compile
[INFO] |  \- org.springframework:spring-beans:jar:3.0.3.RELEASE:compile
[INFO] +- org.apache.camel:camel-spring:jar:2.4.0:compile
[INFO] |  \- org.springframework:spring-aop:jar:3.0.3.RELEASE:compile
[INFO] +- org.apache.xbean:xbean-spring:jar:3.5:compile
[INFO] |  \- commons-logging:commons-logging:jar:1.0.3:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.1:compile
[INFO] |  +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |  \- javax.activation:activation:jar:1.1:compile
[INFO] +- com.sun.xml.bind:jaxb-impl:jar:2.1.2:compile
[INFO] \- junit:junit:jar:4.7:test
[INFO] 
[INFO] BUILD SUCCESSFUL
[INFO] 
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Aug 09 09:47:25 BST 2010
[INFO] Final Memory: 19M/762M
[INFO] 

After:

[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] 
[INFO] Building Unnamed - com.js.ex:camel-spring-ex05:jar:0.0.1-SNAPSHOT
[INFO]task-segment: [dependency:tree]
[INFO] 
[INFO] [dependency:tree {execution: default-cli}]
[INFO] com.js.ex:camel-spring-ex05:jar:0.0.1-SNAPSHOT
[INFO] +- org.apache.activemq:activemq-core:jar:5.3.2:compile
[INFO] |  +- commons-logging:commons-logging-api:jar:1.1:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
[INFO] |  +- org.apache.activemq:activeio-core:jar:3.1.2:compile
[INFO] |  |  \-
org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1:compile
[INFO] |  +- org.apache.activemq:kahadb:jar:5.3.2:compile
[INFO] |  +- org.apache.activemq.protobuf:activemq-protobuf:jar:1.0:compile
[INFO] |  +- org.osgi:org.osgi.core:jar:4.1.0:compile
[INFO] |  +- org.springframework.osgi:spring-osgi-core:jar:1.2.1:compile
[INFO] |  |  \- org.springframework.osgi:spring-osgi-io:jar:1.2.1:compile
[INFO] |  +- 

Solved java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory Camel 2.4 / Spring 3.0.3 and Java 15 / 1.6

2010-08-09 Thread Mark
If you are getting the java.lang.ClassNotFoundException:
com.sun.xml.bind.v2.ContextFactory

Then this might help:

When trying to load a camel context file using the following main method:

mvn compile exec:java -Dexec.mainClass=org.apache.camel.spring.Main

First off I created an example project using the following archetype:

mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes
-DarchetypeArtifactId=camel-archetype-activemq
-DarchetypeVersion=2.4.0 -DgroupId=myGroupId -DartifactId=myArtifactId

I then amended the pom as follows:

dependency
groupIdorg.springframework/groupId
artifactIdspring-context/artifactId
version3.0.3.RELEASE/version
/dependency

dependency
groupIdcom.sun.xml.bind/groupId
artifactIdjaxb-impl/artifactId
version2.1.2/version
/dependency

dependency
groupIdjavax.xml.bind/groupId
artifactIdjaxb-api/artifactId
version2.1/version
/dependency

!-- needed to add this for my 1.5 hack not sure why ? --
dependency
groupIdcommons-pool/groupId
artifactIdcommons-pool/artifactId
version1.5/version
/dependency


Running the following for 1.6 JSDK/JRE works fine:
mvn compile exec:java -Dexec.mainClass=org.apache.camel.spring.Main

Running the following for 1.5 JSDK/JRE blows up with
java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
mvn compile exec:java -Dexec.mainClass=org.apache.camel.spring.Main

Apparently this is because under a 1.5 JSDK/JRE the JAXB 2 libraries
on the classpath are ignored?

This is what I observed since I had both a JAXB v2 API and Impl on the
classpath.

Work-Around 1 (hacky):

As a hack in Eclipse I created a wrapper class:

public static void main(String[] args) {
try {
Class.forName(com.sun.xml.bind.v2.ContextFactory);
Main.main(args);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

Make sure that the META-INF folder with the camel context files are on
the classpath. This works fine running under 1.5.

Work-Around 2:

Place the following jars (or their equivalent) under the 1.5 JSDK/JRE
lib/ext folder

jaxb-impl-2.1.5.jar
stax-api-1.0-2.jar
activation-1.1.jar
jaxb-api-2.1.jar

mvn compile exec:java -Dexec.mainClass=org.apache.camel.spring.Main

Everything should work fine.

I hope this helps anyone who encounters a similar issue.

Regards

Mark


Re: Solved java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory Camel 2.4 / Spring 3.0.3 and Java 15 / 1.6

2010-08-09 Thread Willem Jiang

Hi Mark,

I think we need to update the camel-archetype-* to add a profile of JDK 
1.5 to let it load the JAXB related jars for you.


Just created JIRA[1] for it.

[1] https://issues.apache.org/activemq/browse/CAMEL-3037

Willem
--
Apache Camel, Apache CXF committer
Open Source Integration http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang

Mark wrote:

If you are getting the java.lang.ClassNotFoundException:
com.sun.xml.bind.v2.ContextFactory

Then this might help:

When trying to load a camel context file using the following main method:

mvn compile exec:java -Dexec.mainClass=org.apache.camel.spring.Main

First off I created an example project using the following archetype:

mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes
-DarchetypeArtifactId=camel-archetype-activemq
-DarchetypeVersion=2.4.0 -DgroupId=myGroupId -DartifactId=myArtifactId

I then amended the pom as follows:

dependency
groupIdorg.springframework/groupId
artifactIdspring-context/artifactId
version3.0.3.RELEASE/version
/dependency

dependency
groupIdcom.sun.xml.bind/groupId
artifactIdjaxb-impl/artifactId
version2.1.2/version
/dependency

dependency
groupIdjavax.xml.bind/groupId
artifactIdjaxb-api/artifactId
version2.1/version
/dependency

!-- needed to add this for my 1.5 hack not sure why ? --
dependency
groupIdcommons-pool/groupId
artifactIdcommons-pool/artifactId
version1.5/version
/dependency


Running the following for 1.6 JSDK/JRE works fine:
mvn compile exec:java -Dexec.mainClass=org.apache.camel.spring.Main

Running the following for 1.5 JSDK/JRE blows up with
java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
mvn compile exec:java -Dexec.mainClass=org.apache.camel.spring.Main

Apparently this is because under a 1.5 JSDK/JRE the JAXB 2 libraries
on the classpath are ignored?

This is what I observed since I had both a JAXB v2 API and Impl on the
classpath.

Work-Around 1 (hacky):

As a hack in Eclipse I created a wrapper class:

public static void main(String[] args) {
try {
Class.forName(com.sun.xml.bind.v2.ContextFactory);
Main.main(args);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

Make sure that the META-INF folder with the camel context files are on
the classpath. This works fine running under 1.5.

Work-Around 2:

Place the following jars (or their equivalent) under the 1.5 JSDK/JRE
lib/ext folder

jaxb-impl-2.1.5.jar
stax-api-1.0-2.jar
activation-1.1.jar
jaxb-api-2.1.jar

mvn compile exec:java -Dexec.mainClass=org.apache.camel.spring.Main

Everything should work fine.

I hope this helps anyone who encounters a similar issue.

Regards

Mark





Re: camel 2.5 recipientList aggregationStrategy timeout

2010-08-09 Thread Claus Ibsen
You need to update camel-ftp as well, to use 2.5-SNAPSHOT.


On Mon, Aug 9, 2010 at 10:05 AM, Marco Crivellaro
mcr...@optasportsdata.com wrote:

 I am still receiving the FTP connection timeout error after a while the
 aggregation is runned in timeout.
 I still don't understand why it runs in connection timeout after the
 specified timeout though (I've already opened a discussion for this).

 2010-08-09 09:02:36,221 [pool-1-thread-2] DEBUG
 org.apache.camel.component.file.remote.RemoteFileProducer  - Could not
 connect to:
 Endpoint[ftp://usern...@192.168.1.1/FOLDER?eagerDeleteTargetFile=falsefileName=test.txtftpClient.connectTimeout=12ftpClient.dataTimeout=15000ftpClient.defaultTimeout=15000password=OPT2%24%24d2t2%23888soTimeout=6tempFileName=%24%7Bfile%3Aname.noext%7D.tmp].
 Will try to recover.
 org.apache.camel.component.file.GenericFileOperationFailedException: File
 operation failed: null Connection timed out: connect. Code: 0
        at
 org.apache.camel.component.file.remote.FtpOperations.connect(FtpOperations.java:107)

 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/camel-2-5-recipientList-aggregationStrategy-timeout-tp2265144p2268527.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


listener on intermediate queue

2010-08-09 Thread Mark Webb
I am curious as to how Camel routes messages when there is an
intermediate queue involved.

What I am trying to set up is similar to the Loan Broker example at
http://camel.apache.org/loan-broker-example.html.  What is to stop an
external client from listening on queue
jms:queue:creditResponseQueue and seeing what is going on so that
other destinations in the system do not get all of the information and
screw up the system?

Mark


Dynamic options on Direct component, possible?

2010-08-09 Thread Yiannis Mavroukakis
Hi lovely people :)

I was wondering, within the context of the Spring DSL, is it possible
given a bean with @RecipientList to be used in
a recipientList element ?

TIA

Yiannis


Re: Dynamic options on Direct component, possible?

2010-08-09 Thread Claus Ibsen
On Mon, Aug 9, 2010 at 5:48 PM, Yiannis Mavroukakis
imavrouka...@gameaccount.com wrote:
 Hi lovely people :)

 I was wondering, within the context of the Spring DSL, is it possible
 given a bean with @RecipientList to be used in
 a recipientList element ?


No the idea is you use a bean element, even if the bean has been
annotated with @RecipientList


 TIA

 Yiannis




-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Camel, OSGI and container wide Camel route lookups

2010-08-09 Thread Adrian Trenaman
Hi Christian,

As far as I know, camel contexts are intended to be isolated, so detecting 
routes in other contexts will not work. 

I recently did some work on a similar use-case by wiring in dynamic 'extension' 
processors using OSGi registry lookups: it worked quite well! However, I would 
caution against making things too dynamic. In my OSGi case, extension points 
that are temporarily not present were simply not executed: so, if a 
country-specific bundle was taken down or restarted, then there was a chance 
that important country-specific processing would be skipped, albeit for a brief 
period. In this case, you really need to adorn the incoming exchange with a set 
of mandatory extension points that must be processed for the message to be 
considered successfully processed. That way, the route can complain loud if a 
mandatory extension point is not present. 

Hope that makes sense!

- Original Message -
From: Christian Mueller christian.muel...@gmail.com
To: users@camel.apache.org users@camel.apache.org
Sent: Mon Aug 09 13:02:31 2010
Subject: Camel, OSGI and container wide Camel route lookups


Hello list!

The question: It is possible to discover a Camel route which is deployed in
another OSGI bundle like in the following code snippet:?

exchange.getContext().hasEndpoint(direct:deployedInOnotherOsgiBundle)


The context: We are using Camel 2.2.0-fuse-02-00 inside FUSE ESB
4.2.0-fuse-02-00. We only use Camel for our integration requirements (no
JBI). Our first integration solution contains approximate 15+ OSGI bundles.
Each OSGI bundle consists of one Camel context. This means we will deploy
15+ different Camel context.

Because we have to define standardized integration solutions for multiple
countries (with its country specificities), we plan to define our routes in
a template style where in the common route (the template) we define the
common part (which is equal in every country). In this common route, we will
define extension points where we will lookup the country specific
Processors. If they exists, we will execute they. If not, we will fallback
to the common processing. For a better understanding, a sample (really
dynamic) route could looks like:

from(direct:start)
.bean(orderEntry, validate)
.process(new ExtensionDiscoverProcessor(direct:preProcessOrderEntry))
// country specific pre processing - if defined
.process(new ExtensionDiscoverProcessor(direct:processOrderEntry)) //
country specific processing - if defined
.process(new ExtensionDiscoverProcessor(direct:postProcessOrderEntry))
// country specific post processing - if defined
.bean(orderEntry, audit)
.to(mock:result)

public class ExtensionDiscoverProcessor implements Processor,
InitializingBean {

private String baseEndpointUri;

public ExtensionDiscoverProcessor(String baseEndpointUri) {
this.baseEndpointUri= baseEndpointUri;
}

@Override
public void process(Exchange exchange) throws Exception {
String countryId = exchange.getIn().getHeader(COUNTRY_ID, 
String.class);
String extensionEndpointUri = baseEndpointUri + rbuId;

Endpoint endpoint =
exchange.getContext().hasEndpoint(extensionEndpointUri);
if (endpoint == null) {
if (log.isDebugEnabled()) {
log.debug(Extension endpoint ' + 
extensionEndpointUri +  doesn't
exist. Use base endpoint ' + baseEndpointUri + '.);
}

endpoint = 
exchange.getContext().hasEndpoint(baseEndpointUri);
if (endpoint == null) {
throw new IllegalArgumentException(Missing 
mandatory endpoint ' +
baseEndpointUri + ');
}
}

endpoint.createProducer().process(exchange);
}
}

If it's not possible, do you have an advice for an alternative?
I hope this was understandable... :o)

Thanks in advanced for your time and help,
Christian 
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-OSGI-and-container-wide-Camel-route-lookups-tp2269094p2269094.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic options on Direct component, possible?

2010-08-09 Thread Yiannis Mavroukakis
Hi Claus and thanks!

So this should not work?

recipientList
 method ref=recipientBean/
/recipientList


Y.

On 9 August 2010 17:11, Claus Ibsen claus.ib...@gmail.com wrote:

 On Mon, Aug 9, 2010 at 5:48 PM, Yiannis Mavroukakis
 imavrouka...@gameaccount.com wrote:
  Hi lovely people :)
 
  I was wondering, within the context of the Spring DSL, is it possible
  given a bean with @RecipientList to be used in
  a recipientList element ?
 

 No the idea is you use a bean element, even if the bean has been
 annotated with @RecipientList


  TIA
 
  Yiannis
 



 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus



Re: Dynamic options on Direct component, possible?

2010-08-09 Thread Yiannis Mavroukakis
Ah just noticed you're the author of Camel In Action, I'm reading the MEAP
as I'm going along, perhaps
something to include in the book ? :)

On 9 August 2010 17:11, Claus Ibsen claus.ib...@gmail.com wrote:

 On Mon, Aug 9, 2010 at 5:48 PM, Yiannis Mavroukakis
 imavrouka...@gameaccount.com wrote:
  Hi lovely people :)
 
  I was wondering, within the context of the Spring DSL, is it possible
  given a bean with @RecipientList to be used in
  a recipientList element ?
 

 No the idea is you use a bean element, even if the bean has been
 annotated with @RecipientList


  TIA
 
  Yiannis
 



 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus



Camel Pub Sub and security

2010-08-09 Thread Hossein

Hello,

Is there any camel example to show how to setup standalone publisher and
standalone subscriber? How should subscribers be added to topic? How should
the security be integrated into this; for my topic, how do I control only
valid subscribers being able to read from topic?

Thanks
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Pub-Sub-and-security-tp2352709p2352709.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel, OSGI and container wide interceptors

2010-08-09 Thread Willem Jiang

Hi Chirstian,

You can export the interceptor as OSGi service, and import the service 
as a bean with the help of Spring DM.
Then you can share the interceptor across the Camel context and the OSGi 
 bundle.


Willem
--
Apache Camel, Apache CXF committer
Open Source Integration http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang


Christian Mueller wrote:

Hello list!

We are using Camel 2.2.0-fuse-02-00 inside FUSE ESB 4.2.0-fuse-02-00. We
only use Camel for our integration requirements (no JBI). Our first
integration solution contains approximate 15+ OSGI bundles. Each OSGI bundle
consists of one Camel context. This means we will deploy 15+ different Camel
context. We will also use (our custom) Trace component to audit our message
flows.
Do we have to define the Trace component in each bundle? As described
[here|http://camel.apache.org/advanced-configuration-of-camelcontext-using-spring.html]
(Using container wide interceptors), it is possible to share interceptors
between different Camel context. Is this only possible it they are defined
in the same Spring configuration? Or is this also possible in an OSGI
environment like ServiceMix where another Camel context reside usually in
another OSGI bundle?

Thanks in advanced for your time and help,
Christian




Re: listener on intermediate queue

2010-08-09 Thread Willem Jiang
If you don't want other client to ruin your route, you can consider to 
use direct[1] endpoint or seda[2] endpoint. They are only visible within 
the camel context.


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

Willem
--
Apache Camel, Apache CXF committer
Open Source Integration http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang


Mark Webb wrote:

I am curious as to how Camel routes messages when there is an
intermediate queue involved.

What I am trying to set up is similar to the Loan Broker example at
http://camel.apache.org/loan-broker-example.html.  What is to stop an
external client from listening on queue
jms:queue:creditResponseQueue and seeing what is going on so that
other destinations in the system do not get all of the information and
screw up the system?

Mark