Re: Restlet HTTP status and message

2010-10-01 Thread Claus Ibsen
Hi

Ah looks like an oversight in the restlet component. I have created a
ticket to add the status code and some other details missing
https://issues.apache.org/activemq/browse/CAMEL-3185


On Fri, Oct 1, 2010 at 10:00 AM, mat127 p3tr.matou...@gmail.com wrote:

 I am afraid the restlet component does not set the HTTP response code
 anywhere. I am using a simple logger to inspect the Exchange instance
 comming from the restlet:

        bean id=header.logger
                 class=ExchangeHeadersInspector /

 where the ExchengeHeadersInspector is coded in Scala:

 import org.apache.camel.Exchange
 import se.scalablesolutions.akka.util.Logging

 import org.apache.camel.Processor

 class ExchangeHeadersInspector extends Processor with Logging {

   def process(exchange: Exchange): Unit = {
       log.debug(in.headers: %s format exchange.getIn.getHeaders)
       log.debug(exchange.properties: %s format exchange.getProperties)
       log.debug(exchange.failed: %s format exchange.isFailed)
   }

 }

 As you can see from the log produced by it there is no key
 CamelHttpResponseCode within the exchange.getIn.getHeaders map:

 [DEBUG] [2010-09-30 14:57:47,017] [main]
 c.b.i.c.a.l.ExchangeHeadersInspector: in.headers:
 {org.restlet.http.headers=[Server: Apache-Coyote/1.1, Content-Type:
 text/html;charset=utf-8, Content-Length: 1090, Date: Thu, 30 Sep 2010
 12:57:46 GMT, Connection: close]}
 [DEBUG] [2010-09-30 14:57:47,018] [main]
 c.b.i.c.a.l.ExchangeHeadersInspector: exchange.properties:
 {CamelToEndpoint=http:// ... }
 [DEBUG] [2010-09-30 14:57:47,018] [main]
 c.b.i.c.a.l.ExchangeHeadersInspector: exchange.failed: false

 Is it possible that it is stripped down from the Exchange while routing from
 the restlet to my process component?

 Anyway I also tried something similar that Claus suggested and inserted some
 validation before the JSON unmarshalling:

                camel:route
            camel:from uri=direct:rest/
            camel:to uri=restlet:http://somewhere.net/path/to/rest/api/
            camel:process ref=header.logger /
            camel:validate
                camel:simple${header.CamelHttpResponseCode} == 
 200/camel:simple
            /camel:validate
            camel:unmarshal ref=json /
                /camel:route

 And even in case of 200 response code I received exception as there is no
 CamelHttpResponseCode key in the headers map:

 SEVERE: Failed delivery for exchangeId:
 b71067ad-e305-4762-a4e7-f7baab6dd42d. Exhausted after delivery attempt: 1
 caught: org.apache.camel.processor.validation.PredicateValidationException:
 Validation failed for Predicate[header(CamelHttpResponseCode) == 200].
 Exchange[Message: ... ]
 org.apache.camel.processor.validation.PredicateValidationException:
 Validation failed for Predicate[header(CamelHttpResponseCode) == 200].
 Exchange[Message: ... ]
 ...

 Petr
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Restlet-HTTP-status-and-message-tp3047023p3068911.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


Camel-FTP

2010-10-01 Thread Prerna Kaul
How do I specify a proxy url on the camel ftp endpoint?? There doesn't 
seem to be an example here - http://camel.apache.org/ftp2.html

I would really appreciate any help I you could give me.

Thanks!


---
This communication may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this communication
in error) please notify the sender immediately and destroy this
communication. Any unauthorized copying, disclosure or distribution of the
material in this communication is strictly forbidden.

Deutsche Bank does not render legal or tax advice, and the information
contained in this communication should not be regarded as such.

Re: Camel-FTP

2010-10-01 Thread Richard Kettelerij

Camel's FTP component uses the FTPClient included in Apache Commons Net. The
FAQ of Commons net discusses how to setup FTP connections through a proxy.
Take a look at http://wiki.apache.org/commons/Net/FrequentlyAskedQuestions
and scroll down to Does FTPClient support FTP connections through an FTP
proxy server?
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-FTP-tp3072992p3073044.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Social component 'PoC' ready

