Re: sftp with privateKeyFile using camel-ftp

2010-06-23 Thread Bengt Rodehav
Hi Claus,

Unfortunately I get nothing in the log. If it were the 256 limit I was kind
of expecting some kind of Exception. I've also been bitten by it in the
past and normally you get some kind of security related exception. Maybe
it's caught somewhere...

To be sure I'll download the updated policy files and also try a separate
client like you suggest.

Thanks,

/Bengt

2010/6/23 Claus Ibsen claus.ib...@gmail.com

 Hi

 The key length restriction have bitten me in the past. You had to
 download a special extension and override some files in the JRE to be
 able to use longer keys. I think the restriction was very low at the
 time, like 256 or so.

 Since its JCraft that does the SFTP stuff you may have to google a bit
 and try reading some of their documentation how to do this. Maybe
 there is some help there.

 And I assume you dont get any errors or the likes in the log / console?
 And have you tried outside OSGi, eg from a plain unit test also?



 On Tue, Jun 22, 2010 at 11:08 PM, Bengt Rodehav be...@rodehav.com wrote:
  I'm trying to get sftp private key authentication to work with sftp with
 no
  luck. I have a route similar to the following:
 
  from(file:datadir).to(sftp://u...@localhost
  /datadir?password=passwordprivateKeyFile=user.key);
 
  The sftp server is Serv-U. I generate key pairs using Serv-U. The public
 key
  is used by Serv-U while camel-ftp is configured with the private key.
 Camel
  manages to connect to Serv-U but never to log in. The key type is DSA and
  the key length is 1024. The private key looks lilke this:
 
  -BEGIN DSA PRIVATE KEY-
  MIIBugIBAAKBgQCR+zLyBwj0gcvNh6xmauvc2YdYYEjjoXdIUpzb01zmwFzqia9q
  nWCTL5t3iwqgBrZIxOa75M322OsG99+7JsBn1YaTxDJ4hSnX0dyheS620HsMFbP1
  27LjYFX2mee8jeZN8GIUAdPLDHPkvGnlGfFFvj8f/IKfjAexECrBhlyhyQIVAI+1
  CU2hfXqiLDuIPKruy17wrzyVAoGAB7qCoD8vJPq4jMZ77Scv4dfWgz6F+LMImcl8
  QOIh+3f3JhJvR9f+hw1MGsg3l/z57GlfgXkqt420vTPI6OghELv/hauFNSExCKqv
  kJW+J7Hyoa0sGuf7Ihy9vC6PJnoNkopqqecwpAUUpvKahcZ1uvNnGfRDc5SGmuzn
  ZhKHy5ICgYBv94YBWdxGXWwcUKAmJrC+u3Xdnb8t1RY0RcrbKYqQe5Eekza4gh8B
  iGdLMBdX3CZlXINJRhsK0UU7E+edEIk+aCtAnFE2+S4zPqtpFGOLIjOQ+i2W5XZv
  MOHoxrse7qNvstZRc0BMaEKuKd9DW4wy9JMMZC7xChF8590rCaWA5gIURVR0jghL
  lZpwVaJtN6Yo7kUe9S8=
  -END DSA PRIVATE KEY-
 
  Is this a format that camel-ftp recognises? Can anyone suggest how to
 create
  a key pair that camel-ftp will recognise. I can then try to see if Serv-U
  also supports that?
 
  To verify that Serv-U works, I tried connecting with Filezilla client. It
  converted the private key to Putty format but then it worked.
 
  Could it have anything to do with US export limitations? Is the key to
 long?
 
  /Bengt
 



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



Using File language and Properties in Endpoint

2010-06-23 Thread Schneider Christian
Hi all,

I got the following problem. I want to configure a file Endpoint using the File 
Language that should additionally have Properties replaced. As we are still on 
Camel 2.1 we can only use properties in Spring Language Endpoint tags.

So my try was:
endpoint id=errorEndpoint 
uri=file://${errorDir}?fileName=${file:name}.txt/

The problem is that file:name is not recoginzed.

When I use the uri directly in to the file:name works but I can´t use 
${errorDir} there.
So what works is:
to uri=file://target/error?fileName=${file:name}.txt/

Any ideas?

Greetings

Christian


Christian Schneider
Informationsverarbeitung
Business Solutions
Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ‑ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier





Re: CAMEL-CXF, PHP and the ?xml ...? header

2010-06-23 Thread S. Ali Tokmen

Hello again

