Re: How to send a templated mail with attachment?

2012-01-10 Thread LNB
Thanks for fixing, I didn't try it out because I think I cannot use a
snapshot version. But I used enrich as you proposed so now I can send emails
with an attachment :). Is there a reason to use a direct endpoint in
between, instead of using the stringtemplate endpoint directly in the enrich
method?



Christian Mueller wrote
 
 I had to fix camel-stringtemplate, camel-freemaker and camel-velocity in
 all supported branches (trunk, camel-2.9.x, camel-2.8.x and camel-2.7.x).
 If you cannot use a snapshot version (what I asume), I would propose to
 use
 the enricher component as a workaround. Something like:
 
 from(xxx)
   .enrich(direct:workaround, aggregationStrategie)
   .to(smtp:XXX);
 
 from(direct:workaround)
   .to(stringtemplate:XXX);
 
 And the aggregation strategie can copy the attachment from the old
 exchange
 to the new one.
 
 Sorry for this inconvenience. Let me know if you need help here.
 
 Best,
 Christian
 


--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-send-a-templated-mail-with-attachment-tp5125167p5133615.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: i am newbie to camel

2012-01-10 Thread Christian Schneider

An easy way to achieve this is using
.setHeader(headername, xpath(//myelement))
in your route. This way you can extract informations and add these as 
headers to the camel message.

You can then call a bean and work with these headers.

You can also write your bean like
public class MyBean {
public String createText(@Xpath(//myelement) myElement) {
return myElement;
}
}

The camel bean component allows to write a normal java class to process 
your xml. Using annotations like above you can extract parts from the
message. Returning a String means you overwrite the message body with 
this string.


You use the following in your route to call your bean:

.bean(new MyBean())

See:
http://camel.apache.org/bean-integration.html
http://camel.apache.org/xpath.html

The order example from the webinar could also be intersting as it 
extracts data from xml and puts it is a mail body.

https://github.com/cschneider/camel-webinar/tree/master/examples/example-order
The example uses a velocity template to build the mail body which is an 
alternative to using your own bean.


Christian


Am 10.01.2012 06:35, schrieb shaharyar:

thanks alot chris for your kind help
actually i just want to get values from that XML and nothing else.XML
parsing is not an issue.The real issue was that i want to build a route
which pick XML from a folder and then send it to processor and then
processor after parsing it (mean getting values from the file) write it into
a plain text file and place that file in another folder.
Thanks again.

--
View this message in context: 
http://camel.465427.n5.nabble.com/i-am-newbie-to-camel-tp5127199p5133380.html
Sent from the Camel - Users mailing list archive at Nabble.com.



--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com



Re: FTP consumer ignore existing files: configuration option?

2012-01-10 Thread Bilgin Ibryam
Hi Nic

On 9 January 2012 17:03, iamniche nhem...@scottlogic.co.uk wrote:
 Hello,

 I am using Camel successfully in my project, but have a question concerning
 the FTP consumer, specifically, with regard to existing files in a watched
 remote folder.

 Is there any way of ignoring all files that 'pre-exist' on the server,
 hopefully, through configuration on the route i.e. ignoreExisting=true or
 similar?

 I am only interested in *new* files that get added to the remote folder, not
 files that already exist when the route is created via the camel context.

The only solution I'm guessing about is to use a filter with
GenericFileFilter and there implement your logic. Getting file
creation time in java is tricky, but last modified date also might be
enough.


 Many thanks for any pointers (maybe I have missed an obvious config param)

 Cheerio,
 Nic

HTH
Bilgin


 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/FTP-consumer-ignore-existing-files-configuration-option-tp5131747p5131747.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to send a templated mail with attachment?

2012-01-10 Thread v_peter
Actually you can use stringtemplate or any other uri in enrich. 
But using direct helps to split the process in separate logical steps. You
can have direct:generateEmailBody and if you need to do anything else for
the step you can simply update the route.

--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-send-a-templated-mail-with-attachment-tp5125167p5133857.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel 2.9.0 startup error message ClassNotFoundException org.osgi.framework.BundleActivator

2012-01-10 Thread iamniche
Hello,

Please could someone tell me how to solve this error message that occurs in
my JBoss server logs:

Failed to define class org.apache.camel.osgi.Activator in Module from
Service Module Loader: java.lang.LinkageError: Failed to link
org/apache/camel/osgi/Activator
Caused by: java.lang.ClassNotFoundException:
org.osgi.framework.BundleActivator
at
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

The Activator class itself appears to be in package
org.apache.camel.impl.osgi not package org.apache.camel.osgi - is this a
problem with the default setting?

I am not (explicitly) using the Activator (I don't really know what it is to
be honest) but i would prefer not to get an error message in my logs every
time the server starts

Many thanks

Cheerio,
Nic

--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-9-0-startup-error-message-ClassNotFoundException-org-osgi-framework-BundleActivator-tp5133932p5133932.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FTP consumer ignore existing files: configuration option?

2012-01-10 Thread Claus Ibsen
On Tue, Jan 10, 2012 at 11:04 AM, Bilgin Ibryam bibr...@gmail.com wrote:
 Hi Nic

 On 9 January 2012 17:03, iamniche nhem...@scottlogic.co.uk wrote:
 Hello,

 I am using Camel successfully in my project, but have a question concerning
 the FTP consumer, specifically, with regard to existing files in a watched
 remote folder.

 Is there any way of ignoring all files that 'pre-exist' on the server,
 hopefully, through configuration on the route i.e. ignoreExisting=true or
 similar?

 I am only interested in *new* files that get added to the remote folder, not
 files that already exist when the route is created via the camel context.

 The only solution I'm guessing about is to use a filter with
 GenericFileFilter and there implement your logic. Getting file
 creation time in java is tricky, but last modified date also might be
 enough.


Yeah a custom filter should do the trick. However the timestamp from
the FTP library may not include seconds or so. I think I have seen it
report back only hours:minutes and then 00 for the seconds. I suggest
to just double check whether that apply in your case.

You may also have to consider whether you need to persist that last
timestamp detail, in case the Camel app is restarted or something.
Then you may need to catch up with files which was in the mean time
added to the FTP server.



 Many thanks for any pointers (maybe I have missed an obvious config param)

 Cheerio,
 Nic

 HTH
 Bilgin


 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/FTP-consumer-ignore-existing-files-configuration-option-tp5131747p5131747.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Re: Xstream marshals to byte array and not String

2012-01-10 Thread Willem Jiang

Can you try this ?

from(activemq:queryServer?exchangePattern=InOut)
.setExchangePattern(ExchangePattern.InOut)

.to(log:it.giammar.pratobackend?showHeaders=true).unmarshal()

.xstream().to(log:it.giammar.pratobackend?showHeaders=true)
.to(bean:saluta)

.to(log:it.giammar.pratobackend?showHeaders=true).marshal()
.xstream(UTF-8).convertTo(String.class).to(log:it.giammar.pratobackend?showHeaders=true);


On 1/9/12 4:33 AM, mgiammarco wrote:

Ok I have tried again and I failed again.

This is my route:

from(activemq:queryServer?exchangePattern=InOut)
.setExchangePattern(ExchangePattern.InOut)

.to(log:it.giammar.pratobackend?showHeaders=true).unmarshal()

.xstream().to(log:it.giammar.pratobackend?showHeaders=true)
.to(bean:saluta)

.to(log:it.giammar.pratobackend?showHeaders=true).marshal()

.xstream(UTF-8).to(log:it.giammar.pratobackend?showHeaders=true);


And this is the log:
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO
Exchange[ExchangePattern:InOut, Headers:{JMSDeliveryMode=1,
JMSDestination=queue://queryServer, JMSType=null, JMSXGroupID=null,
JMSExpiration=0, JMSTimestamp=1326054690900, JMSPriority=4,
JMSRedelivered=false,
JMSMessageID=ID:virtual1.mariosoft.mio-58130-1326054679482-4:1:-1:1:1,
JMSReplyTo=queue:///queue/mia,
breadcrumbId=ID:virtual1.mariosoft.mio-58130-1326054679482-4:1:-1:1:1,
JMSCorrelationID=null}, BodyType:String, Body:?xml version=1.0
?it.giammar.pratomodel.QueryRequestautomaticfalse/automaticquerystomp
stomp/query/it.giammar.pratomodel.QueryRequest]
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO
Exchange[ExchangePattern:InOut, Headers:{JMSReplyTo=queue:///queue/mia,
JMSXGroupID=null, JMSExpiration=0, JMSDestination=queue://queryServer,
JMSCorrelationID=null, JMSType=null, JMSPriority=4, JMSRedelivered=false,
JMSTimestamp=1326054690900,
JMSMessageID=ID:virtual1.mariosoft.mio-58130-1326054679482-4:1:-1:1:1,
breadcrumbId=ID:virtual1.mariosoft.mio-58130-1326054679482-4:1:-1:1:1,
JMSDeliveryMode=1}, BodyType:it.giammar.pratomodel.QueryRequest,
Body:QueryRequest [automatic=false, query=stomp stomp]]
[ #1 - JmsConsumer[queryServer]] Saluta INFO  sono
in sayhello
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO
Exchange[ExchangePattern:InOut, Headers:{JMSXGroupID=null,
JMSDestination=queue://queryServer, JMSType=null, JMSCorrelationID=null,
JMSReplyTo=queue:///queue/mia, JMSRedelivered=false,
breadcrumbId=ID:virtual1.mariosoft.mio-58130-1326054679482-4:1:-1:1:1,
JMSDeliveryMode=1, JMSPriority=4,
JMSMessageID=ID:virtual1.mariosoft.mio-58130-1326054679482-4:1:-1:1:1,
JMSExpiration=0, JMSTimestamp=1326054690900},
BodyType:it.giammar.pratomodel.QueryRequest, Body:QueryRequest
[automatic=true, query=stomp stomp]]
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO
Exchange[ExchangePattern:InOut, Headers:{JMSReplyTo=queue:///queue/mia,
JMSTimestamp=1326054690900, JMSRedelivered=false, JMSDeliveryMode=1,
JMSDestination=queue://queryServer, JMSCorrelationID=null, JMSType=null,
JMSExpiration=0,
breadcrumbId=ID:virtual1.mariosoft.mio-58130-1326054679482-4:1:-1:1:1,
JMSPriority=4,
JMSMessageID=ID:virtual1.mariosoft.mio-58130-1326054679482-4:1:-1:1:1,
JMSXGroupID=null}, BodyType:byte[], Body:?xml version='1.0'
encoding='UTF-8'?it.giammar.pratomodel.QueryRequestautomatictrue/automaticquerystomp
stomp/query/it.giammar.pratomodel.QueryRequest]



--
View this message in context: 
http://camel.465427.n5.nabble.com/Xstream-marshals-to-byte-array-and-not-String-tp5129211p5129934.html
Sent from the Camel - Users mailing list archive at Nabble.com.




--
Willem
--
FuseSource
Web: http://www.fusesource.com
Blog:http://willemjiang.blogspot.com (English)
 http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang


Re: Camel 2.9.0 startup error message ClassNotFoundException org.osgi.framework.BundleActivator

2012-01-10 Thread Willem Jiang

Hi,

Can you check if there is any other version of camel-core in your class 
path ?
I just check the camel-core-2.9.0 jar , the Activator class was packed 
in the  directory of org.apache.camel.impl.osgi.


On Tue Jan 10 20:01:53 2012, iamniche wrote:

Hello,

Please could someone tell me how to solve this error message that occurs in
my JBoss server logs:

Failed to define class org.apache.camel.osgi.Activator in Module from
Service Module Loader: java.lang.LinkageError: Failed to link
org/apache/camel/osgi/Activator
Caused by: java.lang.ClassNotFoundException:
org.osgi.framework.BundleActivator
at
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

The Activator class itself appears to be in package
org.apache.camel.impl.osgi not package org.apache.camel.osgi - is this a
problem with the default setting?

I am not (explicitly) using the Activator (I don't really know what it is to
be honest) but i would prefer not to get an error message in my logs every
time the server starts

Many thanks

Cheerio,
Nic

--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-9-0-startup-error-message-ClassNotFoundException-org-osgi-framework-BundleActivator-tp5133932p5133932.html
Sent from the Camel - Users mailing list archive at Nabble.com.





--
Willem
--
FuseSource
Web: http://www.fusesource.com
Blog:http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang 
Weibo: willemjiang 



(FTP) DefaultScheduledPollConsumer: Converts a polling consumer into an event-driven consumer instance.

2012-01-10 Thread Raul
Hello,

I want to create a custom component (Component, EndPoint, Consumer,
Producer..).
This component will create a FTP Route and it will have the control to start
and stop the FTP Route and the business logic too.

The first vesion of my component is a poll Consumer. This solution doesn't
like me because I have a poll (of my custom) and another poll inside (of
FTP)

I have read about DefaultScheduledPollConsumer, I don't know if I can use
it to create a event-driven componet that listens the file received from FTP
Route.

Anybody has experience with this class? An example?

Thank you.
Raúl








--
View this message in context: 
http://camel.465427.n5.nabble.com/FTP-DefaultScheduledPollConsumer-Converts-a-polling-consumer-into-an-event-driven-consumer-instance-tp5134561p5134561.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Xstream marshals to byte array and not String

2012-01-10 Thread mgiammarco
Ok I have tried but unfortunately reply is missing. Conversion to String
works:

[ #1 - JmsConsumer[queryServer]] pratobackend   INFO 
Exchange[ExchangePattern:InOut, Headers:{JMSCorrelationID=null,
breadcrumbId=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSPriority=4,
JMSMessageID=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSDeliveryMode=1, JMSReplyTo=queue:///queue/test, JMSRedelivered=false,
JMSTimestamp=1326218785346, JMSXGroupID=null,
JMSDestination=queue://queryServer, JMSType=null, JMSExpiration=0},
BodyType:String, Body:?xml version=1.0
?it.giammar.pratomodel.QueryRequestautomaticfalse/automaticquerystomp
stomp/query/it.giammar.pratomodel.QueryRequest]
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO 
Exchange[ExchangePattern:InOut, Headers:{JMSDestination=queue://queryServer,
JMSXGroupID=null, JMSExpiration=0, JMSPriority=4, JMSCorrelationID=null,
JMSDeliveryMode=1, JMSType=null,
breadcrumbId=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSReplyTo=queue:///queue/test,
JMSMessageID=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSRedelivered=false, JMSTimestamp=1326218785346},
BodyType:it.giammar.pratomodel.QueryRequest, Body:QueryRequest
[automatic=false, query=stomp stomp]]
[ #1 - JmsConsumer[queryServer]] Saluta INFO  sono
in sayhello
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO 
Exchange[ExchangePattern:InOut, Headers:{JMSXGroupID=null,
JMSTimestamp=1326218785346,
breadcrumbId=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSPriority=4,
JMSMessageID=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSExpiration=0, JMSReplyTo=queue:///queue/test,
JMSDestination=queue://queryServer, JMSType=null, JMSCorrelationID=null,
JMSDeliveryMode=1, JMSRedelivered=false},
BodyType:it.giammar.pratomodel.QueryRequest, Body:QueryRequest
[automatic=true, query=stomp stomp]]
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO 
Exchange[ExchangePattern:InOut, Headers:{JMSDeliveryMode=1,
JMSReplyTo=queue:///queue/test,
JMSMessageID=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
breadcrumbId=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSDestination=queue://queryServer, JMSTimestamp=1326218785346,
JMSPriority=4, JMSCorrelationID=null, JMSExpiration=0, JMSRedelivered=false,
JMSType=null, JMSXGroupID=null}, BodyType:byte[], Body:?xml version='1.0'
encoding='UTF-8'?it.giammar.pratomodel.QueryRequestautomatictrue/automaticquerystomp
stomp/query/it.giammar.pratomodel.QueryRequest]
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO 
Exchange[ExchangePattern:InOut,
Headers:{JMSMessageID=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSCorrelationID=null, JMSType=null, JMSDestination=queue://queryServer,
breadcrumbId=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSExpiration=0, JMSPriority=4, JMSTimestamp=1326218785346,
JMSReplyTo=queue:///queue/test, JMSXGroupID=null, JMSRedelivered=false,
JMSDeliveryMode=1}, BodyType:String, Body:?xml version='1.0'
encoding='UTF-8'?it.giammar.pratomodel.QueryRequestautomatictrue/automaticquerystomp
stomp/query/it.giammar.pratomodel.QueryRequest]


--
View this message in context: 
http://camel.465427.n5.nabble.com/Xstream-marshals-to-byte-array-and-not-String-tp5129211p5134795.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using the x509HostnameVerifier option in http4

2012-01-10 Thread Christian Müller
Good to know it works for you.

Have fun by riding the Camel,
Christian

On Tue, Jan 10, 2012 at 8:29 AM, xverges xver...@gmail.com wrote:

 Thanks, Christian. That helped me.

 I made my life hard by doing some typos and by creating the bean after I
 tried to use it, but thinks work now.

  bean id=hostnameVerifier
 class=org.apache.http.conn.ssl.AllowAllHostnameVerifier /

  camelContext xmlns=http://camel.apache.org/schema/spring;
packagecom.ibm.bcn.xv/package
  /camelContext

 Thanks.
 -Xavier

 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Using-the-x509HostnameVerifier-option-in-http4-tp5131544p5133564.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to send a templated mail with attachment?

2012-01-10 Thread Christian Müller
Exactly.
I copy pasted the sniped from one of our routes which are more complex. But
as already mentioned, if you don't need any complex pre processing, your
valid route could also looks as below:
from(xxx)
  .enrich(stringtemplate:XXX, aggregationStrategie)
  .to(smtp:XXX);

Best,
Christian

On Tue, Jan 10, 2012 at 11:55 AM, v_peter v_pe...@ukr.net wrote:

 Actually you can use stringtemplate or any other uri in enrich.
 But using direct helps to split the process in separate logical steps.
 You
 can have direct:generateEmailBody and if you need to do anything else for
 the step you can simply update the route.

 --
 View this message in context:
 http://camel.465427.n5.nabble.com/How-to-send-a-templated-mail-with-attachment-tp5125167p5133857.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



More complicated scenario for camel-bam

2012-01-10 Thread Łukasz Dywicki
Hey everyone,
I tried yo use camel-bam and it works for very basic example shown in 
documentation. It works well for correlating the files without any middle 
processing steps.

The process I try to monitor looks following

- receive incoming JMS message - split - multicast (queue1, queue2)

So I've build a following configuration for the process:
ValueBuilder correlation = header(JMSCorrelationID);
ActivityBuilder incoming = 
activity(activemq:incoming).correlate(correlation).name(incoming);

ActivityBuilder sys1 = 
activity(amq2:queue1).correlate(correlation).name(system1);
ActivityBuilder sys2 = 
activity(amq2:queue2).correlate(correlation).name(system2);

sys1.starts().after(incoming.starts());
sys2.starts().after(incoming.starts());

But after receiving messages and initializing a process instance nothing 
happens. Er it happens, the activity is created. I can not reuse a 
incoming.getEndpoint to create an from statement and process message. Multiple 
consumers on same destination are not allowed.

Issues I've discovered:
- Lack of support for parallel activities.
- No support for processing received message. Usually a incoming message is 
only a entry point for a process.
- No support for a custom process names. Not everyone are happy with Proces-N 
name. A ProcessBuilder extensions can't change a naming schema.
- Activity definition is not put into the database as long as it is not called 
by flow. Process is created and the activities are known, but they're not 
persisted before processing. So whole definitions are useless if we would like 
display process definitions somewhere else.
- Hard coded dependency to JPA, can't be replaced by alternative way of storing 
process definitions eg like in IdempotentRepository.

These issues makes a camel-bam useless in my case. Should I use an alternative 
tool like activiti-camel integration? It's fine but I don't need whole BPMN, 
diagraming. I want to track a flow between systems in an easy way, there is no 
human tasks, only service calls and camel logic.

Łukasz Dywicki
--
Code-House
Krasiczyńska 3/80
03-379 Warszawa





Re: Xstream marshals to byte array and not String

2012-01-10 Thread Willem Jiang

How did you send the message to the ActiveMQ?
Please make sure the MEP is InOut.
On Wed Jan 11 02:11:03 2012, mgiammarco wrote:

Ok I have tried but unfortunately reply is missing. Conversion to String
works:

[ #1 - JmsConsumer[queryServer]] pratobackend   INFO
Exchange[ExchangePattern:InOut, Headers:{JMSCorrelationID=null,
breadcrumbId=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSPriority=4,
JMSMessageID=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSDeliveryMode=1, JMSReplyTo=queue:///queue/test, JMSRedelivered=false,
JMSTimestamp=1326218785346, JMSXGroupID=null,
JMSDestination=queue://queryServer, JMSType=null, JMSExpiration=0},
BodyType:String, Body:?xml version=1.0
?it.giammar.pratomodel.QueryRequestautomaticfalse/automaticquerystomp
stomp/query/it.giammar.pratomodel.QueryRequest]
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO
Exchange[ExchangePattern:InOut, Headers:{JMSDestination=queue://queryServer,
JMSXGroupID=null, JMSExpiration=0, JMSPriority=4, JMSCorrelationID=null,
JMSDeliveryMode=1, JMSType=null,
breadcrumbId=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSReplyTo=queue:///queue/test,
JMSMessageID=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSRedelivered=false, JMSTimestamp=1326218785346},
BodyType:it.giammar.pratomodel.QueryRequest, Body:QueryRequest
[automatic=false, query=stomp stomp]]
[ #1 - JmsConsumer[queryServer]] Saluta INFO  sono
in sayhello
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO
Exchange[ExchangePattern:InOut, Headers:{JMSXGroupID=null,
JMSTimestamp=1326218785346,
breadcrumbId=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSPriority=4,
JMSMessageID=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSExpiration=0, JMSReplyTo=queue:///queue/test,
JMSDestination=queue://queryServer, JMSType=null, JMSCorrelationID=null,
JMSDeliveryMode=1, JMSRedelivered=false},
BodyType:it.giammar.pratomodel.QueryRequest, Body:QueryRequest
[automatic=true, query=stomp stomp]]
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO
Exchange[ExchangePattern:InOut, Headers:{JMSDeliveryMode=1,
JMSReplyTo=queue:///queue/test,
JMSMessageID=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
breadcrumbId=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSDestination=queue://queryServer, JMSTimestamp=1326218785346,
JMSPriority=4, JMSCorrelationID=null, JMSExpiration=0, JMSRedelivered=false,
JMSType=null, JMSXGroupID=null}, BodyType:byte[], Body:?xml version='1.0'
encoding='UTF-8'?it.giammar.pratomodel.QueryRequestautomatictrue/automaticquerystomp
stomp/query/it.giammar.pratomodel.QueryRequest]
[ #1 - JmsConsumer[queryServer]] pratobackend   INFO
Exchange[ExchangePattern:InOut,
Headers:{JMSMessageID=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSCorrelationID=null, JMSType=null, JMSDestination=queue://queryServer,
breadcrumbId=ID:virtual1.mariosoft.mio-54532-1326218763414-4:1:-1:1:1,
JMSExpiration=0, JMSPriority=4, JMSTimestamp=1326218785346,
JMSReplyTo=queue:///queue/test, JMSXGroupID=null, JMSRedelivered=false,
JMSDeliveryMode=1}, BodyType:String, Body:?xml version='1.0'
encoding='UTF-8'?it.giammar.pratomodel.QueryRequestautomatictrue/automaticquerystomp
stomp/query/it.giammar.pratomodel.QueryRequest]


--
View this message in context: 
http://camel.465427.n5.nabble.com/Xstream-marshals-to-byte-array-and-not-String-tp5129211p5134795.html
Sent from the Camel - Users mailing list archive at Nabble.com.





--
Willem
--
FuseSource
Web: http://www.fusesource.com
Blog:http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang 
Weibo: willemjiang 



Re: More complicated scenario for camel-bam

2012-01-10 Thread Hadrian Zbarcea

Lukasz, do you mind opening a jira with your findings?
Thanks, Hadrian

On 01/10/2012 06:36 PM, Łukasz Dywicki wrote:

Hey everyone,
I tried yo use camel-bam and it works for very basic example shown in 
documentation. It works well for correlating the files without any middle 
processing steps.

The process I try to monitor looks following

- receive incoming JMS message - split - multicast (queue1, queue2)

So I've build a following configuration for the process:
ValueBuilder correlation = header(JMSCorrelationID);
ActivityBuilder incoming = 
activity(activemq:incoming).correlate(correlation).name(incoming);

ActivityBuilder sys1 = 
activity(amq2:queue1).correlate(correlation).name(system1);
ActivityBuilder sys2 = 
activity(amq2:queue2).correlate(correlation).name(system2);

sys1.starts().after(incoming.starts());
sys2.starts().after(incoming.starts());

But after receiving messages and initializing a process instance nothing 
happens. Er it happens, the activity is created. I can not reuse a 
incoming.getEndpoint to create an from statement and process message. Multiple 
consumers on same destination are not allowed.

Issues I've discovered:
- Lack of support for parallel activities.
- No support for processing received message. Usually a incoming message is 
only a entry point for a process.
- No support for a custom process names. Not everyone are happy with Proces-N 
name. A ProcessBuilder extensions can't change a naming schema.
- Activity definition is not put into the database as long as it is not called 
by flow. Process is created and the activities are known, but they're not 
persisted before processing. So whole definitions are useless if we would like 
display process definitions somewhere else.
- Hard coded dependency to JPA, can't be replaced by alternative way of storing 
process definitions eg like in IdempotentRepository.

These issues makes a camel-bam useless in my case. Should I use an alternative 
tool like activiti-camel integration? It's fine but I don't need whole BPMN, 
diagraming. I want to track a flow between systems in an easy way, there is no 
human tasks, only service calls and camel logic.

Łukasz Dywicki
--
Code-House
Krasiczyńska 3/80
03-379 Warszawa





--
Hadrian Zbarcea
Principal Software Architect
Talend, Inc
http://coders.talend.com/
http://camelbot.blogspot.com/