2010-10-01 Thread Bruno Borges
It will depend on the provider (social network).

The component itself has support for updating social stream.

For instance:

from(direct:a).to(social://twitter/home);

Will update user status.


Bruno Borges
www.brunoborges.com.br
+55 21 76727099

The glory of great men should always be
measured by the means they have used to
acquire it.
 - Francois de La Rochefoucauld



On Fri, Oct 1, 2010 at 1:46 PM, Donald Whytock dwhyt...@gmail.com wrote:

 This is input-only, correct?  Are there plans for output component(s) too?

 Don

 On Thu, Sep 30, 2010 at 3:08 PM, Bruno Borges bruno.bor...@gmail.com
 wrote:
  Hadrian, remember the talk we had on ApacheCon 2009?
  I know I took almost a year to have this thing done. Sorry for taking so
  long! But here it goes.
 
  I just want to state that Neociclo http://www.neociclo.com supported
 me a
  lot on achieving this.
  Not only we were able to code the Camel
  OFTPhttp://accord.ow2.org/odetteftpcomponent but now also I had time
  and motivation to finish this component.
 
  *Camel Social*
  http://code.google.com/p/camel-social
 
  The component is a PoC to poll social stream path in a uniform way from
  social networks.
 
  Some features:
  - supports OAuth
  - supports Basic Auth (wrapped by a OAuth credentials object (token =
  username, secret = password)
  - supports uniform SocialData (a unique id and the data itself)
  - supports skip read social data (saves unique id for future polling and
  skip them)
  - supports custom social providers (just implement a SocialProvider)
  - supports Twitter out of the box
  - has Facebook and Foursquare classes ready to be implemented
  - supports RateLimitExceededException to sleep consumer thread for a
 while
  - supports session/non-session aware social providers
  - supports social data producer on social stream path
 
  *In a nutshell: *
  from(social://twitter/public?skipRead=truedelay=5000)
  .transform(xpath(//status/text/text()).stringResult())
  .process(new Processor() {
  *public void* process(Exchange arg0) *throws* Exception {
  System.*out*.print(arg0.getIn().getHeader(SocialHeaders.*SOCIAL_DATA_ID*)
 + :
  );
  System.*out*.println(arg0.getIn().getBody());
  }
  });
 
  *How it works:*
  - there can be only one pair of OAuth consumer token and consumer secret
  (from client application) per endpoint
  - OAuth is not required but recommended because of data fetch rate limits
  (150 requests per hour on Twitter; 350 if OAuthed)
  - endpoint can have user oauth token/secret. In this case, it will poll
  data. Otherwise it will work as event-based consumer
  - exchanges going to this endpoint's producer with OAUTH header user's
  token/secret and POLL_STREAM header to true will fire consumers to poll
 data
  for that user
  - exchanges going to this endpoint's producer with SOCIAL_DATA header to
 be
  updated will require user's OAuth either specified on the endpoint or
 within
  message headers
  - endpoint specifies the social (stream) path. For example, in Twitter
  provider there's support for user's home timeline and the public
 timeline.
  social://twitter/home or social://twitter/public
  - the provider must be able to return unique social data from the
 requested
  social path
  - social data is retrieved as is from the social network and can be
  retrieved on message body, processed either by XPath (case of
  Twitter/Foursquare provider) and JSON (case of Facebook)
 
  *Things to consider*
  - must the component require providers to present social data on unified
  format? (twitter can provide xml/json/rss; facebook provides only json)
  - must the one component's endpoint be able to stream social data for
  different client's oauth token/secret? Like it does per user
 
  *What's next?*
  - consider to move this component to Camel trunk
  - consider to have main social network providers (Twitter, Facebook,
  Foursquare, Orkut, Buzz)
  - optimize the data fetch process (take a look at AbstractTwitterPath)
 
  Now, I definitely need some help on this to provide better support for
  different social networks and social paths.
  Anybody interested?
 
  Cheers!!
 
  Bruno Borges
  www.brunoborges.com.br
  +55 21 76727099
 
  The glory of great men should always be
  measured by the means they have used to
  acquire it.
   - Francois de La Rochefoucauld
 



message losing headers

2010-10-01 Thread Mark Webb
I am passing a message through a series of Processors and in the
course of this processing I am setting header information in the
Message objects.  I have run into a problem where after setting a
header value in one Processor, the next Processor in the routing does
not see it.  I have run through steps to try and determine what is
going on, and cannot figure it out.  I am using ActiveMQ 5.4.1 and
Camel 2.4.0.

Thanks


Re: How to handle firefox outputting files, as component?

2010-10-01 Thread David Yang

Thanks for the response Richard - was very helpful.

Any sense of how large exchange message bodies can get?  Should we use that 
itself as the transfer mechanism or have some other form of transport?

I'm also curious if we want to reuse a bunch of these components we're creating 
across various projects and also share them with the community, what's the best 
way to bundle them up?  

David

On Sep 30, 2010, at 8:11 PM, Richard Kettelerij wrote:

 
 A Camel component is essentially a processor. In general components are more
 suitable for reusable pieces of integration logic (like wrapping transports
 such as ftp, tcp, ws, etc) while processors are more suitable for adhoc
 tasks that you want to perform as part of your route (like validating the
 payload of a message or some custom transformation). 
 
 The question to ask whether you should build a component or a processor is:
 do you want to (re)use the Firefox PDF functionality in other, possibly
 future, routes? If so, you're probably beter of writing a component since it
 allows for better encapsulation of the pdf-to-html conversion logic. Most
 notably because the component has a well defined interface as illustrated in
 your example (firefoxpdf:///usr/bin/firefox).
 
 But remember, writing a component is a bit more work than writing a
 processor (e.g. more interfaces to implement). If your pdf-to-html
 conversion is specific to some route a processor such as the one given below
 will suffice.
 
 from(file://myhtmlfiles).process(new Processor() {
  public void process(Exchange exchange) throws Exception {
 // classes are just for illustration
 Converter converter = new FirefoxConverter();
 Html html =
 converter.convertToHtml(exchange.getIn().getBody());
 exchange.getIn().setBody(html);
   }
 }).to(file://mypdffiles) 
 
 -- 
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-to-handle-firefox-outputting-files-as-component-tp3047751p3047804.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to handle firefox outputting files, as component?

2010-10-01 Thread Bruno Borges
Usually, files are not transported inside the message. They are written to
the disk and a reference to it is then exchanges (java.io.File).

I guess you will have no problem about that.

Cheers
Bruno Borges
www.brunoborges.com.br
+55 21 76727099

The glory of great men should always be
measured by the means they have used to
acquire it.
 - Francois de La Rochefoucauld



On Fri, Oct 1, 2010 at 4:54 PM, David Yang david.y...@coverago.com wrote:


 Thanks for the response Richard - was very helpful.

 Any sense of how large exchange message bodies can get?  Should we use that
 itself as the transfer mechanism or have some other form of transport?

 I'm also curious if we want to reuse a bunch of these components we're
 creating across various projects and also share them with the community,
 what's the best way to bundle them up?

 David

 On Sep 30, 2010, at 8:11 PM, Richard Kettelerij wrote:

 
  A Camel component is essentially a processor. In general components are
 more
  suitable for reusable pieces of integration logic (like wrapping
 transports
  such as ftp, tcp, ws, etc) while processors are more suitable for adhoc
  tasks that you want to perform as part of your route (like validating the
  payload of a message or some custom transformation).
 
  The question to ask whether you should build a component or a processor
 is:
  do you want to (re)use the Firefox PDF functionality in other, possibly
  future, routes? If so, you're probably beter of writing a component since
 it
  allows for better encapsulation of the pdf-to-html conversion logic. Most
  notably because the component has a well defined interface as illustrated
 in
  your example (firefoxpdf:///usr/bin/firefox).
 
  But remember, writing a component is a bit more work than writing a
  processor (e.g. more interfaces to implement). If your pdf-to-html
  conversion is specific to some route a processor such as the one given
 below
  will suffice.
 
  from(file://myhtmlfiles).process(new Processor() {
   public void process(Exchange exchange) throws Exception {
  // classes are just for illustration
  Converter converter = new FirefoxConverter();
  Html html =
  converter.convertToHtml(exchange.getIn().getBody());
  exchange.getIn().setBody(html);
}
  }).to(file://mypdffiles)
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/How-to-handle-firefox-outputting-files-as-component-tp3047751p3047804.html
  Sent from the Camel - Users mailing list archive at Nabble.com.




Re: message losing headers

2010-10-01 Thread Stephen Gargan
You may want to read the Notes section in the JMS Component where is
describes valid headers.

http://camel.apache.org/jms.html

Check that you have no '-' or the like in the header names. What do
the dropped headers look like?

thx

ste

On Fri, Oct 1, 2010 at 12:46 PM, Mark Webb elihusma...@gmail.com wrote:
 I am passing a message through a series of Processors and in the
 course of this processing I am setting header information in the
 Message objects.  I have run into a problem where after setting a
 header value in one Processor, the next Processor in the routing does
 not see it.  I have run through steps to try and determine what is
 going on, and cannot figure it out.  I am using ActiveMQ 5.4.1 and
 Camel 2.4.0.

 Thanks



Using Asynchronous Processors -- a little help

2010-10-01 Thread Seth Call
I'm a little lost on Asynchronous Processors.

My goal is to not use threads needlessly, so that's why I'm zeroed in
on Asynchronous Processors.

First off, is it fair to assume that JMS can be fully asynchronous
when using a request-reply schema?  Assuming so, here' is my problem:

I don't really understand how to set up a route such that my client
code, and my server code, both use no threads. Most examples I see are
inherently synchronous.  For instance, I can't use a bean callback on
the consumer side, I think, because that's naturally going to tie up a
thread, right?

So let me put down some routes I've been playing with (and yes, my
inline processor is synchronously coded at the moment, but obviously
it could be made asynchronous easily with that as a starting point)

from(seda:test).to(jms:queue:a.test);

from(jms:queue:a.test)

.process(new AsyncProcessor() {
@Override public boolean process(final Exchange
exchange, final AsyncCallback callback) {
String body = exchange.getIn().getBody(String.class);
exchange.getOut().setBody(echo:  + body);

bool sync = true;
callback.done(sync);
return sync;
}

@Override public void process(final Exchange
exchange) throws Exception {

}
});


I am thinking it's incorrect to use SEDA as a client endpoint, though,
because I find it only works if it's blocking synchronously on the
client side. (or am I wrong?)

I have no specific interest in using SEDA, I just want to use an
interface on the client side that allows me to fire off an exchange,
and get a callback later.  I thought SEDA was generally 'asynchronous'
so I started there.

Any suggestions for sending the message off?


Re: message losing headers

2010-10-01 Thread Mark Webb
They are just strings.  Seems like once I changed the destinations
from queues to direct:whatever the header information started
carrying over.  Must be once the message leaves Camel the header
information is gone.

Thanks for the help


On Fri, Oct 1, 2010 at 4:17 PM, Stephen Gargan steve.gar...@gmail.com wrote:
 You may want to read the Notes section in the JMS Component where is
 describes valid headers.

 http://camel.apache.org/jms.html

 Check that you have no '-' or the like in the header names. What do
 the dropped headers look like?

 thx

 ste

 On Fri, Oct 1, 2010 at 12:46 PM, Mark Webb elihusma...@gmail.com wrote:
 I am passing a message through a series of Processors and in the
 course of this processing I am setting header information in the
 Message objects.  I have run into a problem where after setting a
 header value in one Processor, the next Processor in the routing does
 not see it.  I have run through steps to try and determine what is
 going on, and cannot figure it out.  I am using ActiveMQ 5.4.1 and
 Camel 2.4.0.

 Thanks




message not getting delivered

2010-10-01 Thread Mark Webb
I am sending messages through a Camel route in ActiveMQ.  My message
reaches the end of the processing chain, and at the last processor I
call exchange.setOut( newly created DefaultMessage ).  When I look at
the admin page for ActiveMQ, the topic shows that there is a message
to be dequeued.  It even says that there is a consumer connected to
that topic, which is a GUI tool I wrote.  The GUI tool makes a call to
Consumer.setMessageListener.  So why are the messages not making their
way to my GUI tool?  I am stumped as to why the messages sit in the
topic and never leave if there is a listener for that topic.

Of course the first thought is, is the Connection started?  Yeah I
verified that.  In fact I can send messages to the topic via the
web-based admin tool for ActiveMQ and the GUI receives them.

Thanks for any help you have,
Mark


Re: How to change directory while using sftp component

2010-10-01 Thread Lorrin Nelson
Hi Claus. Ack, sorry about that. I'm pulling through github rather than SVN 
directly and then running via a Maven project pointing at my locally built 
Camel, so it's sometimes confusing how up-to-date I am.

So I think I have current code, including checkin CAMEL-3174: Changing dir 
with ftp must do one dir at a time. and I think SFTP polling is now broken for 
both absolute and relative URLs. See debug walk-throughs and stack traces below.

Absolute URI with double leading /:
sftp://u...@host//home/user/subdir?idempotent=trueidempotentRepository=#myCustomIRinclude=.*.lognoop=truepassword=**

SftpOperations.changeCurrentDirectory(home/user/subdir) //note there's no 
leading slash on the supposedly absolute path!
//splits into chunks successfully, starts looping through chunks
doChangeDirectory(home)
ChannelSftp.cd(home)
//path=remoteAbsolutePath(path);
//yields /home/user/home. Doh!


Relative URI with single leading /:
sftp://u...@host/subdir?idempotent=trueidempotentRepository=#myCustomIRinclude=.*.lognoop=truepassword=**
SftpOperations.changeCurrentDirectory(subdir)
//splits into single chunk, starts looping through chunks
doChangeDirectory(subdir)
ChannelSftp.cd(home)
//path=remoteAbsolutePath(path);
//yields /home/user/subdir. yay!

..but then, back in SftpOperations.retrieveFileToStreamInBody, it hits the 
change back to current directory code
changeCurrentDirectory(/home/tomcat); //now we have a leading slash, unlike 
before
//splits info chunks , home, and tomcat. Doh!
doChangeDirectory()
ChannelSftp.cd()
//path=remoteAbsolutePath(path) throws a 
StringIndexOutOfBoundsException when it receives empty string.


Stack trace when attempting to supply absolute path:
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot 
change directory to: home
at 
org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:372)
at 
org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:361)
at 
org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:428)
at 
org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:407)
at 
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:299)
at 
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:155)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:121)
at 
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:97)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at 
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Caused by: 2: No such file
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2289)
at com.jcraft.jsch.ChannelSftp._realpath(ChannelSftp.java:1822)
at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:268)
at 
org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:370)
... 16 more