After digging even deeper on my side, I have the impression that the 
issue is not because of the ?xml header but rather due to the fact that 
I'm using a Web Service that's MTOM (which is logical: the WS handles 
file download and uploads). Trouble: PHP's SOAP client doesn't support 
MTOM (you can google PHP SOAP MTOM for details).


So, thank you for the ideas... But unfortunately the problem was 
elsewhere :)


Cheers

S. Ali Tokmen
savas-ali.tok...@bull.net

Office: +33 4 76 29 76 19
GSM:+33 66 43 00 555

Bull, Architect of an Open World TM
http://www.bull.com


On 23/06/2010 10:18, Willem Jiang wrote:

Hi,

I just tried the solution of the JAXWS Handler, it only print out the 
soap message and doesn't change the output stream which is sent to 
client.


After digging a while, I found the StaxOutInterceptor[1] will check 
the message context with the key of 
org.apache.cxf.stax.force-start-document to decide if it will send 
the xml declaration.


So you can configure this interceptor[2] into the camel-cxf endponit 
or setting the message header when you return the response to the cxf 
client.


BTW, the last option only work in Camel 2.4 SNAPSHOT [3].

[1]http://www.docjar.com/html/api/org/apache/cxf/interceptor/StaxOutInterceptor.java.html 

[2]https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/WriteXmlDeclarationInterceptor.java 


[3]https://issues.apache.org/activemq/browse/CAMEL-2841

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


William Tam wrote:
There is a way of adding the XML header by using JAXWS handler.   
http://stackoverflow.com/questions/1614431/webservicice-with-apache-cxf-and-custom-headers 



But, let me see if there is a easier way to it without requiring 
handler.


On 06/21/2010 11:50 AM, S. Ali Tokmen wrote:

Hello

I have routes that use CAMEL-CXF. When I call these routes via 
SoapUI, JAX-WS, JAX-RPC or even Microsoft C# these work perfectly.


BUT, when I try with PHP (whether NuSOAP or the new SoapClient), I 
have a PHP error like:


   Error:sendSms: SoapFault exception: [Client] looks like we got no
   XML document in [...]

If I look at the HTTP response generated by CAMEL-CXF, its response 
looks like:


   HTTP/1.1 200 OK
   Server: Apache-Coyote/1.1
   Content-Type: multipart/related; type=application/xop+xml;
   boundary=uuid:7de96b4c-37f3-4835-9519-7adad8ce8114;
   start=root.mess...@cxf.apache.org; start-info=text/xml
   Content-Length: 1235
   Date: Mon, 21 Jun 2010 15:32:15 GMT


   --uuid:7de96b4c-37f3-4835-9519-7adad8ce8114
   Content-Type: application/xop+xml; charset=UTF-8; type=text/xml;
   Content-Transfer-Encoding: binary
   Content-ID: root.mess...@cxf.apache.org

soap:Envelope
   
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:Body[...]/soap:Body/soap:Envelope 


   --uuid:7de96b4c-37f3-4835-9519-7adad8ce8114--

As a result, the SOAP content doesn't start with:

?xml version=1.0 encoding=utf-8?

... and I think that's what making PHP fail.

Any ideas on putting the XML header in front of the SOAP response?

Cheers












Re: Problem with maintaining a JMS subscription after waking from sleep

2010-06-23 Thread huntc

I've just made a discovery on my own machine. Looks as though this issue may
actually be related to Spring. What I did was start up a broker, start up my
application that subscribes to a topic, shutdown the broker and:


Exception in thread DefaultMessageListenerContainer-1
java.lang.NullPointerException
at java.lang.String.indexOf(String.java:1733)
at java.lang.String.indexOf(String.java:1715)
at
org.springframework.jms.support.JmsUtils.buildExceptionMessage(JmsUtils.java:255)
at
org.springframework.jms.listener.DefaultMessageListenerContainer.handleListenerSetupFailure(DefaultMessageListenerContainer.java:745)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:897)
at java.lang.Thread.run(Thread.java:637)


The line in question is:


public static String buildExceptionMessage(JMSException ex) {
String message = ex.getMessage();
Exception linkedEx = ex.getLinkedException();
if (linkedEx != null  message.indexOf(linkedEx.getMessage()) 
== -1) { 
// 
message = message + ; nested exception is  + linkedEx;
}
return message;
}


Any thoughts? Have we started using some later version of Spring?

Kind regards,
Christopher
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-maintaining-a-JMS-subscription-after-waking-from-sleep-tp510193p510846.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Performance loss observed when using the ProducerTemplate to send an exchange to an endpoint

2010-06-23 Thread Claus Ibsen
Hi

