Camel Producer with Path

43 views
Skip to first unread message

Channing Walton

unread,
Aug 3, 2012, 6:31:28 AM8/3/12
to akka...@googlegroups.com
Hi,
I need to connect to a restful service at some host, and grab documents based on a path. eg

class Downloader extends Actor with Producer {
    override def endpointUri = "http://a.b.c/"
}

then

val downloader = Actor.actorOf[Downloader].start()
val response = downloader !! "/trade/1234"

and the body of the response should have a string (json/xml/etc)

But, the above isn't working for me because the path being sent to the actor is being ignored.

I tried adding:

  override protected def receiveBeforeProduce = {
      case msg: Message ⇒ msg.setHeaders(msg.headers(Set(Exchange.HTTP_PATH)))
  }

But that failed too.

How can I do this?

Channing

√iktor Ҡlang

unread,
Aug 3, 2012, 7:36:41 AM8/3/12
to akka...@googlegroups.com
Hi Channing,

Sounds like you could benefit from using AsyncHttpClient and have a bridge over to Akka Futures.

Cheers,


Channing

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/QVtbkHUP0uwJ.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.



--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Channing Walton

unread,
Aug 3, 2012, 8:29:09 AM8/3/12
to akka...@googlegroups.com
Thanks I'll look at that. I'm also looking at spray which might be a good bet too,

Viktor Klang

unread,
Aug 3, 2012, 8:31:28 AM8/3/12
to akka...@googlegroups.com
On Fri, Aug 3, 2012 at 2:29 PM, Channing Walton
<channin...@googlemail.com> wrote:
> Thanks I'll look at that. I'm also looking at spray which might be a good
> bet too,

Absolutely, Spray is cool
Reply all
Reply to author
Forward
0 new messages