Stack trace when relative URL tries to restore current working directory:
SftpConsumer 2010-10-01 13:41:58,529 -- ERROR -- Caused by: 
[org.apache.camel.component.file.GenericFileOperationFailedException - Cannot 
change directory to: ]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot 
change directory to: 
at 
org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:372)
at 
org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:361)
at 
org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:435)
at 
org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:407)
at 
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:299)
at 
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:155)
at 

Re: message losing headers

2010-10-01 Thread Donald Whytock
I tried passing headers in messages on a SEDA queue, and saw that the
header name was converted from mixed case to lowercase by the
setHeader() method.  Is this intended behavior?

And is it perhaps making headers appear to disappear?

Don

On Fri, Oct 1, 2010 at 4:24 PM, Mark Webb elihusma...@gmail.com wrote:
 They are just strings.  Seems like once I changed the destinations
 from queues to direct:whatever the header information started
 carrying over.  Must be once the message leaves Camel the header
 information is gone.

 Thanks for the help


 On Fri, Oct 1, 2010 at 4:17 PM, Stephen Gargan steve.gar...@gmail.com wrote:
 You may want to read the Notes section in the JMS Component where is
 describes valid headers.

 http://camel.apache.org/jms.html

 Check that you have no '-' or the like in the header names. What do
 the dropped headers look like?

 thx

 ste

 On Fri, Oct 1, 2010 at 12:46 PM, Mark Webb elihusma...@gmail.com wrote:
 I am passing a message through a series of Processors and in the
 course of this processing I am setting header information in the
 Message objects.  I have run into a problem where after setting a
 header value in one Processor, the next Processor in the routing does
 not see it.  I have run through steps to try and determine what is
 going on, and cannot figure it out.  I am using ActiveMQ 5.4.1 and
 Camel 2.4.0.

 Thanks