Can you show a bit more how you use the template and how you obtain
those endpoints.
And what kind of endpoints are those? Are you sending to a MQ or the likes?

Under the covers the Java DSL uses the same foundation as the template
so it ought to be able to run on par in speed.


On Wed, Jun 23, 2010 at 11:29 AM, NickWK nick.woolls-k...@misys.com wrote:

 I am using Apache Camel version 2.2.0-fuse-01-00 in the WebSphere Application
 Server web container.

 I am looking to use the Apache Camel ProducerTemplate class to send messages
 to endpoints from within a Java class and have observed a significant
 reduction in message throughput when using the
 ProducerTemplate.send(Endpoint, Exchange) method over sending message to
 endpoints directly in Java DSL. With a pure Java DSL solution I was
 observing a throughput of 23 msgs/s and when writing to same Camel endpoints
 from a JavaBean using a ProducerTemplate throughput fell to 4 msgs/s.

 I have declared my ProducerTemplate as a bean in the Spring configuration
 file as suggested in the documentation:

 camel-spring:template id=template/

 In the JavaBean I lookup the template from Spring ApplicationContext ctx:

 ProducerTemplate localProducer = (ProducerTemplate)ctx.getBean(template);

 And write to a Camel endpoint using:

 localProducer.send(endpoint, exchange);

 With Spring handling the lifecycle of the ProducerTemplate.

 Is this the correct way to use a ProducerTemplate?
 Has anybody else experienced a performance hit when using the
 ProducerTemplate?
 Is their any alternative method available for writing to a camel producer
 from a POJO?
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Performance-loss-observed-when-using-the-ProducerTemplate-to-send-an-exchange-to-an-endpoint-tp510843p510843.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


Re: Problem with maintaining a JMS subscription after waking from sleep

2010-06-23 Thread huntc

After a little more research, I think its because the version of Spring we're
using has this bug:

https://jira.springsource.org/browse/SPR-5275

Any recommendations?

Kind regards,
Christopher
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-maintaining-a-JMS-subscription-after-waking-from-sleep-tp510193p510849.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: sftp with privateKeyFile using camel-ftp

2010-06-23 Thread Bengt Rodehav
Claus,

I'll try to get some help regarding this on the Jsch mailing list.

Remember I told you nothing turns up in the log. I've looked at the source
code for camel-ftp (SftpOperations.java) and there is no logger attached to
Jsch. I created a JIRA for that:
https://issues.apache.org/activemq/browse/CAMEL-2842

https://issues.apache.org/activemq/browse/CAMEL-2842I have a patch that
I'll attach to the JIRA. I need to do a SVN update locally to be able to
create a diff file but I cant currently connect to the SVN repository. I'll
attach the patch as soon as possible.

/Bengt

2010/6/23 Bengt Rodehav be...@rodehav.com

 Hi Claus,

 Unfortunately I get nothing in the log. If it were the 256 limit I was kind
 of expecting some kind of Exception. I've also been bitten by it in the
 past and normally you get some kind of security related exception. Maybe
 it's caught somewhere...

 To be sure I'll download the updated policy files and also try a separate
 client like you suggest.

 Thanks,

 /Bengt

 2010/6/23 Claus Ibsen claus.ib...@gmail.com

 Hi

 The key length restriction have bitten me in the past. You had to
 download a special extension and override some files in the JRE to be
 able to use longer keys. I think the restriction was very low at the
 time, like 256 or so.

 Since its JCraft that does the SFTP stuff you may have to google a bit
 and try reading some of their documentation how to do this. Maybe
 there is some help there.

 And I assume you dont get any errors or the likes in the log / console?
 And have you tried outside OSGi, eg from a plain unit test also?



 On Tue, Jun 22, 2010 at 11:08 PM, Bengt Rodehav be...@rodehav.com
 wrote:
  I'm trying to get sftp private key authentication to work with sftp with
 no
  luck. I have a route similar to the following:
 
  from(file:datadir).to(sftp://u...@localhost
  /datadir?password=passwordprivateKeyFile=user.key);
 
  The sftp server is Serv-U. I generate key pairs using Serv-U. The public
 key
  is used by Serv-U while camel-ftp is configured with the private key.
 Camel
  manages to connect to Serv-U but never to log in. The key type is DSA
 and
  the key length is 1024. The private key looks lilke this:
 
  -BEGIN DSA PRIVATE KEY-
  MIIBugIBAAKBgQCR+zLyBwj0gcvNh6xmauvc2YdYYEjjoXdIUpzb01zmwFzqia9q
  nWCTL5t3iwqgBrZIxOa75M322OsG99+7JsBn1YaTxDJ4hSnX0dyheS620HsMFbP1
  27LjYFX2mee8jeZN8GIUAdPLDHPkvGnlGfFFvj8f/IKfjAexECrBhlyhyQIVAI+1
  CU2hfXqiLDuIPKruy17wrzyVAoGAB7qCoD8vJPq4jMZ77Scv4dfWgz6F+LMImcl8
  QOIh+3f3JhJvR9f+hw1MGsg3l/z57GlfgXkqt420vTPI6OghELv/hauFNSExCKqv
  kJW+J7Hyoa0sGuf7Ihy9vC6PJnoNkopqqecwpAUUpvKahcZ1uvNnGfRDc5SGmuzn
  ZhKHy5ICgYBv94YBWdxGXWwcUKAmJrC+u3Xdnb8t1RY0RcrbKYqQe5Eekza4gh8B
  iGdLMBdX3CZlXINJRhsK0UU7E+edEIk+aCtAnFE2+S4zPqtpFGOLIjOQ+i2W5XZv
  MOHoxrse7qNvstZRc0BMaEKuKd9DW4wy9JMMZC7xChF8590rCaWA5gIURVR0jghL
  lZpwVaJtN6Yo7kUe9S8=
  -END DSA PRIVATE KEY-
 
  Is this a format that camel-ftp recognises? Can anyone suggest how to
 create
  a key pair that camel-ftp will recognise. I can then try to see if
 Serv-U
  also supports that?
 
  To verify that Serv-U works, I tried connecting with Filezilla client.
 It
  converted the private key to Putty format but then it worked.
 
  Could it have anything to do with US export limitations? Is the key to
 long?
 
  /Bengt
 



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