Re: Using Asynchronous Processors -- a little help

2010-10-01 Thread Ashwin Karpe

Hi,

There are several issues in your route definition  usage.

1 I am not sure what the first route  
from(seda:test).to(jms:queue:a.test); 
 is doing for you.

2Looking at your 2nd route segment, you are sending a request to a JMS
consumer (jms:queue:a.test).
The problem is that the JMS Consumer is taking the request as InOnly since a
replyTo parameter has not been set on the Consumer. Any response that this
Consumer needs to send back has to have a reply destination to send the
response back.

3 Not sure what you are attempting with an Async Processor. An Async
Processor is meant primarily to behave like a producer that sends an
exchange with a callback along the route. Since a callback has been
associated with the exchange and set to the next route element, the Async
Processor thread can effectively go away. When the next route element
receives the exchange or message and does its job (maybe calls other
processors synchronously) it expects to receive an modified exchange with a
done status back. When it does, it invokes the callback provided by the
AsyncProcessor, at which point, a new AsyncProcessor thread is created and
the message then can be handled and sent back. Is it were a synchronous
request, the AsyncProcessor thread would have to be in Thread_WAIT.
Hence it is more efficient thread-wise in situations where responses may
arrive after a long duration.

Check out the following links for code samples how to do this and how things
work
https://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointTest.java?view=markup
AsyncEndpointTest 

https://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/MyAsyncComponent.java?view=markup
MyAsyncComponent 

Hope this clarifies things.

Cheers,

Ashwin...

-
-
Ashwin Karpe
Apache Camel Committer  Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com
http://opensourceknowledge.blogspot.com 
-
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Using-Asynchronous-Processors-a-little-help-tp3073267p3073501.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to receive soap response attachment using Camel-Http component

2010-10-01 Thread Ashwin Karpe

Hi,

You cannot do this using a camel-http endpoint. The HTTP endpoint supports
all kinds of Markup Languages and does not care about SOAP, XML, HTML etc...

In order to get proper attachment support you need to use a CXF producer
endpoint,  when the response arrives, use a processor to get the attachment
from the Camel Message Exchange.  

For example

   from(direct:foo)
   .to(cxf:http://host:port/myservice?...)
   .process(new Processor() {
public void process(Exchange exchange) throws Exception
{
  DataHandler dr =
exchange.getOut().getAttachment(photoId);
  if
(dr.getContentType().equalsIgnoreCase(application/octet-stream) {
 LOG.info(Got a GIF/JPEG);
  }
}
 });

Hope this helps.

Cheers,

Ashwin...

-
-
Ashwin Karpe
Apache Camel Committer  Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com
http://opensourceknowledge.blogspot.com 
-
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-receive-soap-response-attachment-using-Camel-Http-component-tp2856274p3073555.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: publishedEndpointUrl for cxf:cxfEndpoint

2010-10-01 Thread Scott Christopher
On 02/10/2010, at 1:18 AM, Ashwin Karpe wrote:

 Not sure why setting the address attribute in the spring.xml file does not
 change the address for you since that is the value that overrides the WSDL
 address... I know that it works!!!

My apologies, the cxfEndpoint address does allow you to set any hostname, which 
updates the generated WSDL accordingly (I was confusing it with the Jetty 
component, which doesn't allow you to bind to a hostname that doesn't resolve 
to an IP address on a local interface).

The caveat still remains though, as we need the address in the SOAP WSDL to 
specify the use of HTTPS on port 443, and we need the CXF endpoint to use 
standard HTTP on an unprivileged port ( 1024) as we can't run this as a root 
user.

If this can't be achieved through configuration of the cxfEndpoint bean, I 
guess we'll just have to publish a static WSDL with the correct details.

Regards,
Scott Christopher.