AW: Using File language and Properties in Endpoint

2010-06-23 Thread Schneider Christian
Hi Claus,

when I use the bean style is it then possible to use ${file:name}? I would 
guess this is not possible.
So that means upgrade to 2.3?

Greetings

Christian



Christian Schneider
Informationsverarbeitung 
Business Solutions
Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier


-Ursprüngliche Nachricht-
Von: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Gesendet: Mittwoch, 23. Juni 2010 11:11
An: users@camel.apache.org
Betreff: Re: Using File language and Properties in Endpoint

You can try using the bean style instead

bean id=errorEndpoint class=org.apache  FileEndpoint
  property name=fileName value=${someSpringPropertyKeyHere/
  !-- and set all the other options as well --
/bean







 The problem is that file:name is not recoginzed.

 When I use the uri directly in to the file:name works but I can´t use 
 ${errorDir} there.
 So what works is:


 Any ideas?

 Greetings

 Christian




Re: sftp with privateKeyFile using camel-ftp

2010-06-23 Thread Bengt Rodehav
Logging patch is now attached to the JIRA.

/Bengt

2010/6/23 Bengt Rodehav be...@rodehav.com

 Claus,

 I'll try to get some help regarding this on the Jsch mailing list.

 Remember I told you nothing turns up in the log. I've looked at the source
 code for camel-ftp (SftpOperations.java) and there is no logger attached to
 Jsch. I created a JIRA for that:
 https://issues.apache.org/activemq/browse/CAMEL-2842

 https://issues.apache.org/activemq/browse/CAMEL-2842I have a patch that
 I'll attach to the JIRA. I need to do a SVN update locally to be able to
 create a diff file but I cant currently connect to the SVN repository. I'll
 attach the patch as soon as possible.

 /Bengt

 2010/6/23 Bengt Rodehav be...@rodehav.com

 Hi Claus,

 Unfortunately I get nothing in the log. If it were the 256 limit I was
 kind of expecting some kind of Exception. I've also been bitten by it in
 the past and normally you get some kind of security related exception. Maybe
 it's caught somewhere...

 To be sure I'll download the updated policy files and also try a separate
 client like you suggest.

 Thanks,

 /Bengt

 2010/6/23 Claus Ibsen claus.ib...@gmail.com

 Hi

 The key length restriction have bitten me in the past. You had to
 download a special extension and override some files in the JRE to be
 able to use longer keys. I think the restriction was very low at the
 time, like 256 or so.

 Since its JCraft that does the SFTP stuff you may have to google a bit
 and try reading some of their documentation how to do this. Maybe
 there is some help there.

 And I assume you dont get any errors or the likes in the log / console?
 And have you tried outside OSGi, eg from a plain unit test also?



 On Tue, Jun 22, 2010 at 11:08 PM, Bengt Rodehav be...@rodehav.com
 wrote:
  I'm trying to get sftp private key authentication to work with sftp
 with no
  luck. I have a route similar to the following:
 
  from(file:datadir).to(sftp://u...@localhost
  /datadir?password=passwordprivateKeyFile=user.key);
 
  The sftp server is Serv-U. I generate key pairs using Serv-U. The
 public key
  is used by Serv-U while camel-ftp is configured with the private key.
 Camel
  manages to connect to Serv-U but never to log in. The key type is DSA
 and
  the key length is 1024. The private key looks lilke this:
 
  -BEGIN DSA PRIVATE KEY-
  MIIBugIBAAKBgQCR+zLyBwj0gcvNh6xmauvc2YdYYEjjoXdIUpzb01zmwFzqia9q
  nWCTL5t3iwqgBrZIxOa75M322OsG99+7JsBn1YaTxDJ4hSnX0dyheS620HsMFbP1
  27LjYFX2mee8jeZN8GIUAdPLDHPkvGnlGfFFvj8f/IKfjAexECrBhlyhyQIVAI+1
  CU2hfXqiLDuIPKruy17wrzyVAoGAB7qCoD8vJPq4jMZ77Scv4dfWgz6F+LMImcl8
  QOIh+3f3JhJvR9f+hw1MGsg3l/z57GlfgXkqt420vTPI6OghELv/hauFNSExCKqv
  kJW+J7Hyoa0sGuf7Ihy9vC6PJnoNkopqqecwpAUUpvKahcZ1uvNnGfRDc5SGmuzn
  ZhKHy5ICgYBv94YBWdxGXWwcUKAmJrC+u3Xdnb8t1RY0RcrbKYqQe5Eekza4gh8B
  iGdLMBdX3CZlXINJRhsK0UU7E+edEIk+aCtAnFE2+S4zPqtpFGOLIjOQ+i2W5XZv
  MOHoxrse7qNvstZRc0BMaEKuKd9DW4wy9JMMZC7xChF8590rCaWA5gIURVR0jghL
  lZpwVaJtN6Yo7kUe9S8=
  -END DSA PRIVATE KEY-
 
  Is this a format that camel-ftp recognises? Can anyone suggest how to
 create
  a key pair that camel-ftp will recognise. I can then try to see if
 Serv-U
  also supports that?
 
  To verify that Serv-U works, I tried connecting with Filezilla client.
 It
  converted the private key to Putty format but then it worked.
 
  Could it have anything to do with US export limitations? Is the key to
 long?
 
  /Bengt
 



 --
 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: AW: Using File language and Properties in Endpoint

2010-06-23 Thread Willem Jiang

Hi Christian,

The bean style is support in Camel 2.1, you don't have to upgrade Camel :)

Willem

Schneider Christian wrote:

Hi Claus,

when I use the bean style is it then possible to use ${file:name}? I would 
guess this is not possible.
So that means upgrade to 2.3?

Greetings

Christian



Christian Schneider
Informationsverarbeitung 
Business Solutions

Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier


-Ursprüngliche Nachricht-
Von: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Gesendet: Mittwoch, 23. Juni 2010 11:11

An: users@camel.apache.org
Betreff: Re: Using File language and Properties in Endpoint

You can try using the bean style instead

bean id=errorEndpoint class=org.apache  FileEndpoint
  property name=fileName value=${someSpringPropertyKeyHere/
  !-- and set all the other options as well --
/bean








The problem is that file:name is not recoginzed.

When I use the uri directly in to the file:name works but I can´t use 
${errorDir} there.
So what works is:


Any ideas?

Greetings

Christian








Re: J2SE enough to compile Java DSL components? Or J2EE required?

2010-06-23 Thread Willem Jiang

I think the ActiveMQ jars are enough for you :)

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

benxs wrote:

Assume I want to use Java DSL (and not Spring XML) to handle JMS Messages.

Is Java J2SE enough to compile the source code or do I need Java J2EE?

Are the necessary java libs already included in an ActiveMQ installation 
or do I have to add them (Which) manually?


Ben




Re: Performance loss observed when using the ProducerTemplate to send an exchange to an endpoint

2010-06-23 Thread NickWK

Hi Claus,

Thanks for your quick response.

I using WebSphere MQ queues and a SQL Server 2005 database table as my
endpoints. I have made a code change this morning to cache the endpoints
once they have been created from the CamelContext using:

Endpoint endpoint = camelContext.getEndpoint(uri)

This along with a few other changes has improved the performance of the
routing from 4msgs/s to about 8msgs/sec but this is still well down on the
23msgs/s I get with the pure Java DSL version. Please note that I am using
the WebSphere transaction manager to provide XA transaction coordination in
all my routes.

My Camel route that uses the ProducerTemplate is given below:

from(webspheremqxa:queue:input_queue).
transacted().
to(myParsingEngine).
to(myClient).
end();

Where myParsingEngine processor loads the message in memory and myClient
processor manipulates the emssage and writes it to a WebSphere MQ queue and
a SQLServer table using the ProducerTemplate.

My pure Java DSL route is given below:

from(webspheremqxa:queue:input_queue3).
transacted().
to(myParsingEngine).
multicast().
pipeline(). // Route to the JDBC endpoint
choice().
when().method(myRoutingConditions,matches).

to(bean:myTransformEngine?method=doMappingOnly). 

to(bean:mySelector?method=toSqlServerSql).
to(jdbc:mssql-2005-xa-ds).
//when(). 
//otherwise().
end().
end().
pipeline(). // Route to the JMS endpoint
choice().
when().method(myRoutingConditions,matches). 
 

to(bean:myTransformEngine?method=doMappingOnly).

to(bean:myFormattingEngine?method=serialiseOnly).

to(webspheremqxa:queue:swift_output_queue2).
//when(). 
//otherwise().
end(). 
end().
end(); 

Any further guidance would be greatly appreciated.

Regards,

Nick
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Performance-loss-observed-when-using-the-ProducerTemplate-to-send-an-exchange-to-an-endpoint-tp510843p510886.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Simple duplication of incoming msg with WireTap does not work? Avoid re-execution of route statement?

2010-06-23 Thread benxs

I defined the following route for camel in an ActiveMQ installation:

route
from uri=activemq:inputqueue/
wireTap uri=activemq:dupequeue/
to uri=activemq:inputqueue/
/route

Every incoming JMS msg should simply be duplicated. The dupe should be put
in
another queue called dupequeue. The original jms msg should 
remain in the input queue for later retrieval (by other java program).
Thats all.

The route definition above does not work.

The WireTap statement is performed successfully but the jms msg is
re-inserted into the
same source queue again which cause an endless loop.

How can I avoid re-application of the route definition once it is execute
the first time?

Ben
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Simple-duplication-of-incoming-msg-with-WireTap-does-not-work-Avoid-re-execution-of-route-statement-tp510887p510887.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem with maintaining a JMS subscription after waking from sleep

2010-06-23 Thread huntc


Claus Ibsen-2 wrote:
 
 Can you post a bit more on the stacktrace? Maybe we can find a spot in
 the camel-jms component to workaround this issue by setting an non
 null message on the JmsException. This may help prevent this spring
 bug.
 

Hi Claus,

That was the entire stack trace I'm afraid!

BTW: Is there a big issue with regards to upgrading Camel to Spring 3?

Kind regards,
Christopher
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-maintaining-a-JMS-subscription-after-waking-from-sleep-tp510193p510888.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem with maintaining a JMS subscription after waking from sleep

2010-06-23 Thread Claus Ibsen
On Wed, Jun 23, 2010 at 1:57 PM, huntc hu...@mac.com wrote:


 Claus Ibsen-2 wrote:

 Can you post a bit more on the stacktrace? Maybe we can find a spot in
 the camel-jms component to workaround this issue by setting an non
 null message on the JmsException. This may help prevent this spring
 bug.


 Hi Claus,

 That was the entire stack trace I'm afraid!

 BTW: Is there a big issue with regards to upgrading Camel to Spring 3?


No you can replace the spring jars.


 Kind regards,
 Christopher
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Problem-with-maintaining-a-JMS-subscription-after-waking-from-sleep-tp510193p510888.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


Re: Simple duplication of incoming msg with WireTap does not work? Avoid re-execution of route statement?

2010-06-23 Thread Claus Ibsen
On Wed, Jun 23, 2010 at 1:56 PM, benxs bxsto...@yahoo.co.uk wrote:

 I defined the following route for camel in an ActiveMQ installation:

 route
    from uri=activemq:inputqueue/
    wireTap uri=activemq:dupequeue/
    to uri=activemq:inputqueue/
 /route

 Every incoming JMS msg should simply be duplicated. The dupe should be put
 in
 another queue called dupequeue. The original jms msg should
 remain in the input queue for later retrieval (by other java program).
 Thats all.

 The route definition above does not work.

 The WireTap statement is performed successfully but the jms msg is
 re-inserted into the
 same source queue again which cause an endless loop.

 How can I avoid re-application of the route definition once it is execute
 the first time?


If you want to duplicate messages on the JMS broker then you need to
use broker specific solutions for that.
Ask at the AMQ user forum and check the AMQ web site for how to do that.

The JMS component in Camel will *consume* messages from the queue and
route them.

You can also use a JMS queue browser to browse the queue and then be
able to tap the messages.
However the browser doesn't have a callback when new messages arrives
etc. You most likely can do this using native JMS  / AMQ API as well.

But ask at the AMQ forum.


 Ben
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Simple-duplication-of-incoming-msg-with-WireTap-does-not-work-Avoid-re-execution-of-route-statement-tp510887p510887.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


Re: Problem with maintaining a JMS subscription after waking from sleep

2010-06-23 Thread huntc


Claus Ibsen-2 wrote:
 
 No you can replace the spring jars.
 

Upgrading to Spring 3.0.3.RELEASE fixes the problem.

Should we move Camel to Spring 3?

Kind regards,
Christopher
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-maintaining-a-JMS-subscription-after-waking-from-sleep-tp510193p510895.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem with maintaining a JMS subscription after waking from sleep

2010-06-23 Thread Claus Ibsen
On Wed, Jun 23, 2010 at 4:01 PM, Willem Jiang willem.ji...@gmail.com wrote:
 Hi,

 As Camel is used within ActiveMQ and ServiceMix, we can't just upgrade
 Spring version in Camel.
 But there is spring3 profile in camel parent/pom.xml, you can build camel
 with spring 3.0.3.RELEASE with that profile if you like.

 If you are using OSGi, camel also has a feature file (features-spring3.xml)
 which depends on Spring 3.x.


Yeah I think we will wait for Camel 3.0 to be JDK 1.6+ Spring 3.0+ as min.


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

 huntc wrote:

 Claus Ibsen-2 wrote:

 No you can replace the spring jars.


 Upgrading to Spring 3.0.3.RELEASE fixes the problem.

 Should we move Camel to Spring 3?

 Kind regards,
 Christopher





-- 
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: Performance loss observed when using the ProducerTemplate to send an exchange to an endpoint

2010-06-23 Thread Claus Ibsen
Hi

Maybe you could enable more logging and use that to see if you can
spot an obvious time gap between the two?

org.apache.camel.impl.ProducerCache=TRACE
org.apache.camel.util.ServiceHelper=TRACE

The ServiceHelper logs when producers/consumers etc. is being started stopped.

You can also use an EventNotifier to log the time it takes to send a
message to a endpoint.
Also JMX gathers stats as well.

Also a real profiler can help as well.


On Wed, Jun 23, 2010 at 1:55 PM, NickWK nick.woolls-k...@misys.com wrote:

 Hi Claus,

 Thanks for your quick response.

 I using WebSphere MQ queues and a SQL Server 2005 database table as my
 endpoints. I have made a code change this morning to cache the endpoints
 once they have been created from the CamelContext using:

 Endpoint endpoint = camelContext.getEndpoint(uri)

 This along with a few other changes has improved the performance of the
 routing from 4msgs/s to about 8msgs/sec but this is still well down on the
 23msgs/s I get with the pure Java DSL version. Please note that I am using
 the WebSphere transaction manager to provide XA transaction coordination in
 all my routes.

 My Camel route that uses the ProducerTemplate is given below:

    from(webspheremqxa:queue:input_queue).
    transacted().
    to(myParsingEngine).
    to(myClient).
    end();

 Where myParsingEngine processor loads the message in memory and myClient
 processor manipulates the emssage and writes it to a WebSphere MQ queue and
 a SQLServer table using the ProducerTemplate.

 My pure Java DSL route is given below:

        from(webspheremqxa:queue:input_queue3).
        transacted().
        to(myParsingEngine).
        multicast().
                pipeline(). // Route to the JDBC endpoint
                        choice().
                                when().method(myRoutingConditions,matches).
                                        
 to(bean:myTransformEngine?method=doMappingOnly).
                                        
 to(bean:mySelector?method=toSqlServerSql).
                                        to(jdbc:mssql-2005-xa-ds).
                                //when().
                                //otherwise().
                        end().
                end().
                pipeline(). // Route to the JMS endpoint
                        choice().
                                when().method(myRoutingConditions,matches).
                                        
 to(bean:myTransformEngine?method=doMappingOnly).
                                        
 to(bean:myFormattingEngine?method=serialiseOnly).
                                        
 to(webspheremqxa:queue:swift_output_queue2).
                                //when().
                                //otherwise().
                        end().
                end().
        end();

 Any further guidance would be greatly appreciated.

 Regards,

 Nick
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Performance-loss-observed-when-using-the-ProducerTemplate-to-send-an-exchange-to-an-endpoint-tp510843p510886.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


Re: Dynamically setting retry count in maximumRedilveries attribute

2010-06-23 Thread gnanda1

Thank you Willem . It worked.

-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamically-setting-retry-count-in-maximumRedilveries-attribute-tp510764p510927.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Clustering with camel-quartz

2010-06-23 Thread Ingo Düppe
Hi,

I added two patches to the jira issue. One for version 2.3.0 and one for
the trunk. Please check the patches and inform me if you will use them
in the next version. If you will use it then I could build my private
patched version until we can upgrade to the next up coming camel version.

Regards

Ingo

Btw. the problems with the current trunk were with the tests cases
something around camel-jetty (i guess) - but I cannot reproduce it right
now.





Re: Problem with maintaining a JMS subscription after waking from sleep

2010-06-23 Thread huntc

Hi Willem,


Willem.Jiang wrote:
 
 Hi,
 
 As Camel is used within ActiveMQ and ServiceMix, we can't just upgrade 
 Spring version in Camel.
 But there is spring3 profile in camel parent/pom.xml, you can build 
 camel with spring 3.0.3.RELEASE with that profile if you like.
 
 

Sounds to me that a few Apache projects need a strategy to move toward
Spring 3. We've got to upgrade sometime. 

Given the build profile you mention, how about releasing Camel as Spring 3,
but require that slower moving projects build their own distribution based
on Spring 2?
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-maintaining-a-JMS-subscription-after-waking-from-sleep-tp510193p510985.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CAMEL-CXF, PHP and the ?xml ...? header

2010-06-23 Thread Willem Jiang

William Tam wrote:



On 06/23/2010 04:18 AM, Willem Jiang wrote:

Hi,

I just tried the solution of the JAXWS Handler, it only print out the 
soap message and doesn't change the output stream which is sent to 
client.


Is it a bug in CXF then?  That's supposed to be the JAXWS way to go 
about it.


I don't think this a bug of CXF, but we can add some code in 
StaxOutInterceptor to look up the SOAP message context which is set by 
the JAXWS SOAP handler for this option.


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





After digging a while, I found the StaxOutInterceptor[1] will check 
the message context with the key of 
org.apache.cxf.stax.force-start-document to decide if it will send 
the xml declaration.


So you can configure this interceptor[2] into the camel-cxf endponit 
or setting the message header when you return the response to the cxf 
client.


BTW, the last option only work in Camel 2.4 SNAPSHOT [3].

[1]http://www.docjar.com/html/api/org/apache/cxf/interceptor/StaxOutInterceptor.java.html 

[2]https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/WriteXmlDeclarationInterceptor.java 


[3]https://issues.apache.org/activemq/browse/CAMEL-2841

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


William Tam wrote:
There is a way of adding the XML header by using JAXWS handler.   
http://stackoverflow.com/questions/1614431/webservicice-with-apache-cxf-and-custom-headers 



But, let me see if there is a easier way to it without requiring 
handler.


On 06/21/2010 11:50 AM, S. Ali Tokmen wrote:

Hello

I have routes that use CAMEL-CXF. When I call these routes via 
SoapUI, JAX-WS, JAX-RPC or even Microsoft C# these work perfectly.


BUT, when I try with PHP (whether NuSOAP or the new SoapClient), I 
have a PHP error like:


   Error:sendSms: SoapFault exception: [Client] looks like we got no
   XML document in [...]

If I look at the HTTP response generated by CAMEL-CXF, its response 
looks like:


   HTTP/1.1 200 OK
   Server: Apache-Coyote/1.1
   Content-Type: multipart/related; type=application/xop+xml;
   boundary=uuid:7de96b4c-37f3-4835-9519-7adad8ce8114;
   start=root.mess...@cxf.apache.org; start-info=text/xml
   Content-Length: 1235
   Date: Mon, 21 Jun 2010 15:32:15 GMT


   --uuid:7de96b4c-37f3-4835-9519-7adad8ce8114
   Content-Type: application/xop+xml; charset=UTF-8; type=text/xml;
   Content-Transfer-Encoding: binary
   Content-ID: root.mess...@cxf.apache.org

soap:Envelope
   
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:Body[...]/soap:Body/soap:Envelope 


   --uuid:7de96b4c-37f3-4835-9519-7adad8ce8114--

As a result, the SOAP content doesn't start with:

?xml version=1.0 encoding=utf-8?

... and I think that's what making PHP fail.

Any ideas on putting the XML header in front of the SOAP response?

Cheers